2 from Components.config import config
3 from Components.config import ConfigSubsection
4 from Components.config import ConfigSelection
5 from Components.config import ConfigInteger
6 from Components.config import ConfigSubList
7 from Components.config import ConfigSubDict
8 from Components.config import ConfigText
9 from Components.config import configfile
10 from Components.config import ConfigYesNo
11 from Components.Language import language
12 from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
15 __version__ = "1.5beta3"
17 PluginLanguageDomain = "WebInterface"
18 PluginLanguagePath = "Extensions/WebInterface/locale"
21 lang = language.getLanguage()[:2] # getLanguage returns e.g. "fi_FI" for "language_country"
22 os.environ["LANGUAGE"] = lang # Enigma doesn't set this (or LC_ALL, LC_MESSAGES, LANG). gettext needs it!
23 print "[WebInterface] set language to ", lang
24 gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))
27 t = gettext.dgettext(PluginLanguageDomain, txt)
29 print "[WebInterface] fallback to default translation for", txt
30 t = gettext.gettext(txt)
34 language.addCallback(localeInit)