simple_localization package¶
simple_localization.localization module¶
- class simple_localization.localization.LocalizationManager(folder_path: str, language: str)¶
Bases:
objectClass managing localization.
Access to the localization data is done through the [] operator (e.g. localization[“key”]).
- folder_path¶
Path to the folder containing the localization files.
- Type
str
- available_languages¶
List of available languages. Loaded when calling load().
- Type
list[str]
- language¶
Current language.
- Type
str
- change_language(language: str) None¶
Update the data for specified language.
- Parameters
language (str) – Language to load. Should be the name of the file without the extension. (e.g. “en_EN” for the file “en_EN.json”)
- refresh() None¶
Load localization files from specified folder.
This is useful if the localization files have been updated on runtime.
Called when updating the language.