Showing 10 of 1,278 results.

setSelector(MessageSelector $selector) | The Laravel Translator

The setSelector method sets a Symfony\Component\Translation\MessageSelector instance ( $selector ) for the Translator . The MessageSelector instance is used by the choice and transChoice methods for loading the correct translation message based on...

getSelector() | The Laravel Translator

The getSelector() method returns the instance of \Symfony\Component\Translation\MessageSelector that the translator is currently using. If no MessageSelector has been previously set, a new instance of MessageSelector is created and returned.

getLoader() | The Laravel Translator

The getLoader method is used to return the instance of the Illuminate\Translation\LoaderInterface implementation the translator is currently using. By default, this will be an instance of Illuminate\Translation\FileLoader , which is registered...

getLocale() | The Laravel Translator

The getLocale method is used to retrieve the current locale being used by the translator. The method is required by Symfony's TranslatorInterface . 1 <?php 2 3 // Get a `Translator` instance from the application container. 4 $ translator = app ( '...

locale() | The Laravel Translator

The locale() method is functionally identical to the getLocale() method. It internally returns the value of the getLocale() method. 1 <?php 2 3 // Get a `Translator` instance from the application container. 4 $ translator = app ( ' translator ' )...

setLocale($locale) | The Laravel Translator

The setLocale method is used to set the locale that the translator should use. It accepts only one parameter $locale , which is the locale that should be set. By default, it is set to the value defined for locale in the app.php configuration file.

getFallback() | The Laravel Translator

The getFallback() method is used to return the fallback locale that the translator is currently using. A fallback locale is used when a translation for a different locale cannot be found. 1 <?php 2 3 // Get a `Translator` instance from the...

setFallback($fallback) | The Laravel Translator

The setFallback method is used to set the fallback locale that the translator should use. It accepts only one parameter $fallback , which is the fallback locale that should be set. By default, it is set to the value defined for fallback_locale in...