[AutomaticSystemCleanup]V0.1.9:
[enigma2-plugins.git] / automaticcleanup / src / __init__.py
1 # -*- coding: utf-8 -*-
2
3 from Components.Language import language
4 from Tools.Directories import resolveFilename, SCOPE_PLUGINS
5 import gettext
6  
7 PluginLanguageDomain = "AutomaticCleanup"
8 PluginLanguagePath = "SystemPlugins/AutomaticCleanup/locale"
9  
10 def localeInit():
11         gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))
12
13 def _(txt):
14         t = gettext.dgettext(PluginLanguageDomain, txt)
15         if t == txt:
16                 #print "[%s] fallback to default translation for %s" %(PluginLanguageDomain, txt)
17                 t = gettext.gettext(txt)
18         return t
19
20 localeInit()
21 language.addCallback(localeInit)