i18n\MessageFormatter getErrorCode()

getErrorCode() public method Get the error code from the last operation public string getErrorCode ( )return string Code of the last error.

i18n\MessageFormatter format()

format() public method Formats a message via ICU message format It uses the PHP intl extension's MessageFormatter and works around some issues. If PHP intl is not installed a fallback will be used that supports a subset of the ICU message format. public string|boolean format ( $pattern, $params, $language )$pattern string The pattern string to insert parameters into. $params array The array of name value pairs to insert into the format string. $language string The locale to use for f

i18n\MessageFormatter fallbackFormat()

fallbackFormat() protected method Fallback implementation for MessageFormatter::formatMessage protected string|boolean fallbackFormat ( $pattern, $args, $locale )$pattern string The pattern string to insert things into. $args array The array of values to insert into the format string $locale string The locale to use for formatting locale-dependent parts return string|boolean The formatted pattern string or FALSE if an error occurred

i18n\MessageFormatter $errorMessage

$errorMessage public read-only property Description of the last error. public string getErrorMessage ( )

i18n\MessageFormatter $errorCode

$errorCode public read-only property Code of the last error. public string getErrorCode ( )

i18n\I18N translate()

translate() public method Translates a message to the specified language. After translation the message will be formatted using yii\i18n\MessageFormatter if it contains ICU message format and $params are not empty. public string translate ( $category, $message, $params, $language )$category string The message category. $message string The message to be translated. $params array The parameters that will be used to replace the corresponding placeholders in the message. $language strin

i18n\I18N setMessageFormatter()

setMessageFormatter() public method public void setMessageFormatter ( $value )$value string|array|yii\i18n\MessageFormatter The message formatter to be used to format message via ICU message format. Can be given as array or string configuration that will be given to Yii::createObject() to create an instance or a yii\i18n\MessageFormatter instance.

i18n\I18N init()

init() public method Initializes the component by configuring the default message categories. public void init ( )

i18n\I18N getMessageSource()

getMessageSource() public method Returns the message source for the given category. public yii\i18n\MessageSource getMessageSource ( $category )$category string The category name. return yii\i18n\MessageSource The message source for the given category. throws yii\base\InvalidConfigException if there is no message source available for the specified category.

i18n\I18N getMessageFormatter()

getMessageFormatter() public method Returns the message formatter instance. public yii\i18n\MessageFormatter getMessageFormatter ( )return yii\i18n\MessageFormatter The message formatter to be used to format message via ICU message format.