Files
neoboot/NeoBoot/__init__.py
ahmedmoselhi 7d9c6406e4 More adaptation for Novaler4k Pro
** apply aggressive autopep8 on all files
** add condition for novaler4kpro in extract.py
** add receiver icon for novaler4kpro
** fix mounting internal storage for novaler4k pro
** other minor fixes
2025-11-16 02:15:14 -05:00

31 lines
764 B
Python

from Components.Language import language
from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
import os
import gettext
PluginLanguageDomain = "NeoBoot"
PluginLanguagePath = "Extensions/NeoBoot/locale"
def localeInit():
lang = language.getLanguage()[:2]
os.environ["LANGUAGE"] = lang
print("[NeoBoot] set language to "), lang
gettext.bindtextdomain(
PluginLanguageDomain,
resolveFilename(
SCOPE_PLUGINS,
PluginLanguagePath))
def _(txt):
t = gettext.dgettext(PluginLanguageDomain, txt)
if t == txt:
print("[NeoBoot] fallback to default translation for"), txt
t = gettext.dgettext("enigma2", txt)
return t
localeInit()
language.addCallback(localeInit)