conedevelopment / i18n

Push your Laravel translations to the front-end and use them easily with JavaScript.
https://pineco.de/using-laravels-localization-js/
MIT License
129 stars 21 forks source link

trans() function always returns default language #30

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello, problem is that trans function in TranslationServiceProvider.php always has the same key ($translation = $file->getBasename('.php')) => trans($translation);

Because file name for all languages is the same, only directory names are unique for language. Like ../lang/en/auth.php ../lang/fr/auth.php

auth is always key for trans function and return value is always english(default).

------- EDIT laravel setLocale is the problem. Sorry. Please delete this issue