Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what about rtl languages #11

Open
saber13812002 opened this issue Sep 11, 2020 · 1 comment
Open

what about rtl languages #11

saber13812002 opened this issue Sep 11, 2020 · 1 comment

Comments

@saber13812002
Copy link

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

@kai890707
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants