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