def localeInit():
lang = language.getLanguage()[:2] # getLanguage returns e.g. "fi_FI" for "language_country"
os.environ["LANGUAGE"] = lang # Enigma doesn't set this (or LC_ALL, LC_MESSAGES, LANG). gettext needs it!
- #gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE))
- #gettext.textdomain("enigma2")
+ gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE))
+ gettext.textdomain("enigma2")
gettext.bindtextdomain("VlcPlayer", resolveFilename(SCOPE_PLUGINS, "Extensions/VlcPlayer/locale"))
+def _(txt):
+ t = gettext.dgettext("VlcPlayer", txt)
+ if t == txt:
+ print "[VLC] fallback to default translation for", txt
+ t = gettext.gettext(txt)
+ return t
+
localeInit()
from Tools.BoundFunction import boundFunction
from VlcServerList import VlcServerListScreen
-from VlcServerConfig import vlcPluginInfo
+import gettext
+def _(txt):
+ t = gettext.dgettext("VlcPlayer", txt)
+ if t == txt:
+ print "[VLC] fallback to default translation for", txt
+ t = gettext.gettext(txt)
+ return t
def main(session, **kwargs):
session.open(VlcServerListScreen)
-
def Plugins(**kwargs):
- vlcPluginInfo.pluginPath = kwargs["path"]
return PluginDescriptor(
name="VLC Video Player",
description="VLC Video Player",
where = [ PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU ],
- icon = "plugin.png", fnc = boundFunction(main, path = kwargs["path"]))
+ icon = "plugin.png", fnc = boundFunction(main))