Laravel - I18n
How can we do localization with Laravel?
View::make('home')->width('newMessagesCount',1)
{{ trans('greetings.hello') }}
{{ Lang::get('greetings.hello') }}
{{ Lang::get('greetings.hello', array('username' => $username)) }}
{{ Lang::choice('messages.new', $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.
page revision: 0, last edited: 22 Oct 2016 09:06





