flare.i18n
Internationalization tools to easily implement multi-language applications.
Module Contents
Functions
|
|
|
Tries to translate the given string in the currently selected language. |
|
Adds or updates new translations. |
|
Sets the current language to lang. |
Returns the current language. |
Attributes
- flare.i18n._currentLanguage
- flare.i18n._currentLanguage
- flare.i18n._currentLanguage = 'en'
- flare.i18n._currentLanguage
- flare.i18n._runtimeTranslations
- flare.i18n._lngMap
- flare.i18n.buildTranslations(pathToFolder)
- flare.i18n.translate(key, fallback=None, **kwargs)
Tries to translate the given string in the currently selected language.
Supports replacing markers (using {markerName} syntax).
- Parameters:
key – The string to translate
fallback – Return string when no translation is found.
- Returns:
The translated string
- flare.i18n.addTranslation(lang, a, b=None)
Adds or updates new translations.
- flare.i18n.setLanguage(lang)
Sets the current language to lang.
- flare.i18n.getLanguage()
Returns the current language.