760 0 0 0
Last Updated : 2025-04-28 23:44:43
this snippet wil teach you laravel localization
laravel localization makes it easy to set various languages files in resources/lang folder . with this directory there may be subfolders for each language supported by the application .
you can add more files as you want , and in these files you provide general language lines for your project to use anywhere in your application .
these file will return associative array .. don't forget that as the example below
<?php
return [
/*
|--------------------------------------------------------------------------
| General Language Lines
|--------------------------------------------------------------------------
|
|
*/
'federal' => 'Federal',
'bills' => 'Bills',
'debates' => 'Debates',
'mps' => 'MPs',
'committees' => 'Committees',
'votes' => 'Votes',
];
you can access any general lines of these files in blade files like this
{{__('header.bills')}} // this will access bills name in the main array in resources/lang/header.php
OR USE THE ANOTHER METHOD
@lang('header.bills') // this will access bills name in the main array in resources/lang/header.php