Provides the translation related functions.
Configure the locale to use for translations.
Parameters: |
|
---|
Loads a dictionary for the current locale.
Parameters: |
|
---|
Retrieves a translation from the last loaded dictionary.
Parameters: |
|
---|---|
Returns: | The translation or null if not founded |
Retrieves a translation from a specific dictionary.
Parameters: |
|
---|---|
Returns: | The translation or null if not founded |
Warning
The dictionary must have been loaded manually before.
Set the current dictionary
Parameters: |
|
---|
Returns a closure that translate messages from a specific dictionary.
Parameters: |
|
---|---|
Returns: | A callable to translate a message |
<?php
// Retrieves an anonymous function
$dictionary = Nos\I18n::dictionary('mon_appli::common');
echo $dictionary('Translate this');