Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion python/Plugins/Extensions/WeatherMSN/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@

from Components.Language import language
from Tools.Directories import resolveFilename, SCOPE_PLUGINS
import gettext

LOCALES_DOMAIN = "WeatherMSN"
LOCALES_RELPATH = "Extensions/WeatherMSN/locale"


def _locale_init():
gettext.bindtextdomain(
LOCALES_DOMAIN,
resolveFilename(SCOPE_PLUGINS, LOCALES_RELPATH))


def _(txt):
try:
t = gettext.dgettext(LOCALES_DOMAIN, txt)
if t == txt:
t = gettext.gettext(txt)
return t
except Exception:
return txt


_locale_init()
language.addCallback(_locale_init)
Loading