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

[FEAUTURE] Polish language and [BUG] Light mode dropdowns issue #139

Open
wilczek112 opened this issue Jan 21, 2025 · 2 comments
Open

[FEAUTURE] Polish language and [BUG] Light mode dropdowns issue #139

wilczek112 opened this issue Jan 21, 2025 · 2 comments

Comments

@wilczek112
Copy link

wilczek112 commented Jan 21, 2025

Hello, is it possible to add support of Polish language to main branch?

I have already prepared necessary changes and new files so feel free to use it, it works locally for me.

Also is there possibility to introduce default server language? It always opens in English by default and browser language doesn't change anything.

Last thing to mention is that text inside dropdowns is not visible in light mode.

pl.json

pl.svg

Line of code to add to dropdown within style-vertical-menu.blade.php:

getLocale() == 'pl' ? 'selected' : '' }} value="pl" data-image="{{ Vite::asset('resources/images/1x1/pl.svg') }}">Polski

Have a good one ;-D

@wilczek112
Copy link
Author

To repair light view in file: resources/scss/dark/assets/main.scss you have to remove this from last lines of file:

.form-select {
color: white;
border: 1px solid #2d8f8a !important;
}

@wilczek112
Copy link
Author

To introduce app language based on browser's language, add the following lines of code to beginning of handle function:

$language = $request->cookie('language');

    if (!$language) {
         //Get Browser Lang.
         $browserLang = substr($request->server('HTTP_ACCEPT_LANGUAGE'), 0, 2);
          if(in_array($browserLang ,['bg', 'cz', 'de', 'en', 'es', 'fr', 'hu', 'it', 'ja', 'ko', 'pl', 'pt', 'ro', 'ru', 'sk', 'tr', 'uk', 'zh'])){
              $language = $browserLang;
          }else {
             $language = 'en';
        }
    }

These lines should be placed in the file: app/Http/Middleware/SetLanguage.php.

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

1 participant