odan / slim4-skeleton

A Slim 4 Skeleton
https://odan.github.io/slim4-skeleton/
MIT License
439 stars 80 forks source link

Change default language #17

Closed carlosnarro closed 4 years ago

carlosnarro commented 4 years ago

Hi @odan,

I need to change the default language. I have created my new language and if I assign the new language to the user, it works correctly with de logged user. But if I go to config > defaults.php and modify the language in the parameter 'locale' with _'deDE' or my new language, the language on the home page remains in English.

Should I do something else?

Thanks

odan commented 4 years ago

The default locale in config/defaults.php is en_US.

If the user is not logged, the TranslatorMiddleware uses also en_US as default locale.

If the user is logged-in and has a locale (defined in the database field: users.locale) then the TranslatorMiddleware will switch to that specific local of the user.

carlosnarro commented 4 years ago

Ok! thanks a lot :D