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_file Undocumented
Function _load_lang Loads given language into cache if not present.
Variable _current_lang Undocumented
Variable _language_cache Undocumented
Variable _last_access Undocumented
def get(path):

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"

def init():

Reads main languages.json file (lang registry).

def load(lang):

Switch current language. Lazy-loads if not cached.

def unload(lang=None):

Unloads a language from cache to free RAM. If lang=None, unloads least recently used one.

main_file =

Undocumented

def _load_lang(lang):

Loads given language into cache if not present.

_current_lang =

Undocumented

_language_cache: dict =

Undocumented

_last_access: dict =

Undocumented