In laravel 4.x we have lang class which will help us to retrieving string in different languages that will help us to easily support multiple languages.
The folder structure for lang files are
/app
/lang
/en
messages.php
/es
messages.php
Example:
Language files always give an array of keyed strings.
<?php
return array(
'welcome' => 'Welcome to our application'
);
Note: we can also change our default language by changing in the app/config/app.php configuration file.
App::setLocale('es');
0 Comment(s)