Gets the translation of a text.
public static function UnbLocale::Translate ($key);
Stripped from the text key and the resulting key is returned as translated text. This can be used to have certain abbreviations or terms translated optionally, but use the original term as default. An example is time zone abbreviations, of which every locale is likely to translate only a few.
(string) Text translation key
(string) The translated text with all specified variables replaced, or null
if no translation is specified in the dictionary (unless "safe mode" is enabled, see above).
This function has some hidden parameters. The first parameter is always the text key.
Then follows the data to be inserted in the variable slots in the translated text. Specify each variable by two parameters: first the variable name, then the value.
If the number of parameters after the text key is odd (i.e. there's no exact variable/value match), then the first parameter is taken for a numeric selector of the translated text. It can be used to get different translations for one or multiple entities. If such a number is given, the special variable {#} is resolved to it.
If there is only one additional parameter and it is true
, then the text is translated
Member of class: UnbLocale
Implementation file: locale.class.php, line 336
© 2011 Yves Goergen. UNB Components Homepage. Reference generated on 2011-02-22.