I translated Laravel manually, but after the translation these codes from the picture appeared. How can I handle the problem?
I tried to find these codes in the translation file but couldn't find them. I expect the problem to be fixed.
I translated Laravel manually, but after the translation these codes from the picture appeared. How can I handle the problem?
I tried to find these codes in the translation file but couldn't find them. I expect the problem to be fixed.
If you want to translate the text string "Welcome" to Spanish, you can create a "/lang/es/messages.php" file containing:
<?php
return [
'welcome' => 'Bienvenido',
];
Then, in your Blade view, you can use the built-in translation function in Laravel to retrieve the translated string:
echo __('messages.welcome');
Laravel will automatically retrieve the appropriate text string for the currently selected language in your application. If the current language is Spanish, Laravel will display "Bienvenido" instead of "Welcome".
For your case, for the English language you have a default file "lang/en/default_lang.php" and for the Spanish language you got "lang/es/default_lang.php" with following content.
<?php
// lang/en/default_lang.php
return [
'invoice_overview' => 'Invoices',
'all_tasks_overview' => 'All tasks',
];
// lang/es/default_lang.php
return [
'invoice_overview' => 'Facturas',
'all_tasks_overview' => 'Todas las tareas',
];
You can use it in your application using the @lang
blade directive or __()
helper in your views, controllers or mails for example.
Check the official Laravel documentation for more details about localization.