Laravel - I18n


How can we do localization with Laravel?

{{ trans('greetings.hello') }}
{{ Lang::get('greetings.hello') }}
{{ Lang::get('greetings.hello', array('username' => $username)) }}
{{ Lang::choice('', $newMessagesCount, array('count' => $newMessagesCount)) }}

where greetings is the name of the language file and hello is the key. Laravel keeps the language files in the app->lang folder. Each language file is a PHP file with just one statement that return a hash.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License