module documentation
Translations for Stick firmware with lazy loading + cache
Function | get |
Gets translation string from current language. |
Function | init |
Reads main languages.json file (lang registry). |
Function | load |
Switch current language. Lazy-loads if not cached. |
Function | unload |
Unloads a language from cache to free RAM. If lang=None, unloads least recently used one. |
Variable | main |
Undocumented |
Function | _load |
Loads given language into cache if not present. |
Variable | _current |
Undocumented |
Variable | _language |
Undocumented |
Variable | _last |
Undocumented |
Gets translation string from current language. Args: path (str): path to string (ex. "apps.minesweeper.name") Returns: str: String or "Translate error" if could not translate Example: >>> import modules.translate as translate >>> translate.load("pl") >>> print(translate.get("apps.minesweeper.name")) "Saper"