Apply multi language for your new plugin

  • Open /plugins/<your-plugin>/src/Providers/<YourPlugin>ServiceProvider.php. Add below code to function boot

Language switcher

Adding language switcher to your theme.

Add to your theme views.

{!! apply_filters('language_switcher') !!}

Customize switcher.

If you want to custom language switcher, you can modify this file: platform/plugins/language/resources/views/partials/switcher.blade.php

If you have a fixed number of languages you can use hardcode HTML like this.

        <a href="{{ url('en') }}">
            <img src="{{ url('vendor/core/images/flags/us.png') }}" title="English" alt="English">                            
    <li >
        <a href="{{ url('vi') }}">
            <img src="{{ url('vendor/core/images/flags/vn.png') }}" title="Tiếng Việt" alt="Tiếng Việt">                      
            <span>Tiếng Việt</span>