Closed PetroGromovo closed 2 years ago
Hey Petro yes, since you are doing that with an AJAX request, you may need to use the: https://github.com/xiCO2k/laravel-vue-i18n#loadlanguageasynclang-string functions as it is shown on the README.
If you want to control all from the backend you just need to make sure the <html lang="">
is set to the correct one.
Hope that helps.
I need to add i18n support in Laravel 9/Inertiajs2/vuejs3 app and I try to use "laravel-vue-i18n": "^1.4.4". I added 2 dirs AppPath/lang/en and AppPath/lang/ua and in resources/js/app.js I added i18n support :
and in webpack.mix.js :
As result I have 2 generated files in public/js/lang_php_en_json.js and public/js/lang_php_ua_json.js with all labels from AppPath/lang/ and english label is applyed in vue file with {{ $t(' method.
I need to set ua as default language. I set in config/app.php :
'locale' => 'ua',
it works.But I failed to change locale to en with control method :
On client side I still see "ua" labels have I to set changes locale on js side somehow ?
Thanks in advance!