| @@ -0,0 +1,24 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from Components.Language import language | ||
| from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE | ||
| import os,gettext | ||
|
|
||
| PluginLanguageDomain = "Foreca" | ||
| PluginLanguagePath = "Extensions/Foreca/locale" | ||
|
|
||
| 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! | ||
| #print "[WebInterface] set language to ", lang | ||
| gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath)) | ||
|
|
||
| def _(txt): | ||
| t = gettext.dgettext(PluginLanguageDomain, txt) | ||
| if t == txt: | ||
| #print "[%s] fallback to default translation for %s" %(PluginLanguageDomain, txt) | ||
| t = gettext.gettext(txt) | ||
| return t | ||
|
|
||
| localeInit() | ||
| language.addCallback(localeInit) |
| @@ -1,10 +1,11 @@ | ||
| Package: enigma2-plugin-extensions-foreca | ||
| Version: 2.7 | ||
| Description: Foreca Weather Forecast | ||
| Section: extra | ||
| Priority: optional | ||
| Maintainer: Bauernbub | ||
| Architecture: mipsel | ||
| OE: enigma2-plugin-extensions-Foreca | ||
| Depends: enigma2 (>= 2.6git20090615), python-html | ||
| Homepage: http://www.aaf-digital.info | ||
| Source: https://github.com/E2OpenPlugins/e2openplugin-Foreca/tree/2cb24b72c510deb1847107691e11779b91722649 |
| @@ -1,4 +1,4 @@ | ||
| #!/bin/sh | ||
| rm -rf /usr/lib/enigma2/python/Plugins/Extensions/Foreca | ||
| echo "Plugin removed! You should restart enigma2 now!" | ||
| exit 0 |