Version 1 (modified by trac, 16 years ago) ( diff )

--

Internationalization Global Functions

loadLanguage

  • Overview:
    • Replace the current language (locale) with a new one.
  • Syntax:
    • loadLanguage("English")
  • Parameters:
    • language id [string] as in I18n::LoadLanguage
  • Returns:
  • Notes:

getLanguageID

  • Overview:
    • Return identifier of the current language (locale) in use.
  • Syntax:
    • id = getLanguageID()
  • Parameters:
  • Returns:
    • language id [string] as in I18n::LoadLanguage
  • Notes:

translate

  • Overview:
    • Translate a phrase, possibly containing variables, into the current language.
  • Syntax:
    • str = translate("Hello, world")
    • str = translate("Hello, would you like $n $noun?", 15, i18n.Noun("turnip"))
  • Parameters:
    • phrase id [string]
    • any number of extra parameters, matching the $variables in the phrase
  • Notes:
    • String parameters should be annotated via one of the i18n.Noun(str), i18n.Name(str) and i18n.Raw(str) functions before being passed to translate. (Unfortunately, I cannot remember precisely why...)
Note: See TracWiki for help on using the wiki.