Detailed Description

I18nUtil provides support i18n functionality.

ingo herwig

Definition at line 22 of file I18nUtil.php.

Static Public Member Functions

static getMessages ($directory, $exclude, $pattern, $depth=0)
static getMessagesFromFile ($file)
static createPHPLanguageFile ($language, $messages)

Member Function Documentation

◆ getMessages()

static getMessages (   $directory,
  $depth = 0 

Get all messages from a directory recursively.

$directoryThe directory to search in
$excludeArray of directory names that are excluded from search
$patternThe pattern the names of the files to search in must match
$depthInternal use only
An assoziative array with the filenames as keys and the values as array of strings.
See also

Definition at line 37 of file I18nUtil.php.

◆ getMessagesFromFile()

static getMessagesFromFile (   $file)

Get all messages from a file.

Searches for parameters of the Message::getText method and usage of the smarty 'translate' function.

$fileThe file to search in
An array of strings.
This method searches for occurrences of '->getText('Text to translate')', 'Dict.translate("Text to translate")' or {translate:"Text to translate"} where 'Text to translate' is supposed to be the message to translate. So it might not find the usage of the getText() method with concatenated strings (like $message->getText($login." says hello")). For replacements use method signatures, that support parameters.

Definition at line 82 of file I18nUtil.php.

◆ createPHPLanguageFile()

static createPHPLanguageFile (   $language,

Create a message file for use with the Message class.

The file will be created in the directory defined in configutation key 'localeDir' in 'application' section.

$languageThe language of the file (language code e.g. 'de')
$messagesAn assoziative array with the messages as keys and assoziative array with keys 'translation' and 'files' (occurences of the message)
Boolean whether successful or not.

Definition at line 118 of file I18nUtil.php.