I am trying to install some lang files (localizations) into a relatively new Laravel app using the version of Laravel and PHP in the subject line.
Kind of new experience for me doing that, but I think OpenAI's API can create the *.json files required to do that quite nicely with sufficient prompts and training. I have the sample ones that I want to test.
I reside in Austria and I wanted to do German ones for Austria. That might require a country code as well, and then also for Sweden, and later Ukrainian.
It looks the localizations are kept in 2 different places though, like this ?
lang:
de:*.php
en:*.php
sv:*.php
resources/lang:
de:homepage.json
...
en:homepage.json
...
sv:homepage.json
...
There are a few thing that need to be setup in:
app.php ? I've seen different setups for that.
'locales' => [
'locale' => 'en', // the default locale
'fallback_locale' => 'en', // the fallback locale
'locales' => require __DIR__.'/locales.php', // the supported locales
'translations' => resource_path('lang'), // the path to the translation files
],
'name' => env('APP_NAME', 'Laravel'),
and also in:
locales.php ? same, different setups.
return [
'en',
'de',
'sv',
// Add more language codes as needed
];
and then also in the blade.php file:
homepage.php ? {{ __('homepage.nema_ct_mr_multiframe_sample') }}
Not setup and configured quite right yet.
It is curious that what must be the system level ones for the framework are .php and the others are .json.
I did try clearing the cache and the config and restarting the server already also.
Looking for some hints about that.
Thank you.
BTW, is it possible to just copy and paste the clipboard into the thread ?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community