Skip to content

what about rtl languages #11

Description

@saber13812002

how can i apply changes for rtl languages like arabic or persian?

Activity

  1. kai890707 commented on Oct 20, 2022

    @kai890707

    Hi, @saber13812002
    You can do this.
    First,open your project to config/admin.php,then find the extensions array , the following code.

    'multi-language' => [
                'enable' => true,
                // the key should be same as var locale in config/app.php
                // the value is used to show
                'languages' => [
                    'en' => 'English',
                    'zh-CN' => '簡體中文',
                    'zh-TW' => '繁體中文',
                    'fa'         =>'Persian',
                    'ar'         =>'Arabic'
                ],
                // default locale
                'default' => 'zh-TW',
                // if or not show multi-language login page, optional, default is true
                'show-login-page' => true,
                // if or not show multi-language navbar, optional, default is true
                'show-navbar' => true,
                // the cookie name for the multi-language var, optional, default is 'locale'
                'cookie-name' => 'locale'
            ],

    Second,find the Http/Kernel.php file,and append the following code in $middlewareGroups array .

    protected $middlewareGroups = [
            'web' => [
                \App\Http\Middleware\EncryptCookies::class,
                \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
                \Illuminate\Session\Middleware\StartSession::class,
                // \Illuminate\Session\Middleware\AuthenticateSession::class,
                \Illuminate\View\Middleware\ShareErrorsFromSession::class,
                \App\Http\Middleware\VerifyCsrfToken::class,
                \Illuminate\Routing\Middleware\SubstituteBindings::class,
                //add this one.
                \KevinSoft\MultiLanguage\Middlewares\MultiLanguageMiddleware::class
            ],
    
            'api' => [
                // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
                'throttle:api',
                \Illuminate\Routing\Middleware\SubstituteBindings::class,
            ],
        ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions