Class luci.i18n
LuCI translation library.
Functions
| clear () | Clear the translation table. |
| load (file, lang, force) | Load a translation and copy its data into the translation table. |
| loadc (file, force) | Load a translation file using the default translation language. |
| setlanguage (lang) | Set the context default translation language. |
| translate (key, def) | Return the translated value for a specific translation key. |
| translatef (key, default, ...) | Return the translated value for a specific translation key and use it as sprintf pattern. |
Functions
- clear ()
- Clear the translation table.
- load (file, lang, force)
-
Load a translation and copy its data into the translation table.
Parameters
- file: Language file
- lang: Two-letter language code
- force: Force reload even if already loaded (optional)
Return value:
Success status - loadc (file, force)
-
Load a translation file using the default translation language. Alternatively load the translation of the fallback language.
Parameters
- file: Language file
- force: Force reload even if already loaded (optional)
- setlanguage (lang)
-
Set the context default translation language.
Parameters
- lang: Two-letter language code
- translate (key, def)
-
Return the translated value for a specific translation key.
Parameters
- key: Translation key
- def: Default translation
Return value:
Translated string - translatef (key, default, ...)
-
Return the translated value for a specific translation key and use it as sprintf pattern.
Parameters
- key: Translation key
- default: Default translation
- ...: Format parameters
Return value:
Translated and formatted string