I have below code in my controller.
public function AllCountries() {
$Countries = (new \App\DataAccess\CountryData())->GetAllCountries();
app()->setLocale('fr');
return view('Country.List')->with('Countries', $Countries->getData()->CountryList);
}
Definition of method to fetch data is below.
public function GetAllCountries() {
return response()->json(['CountryList' => \App\Models\CountryModel::all()]);
}
In English language file I have below code.
return [
'CountryName' => "E Country"
];
In French language file I have below code.
return [
'CountryName' => "F Country"
];
In View file I have below code.
{!! trans('CountriesList.CountryName') !!}
Normally when we see websites which is not a default language set in our browser. We see a notification to translate the page on Page load. See the screenshot below.
But this does not come on my side. Although I can see French language but Translation notification is not coming so that I can translate it in English. Why?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire