In my SPA the register form works correctly and displays the validation error messages in English. To get them in an other language, I previously switch the laravel app 's language by mean of a controller that does the following.
public function index(Request $request){
App::setLocale($request->lang);
session()->put('locale', $request->lang);
return response()->json([App::getLocale(),session()->get('locale')]);
}
The returned response is correct
["fr","fr"]
Thus, I am authorized to think that the Laravel app has its language set to French.
In the lang
folder, I made a copy of all the stuff under en
into a fr
folder. Then I translated some of the messages that appear as error when I enter bad values. Unfortunately the messages still appear in English!?
What else should I do? Thanks for your help.
0 comments:
Post a Comment
Thanks