| 1 | = Internationalization Global Functions = |
| 2 | |
| 3 | == loadLanguage == |
| 4 | * '''Overview:''' |
| 5 | * Replace the current language (locale) with a new one. |
| 6 | * '''Syntax:''' |
| 7 | * loadLanguage("English") |
| 8 | * '''Parameters:''' |
| 9 | * language id [string] as in I18n::!LoadLanguage |
| 10 | * '''Returns:''' |
| 11 | * |
| 12 | * '''Notes:''' |
| 13 | * |
| 14 | |
| 15 | == getLanguageID == |
| 16 | * '''Overview:''' |
| 17 | * Return identifier of the current language (locale) in use. |
| 18 | * '''Syntax:''' |
| 19 | * id = getLanguageID() |
| 20 | * '''Parameters:''' |
| 21 | * |
| 22 | * '''Returns:''' |
| 23 | * language id [string] as in I18n::!LoadLanguage |
| 24 | * '''Notes:''' |
| 25 | * |
| 26 | |
| 27 | == translate == |
| 28 | * '''Overview:''' |
| 29 | * Translate a phrase, possibly containing variables, into the current language. |
| 30 | * '''Syntax:''' |
| 31 | * str = translate("Hello, world") |
| 32 | * str = translate("Hello, would you like $n $noun?", 15, i18n.Noun("turnip")) |
| 33 | * '''Parameters:''' |
| 34 | * phrase id [string] |
| 35 | * any number of extra parameters, matching the `$variables` in the phrase |
| 36 | * '''Notes:''' |
| 37 | * 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...) |