i18n\GettextMoFile save()

save() public method Saves messages to an MO file. public void save ( $filePath, $messages )$filePath string File path $messages array Message translations. Array keys are source messages and array values are translated messages: source message => translated message. Note if the message has a context, the message ID must be prefixed with the context with chr(4) as the separator. throws yii\base\Exception if unable to save the MO file

i18n\GettextMoFile readString()

readString() protected method Reads a string. protected string readString ( $fileHandle, $length, $offset = null )$fileHandle resource File handle $length integer Of the string $offset integer Of the string in the file. If null, it reads from the current position. return string The result

i18n\GettextMoFile readInteger()

readInteger() protected method Reads a 4-byte integer. protected integer readInteger ( $fileHandle )$fileHandle resource To read from return integer The result

i18n\GettextMoFile readBytes()

readBytes() protected method Reads one or several bytes. protected string readBytes ( $fileHandle, $byteCount = 1 )$fileHandle resource To read from $byteCount integer To be read return string Bytes

i18n\GettextMoFile load()

load() public method Loads messages from an MO file. public array load ( $filePath, $context )$filePath string File path $context string Message context return array Message translations. Array keys are source messages and array values are translated messages: source message => translated message. throws yii\base\Exception if unable to read the MO file

i18n\GettextMoFile $useBigEndian

$useBigEndian public property Whether to use big-endian when reading and writing an integer. public boolean $useBigEndian = false

i18n\GettextMessageSource loadMessagesFromFile()

loadMessagesFromFile() protected method Loads the message translation for the specified language and category or returns null if file doesn't exist. protected array|null loadMessagesFromFile ( $messageFile, $category )$messageFile string Path to message file $category string The message category return array|null Array of messages or null if file not found

i18n\GettextMessageSource 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. When both are present, the en-US messages will be merged over en. See loadFallbackMessages() for details. If the $language is less specific than $sourceLanguage, the method will try to load the messages for $sourceLanguage. For example: $sourceLanguage is en-GB, $language is en. The method will lo

i18n\GettextMessageSource loadFallbackMessages()

loadFallbackMessages() protected method (available since version 2.0.7) The method is normally called by loadMessages() to load the fallback messages for the language. Method tries to load the $category messages for the $fallbackLanguage and adds them to the $messages array. protected array loadFallbackMessages ( $category, $fallbackLanguage, $messages, $originalMessageFile )$category string The message category $fallbackLanguage string The target fallback language $messages array Th

i18n\GettextMessageSource getMessageFilePath()

getMessageFilePath() protected method Returns message file path for the specified language and category. protected string getMessageFilePath ( $language )$language string The target language return string Path to message file