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

How to change language / use lang files from sendportal-core? #309

Open
noehmeier opened this issue Aug 10, 2024 · 3 comments
Open

How to change language / use lang files from sendportal-core? #309

noehmeier opened this issue Aug 10, 2024 · 3 comments

Comments

@noehmeier
Copy link

Hi there,

i try to change language to German (de). I saw, that in sendportal-core is already a translation, so i don't have to translate it myself. It is in vendor\mettle\sendportal-core\resources\lang as de.json file.

I checked config/sendportal-host.php and added the de local:

    'locale' => [
        'supported' => [
            'en' => ['name' => 'English', 'native' => 'English'],
            'de' => ['name' => 'Deutsch', 'native' => 'Deutsch'],
        ],
    ],

After that, i can change in user profile the language:

grafik

I also changed the default language in config/app.php:

'locale' => 'de',

When i check with {{App::currentLocale();}} the actual used language, i get de. So this seems to be configured fine, but the app is still in English.

From Laravel docs (https://laravel.com/docs/11.x/localization#overriding-package-language-files), i also tried to copy the de.json to lang\vendor\mettle\sendportal-core\de or lang\vendor\mettle\de or lang\vendor\mettle\sendportal-core\de (don't know what {package} exactly means here), but the app is still in English.

What do i have to do that the apps uses the de.json file?

Thank you in advance!

@carstengrimm
Copy link

I am interested in this as well. Any news?

@carstengrimm
Copy link

It seems to me that views are also cached in PHP files, in storage/framework/views/

maybe after making those changes to the language settings the cache needs to be cleared

@vaclavvidon
Copy link

I am afraid the strings are just hardcoded into the .php files.

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

3 participants