i18n\MissingTranslationEvent $category

$category public property The category that the message belongs to public string $category = null

i18n\MessageSource translateMessage()

translateMessage() protected method Translates the specified message. If the message is not found, a missingTranslation event will be triggered. If there is an event handler, it may provide a fallback translation. If no fallback translation is provided this method will return false. protected string|boolean translateMessage ( $category, $message, $language )$category string The category that the message belongs to. $message string The message to be translated. $language string The ta

i18n\MessageSource translate()

translate() public method Translates a message to the specified language. Note that unless $forceTranslation is true, if the target language is the same as the source language, the message will NOT be translated. If a translation is not found, a missingTranslation event will be triggered. public string|boolean translate ( $category, $message, $language )$category string The message category $message string The message to be translated $language string The target language return str

i18n\MessageSource loadMessages()

loadMessages() protected method Loads the message translation for the specified language and category. If translation for specific locale code such as en-US isn't found it tries more generic en. protected array loadMessages ( $category, $language )$category string The message category $language string The target language return array The loaded messages. The keys are original messages, and the values are translated messages.

i18n\MessageSource init()

init() public method Initializes this component. public void init ( )

i18n\MessageSource EVENT_MISSING_TRANSLATION

EVENT_MISSING_TRANSLATION event of type yii\i18n\MissingTranslationEvent An event that is triggered when a message translation is not found.

i18n\MessageSource $sourceLanguage

$sourceLanguage public property The language that the original messages are in. If not set, it will use the value of yii\base\Application::$sourceLanguage. public string $sourceLanguage = null

i18n\MessageSource $forceTranslation

$forceTranslation public property Whether to force message translation when the source and target languages are the same. Defaults to false, meaning translation is only performed when source and target languages are different. public boolean $forceTranslation = false

i18n\MessageFormatter parse()

parse() public method Parses an input string according to an ICU message format pattern. It uses the PHP intl extension's MessageFormatter::parse() and adds support for named arguments. Usage of this method requires PHP intl extension to be installed. public array|boolean parse ( $pattern, $message, $language )$pattern string The pattern to use for parsing the message. $message string The message to parse, conforming to the pattern. $language string The locale to use for formatting l

i18n\MessageFormatter getErrorMessage()

getErrorMessage() public method Get the error text from the last operation public string getErrorMessage ( )return string Description of the last error.