c7f59bef5fcc8525d686ce11bdeb6156b4ea9e35
[vuplus_dvbapp] / lib / python / Plugins / Extensions / HbbTV / __init__.py
1 from Components.Language import language
2 from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
3 import os,gettext
4
5 lang = 'en'
6 def localeInit():
7         global lang
8         lang = language.getLanguage()[:2]
9         os.environ["LANGUAGE"] = lang
10         gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE))
11         gettext.textdomain("enigma2")
12         gettext.bindtextdomain(lang, '/usr/lib/enigma2/python/Plugins/Extensions/HbbTV/locale')
13
14 def _(txt):
15         global lang
16         t = gettext.dgettext(lang, txt)
17         if t == txt:
18                 t = gettext.gettext(txt)
19         return t
20
21 localeInit()
22 language.addCallback(localeInit)