Echo __('messages.welcome');
echo __('I love programming.');
{{ __('messages.welcome') }}
@lang('messages.welcome')
Replacing Parameters In Translation Strings
'welcome' => 'Welcome, :name',
Echo __('messages.welcome', ['name' => 'dayle']);
'welcome' => 'Welcome, :NAME', // Welcome, DAYLE
'goodbye' => 'Goodbye, :Name', // Goodbye, Dayle
Pluralization
'apples' => 'There is one apple|There are many apples',
'apples' => '{0} There are none|[1,19] There are some|[20,*] There are many',
Echo trans_choice('messages.apples', 10);
'minutes_ago' => '{1} :value minute ago|[2,*] :value minutes ago',
echo trans_choice('time.minutes_ago', 5, ['value' => 5]);
'apples' => '{0} There are none|{1} There is one|[2,*] There are :count',
Is a complex problem, as different languages have a variety of complex rules for pluralization.