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
5 changes: 4 additions & 1 deletion plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
from os import environ as os_environ
import gettext


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("ModifyPLiFullHD", resolveFilename(SCOPE_PLUGINS, "Extensions/ModifyPLiFullHD/locale"))


def _(txt):
t = gettext.dgettext("ModifyPLiFullHD", txt)
if t == txt:
#print "[ModifyPLiFullHD] fallback to default translation for", txt
t = gettext.gettext(txt)
return t


localeInit()
language.addCallback(localeInit)
language.addCallback(localeInit)
11 changes: 7 additions & 4 deletions plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,30 @@
from Components.config import config, ConfigSubsection, ConfigYesNo

config.plugins.ModifyPLiFullHD = ConfigSubsection()
config.plugins.ModifyPLiFullHD.enabled = ConfigYesNo(default = False)
config.plugins.ModifyPLiFullHD.enabled = ConfigYesNo(default=False)


def autostart(reason, **kwargs):
import ui
if reason == 0 and config.plugins.ModifyPLiFullHD.enabled.value and config.skin.primary_skin.value.split('/')[0] in ("PLi-FullHD","PLi-FullNightHD","PLi-HD1") and ui.reload_skin_on_start:
if reason == 0 and config.plugins.ModifyPLiFullHD.enabled.value and config.skin.primary_skin.value.split('/')[0] in ("PLi-FullHD", "PLi-FullNightHD", "PLi-HD1") and ui.reload_skin_on_start:
ui.modifyskin.applyAutorun()

def main(session,**kwargs):

def main(session, **kwargs):
import ui

def recursive(answer=False):
if answer:
session.openWithCallback(recursive, ui.ModifyPLiFullHD, answer[0], answer[1])
session.openWithCallback(recursive, ui.ModifyPLiFullHD)


def Plugins(path, **kwargs):
global plugin_path
plugin_path = path
name = _("Modify PLi-FullHD")
descr = _("Change regular font and colors in PLi FullHD/FullNightHD/HD1 skins")
return [
PluginDescriptor(name=name, description=descr, where=PluginDescriptor.WHERE_PLUGINMENU, icon = 'plugin.png', fnc=main),
PluginDescriptor(name=name, description=descr, where=PluginDescriptor.WHERE_PLUGINMENU, icon='plugin.png', fnc=main),
PluginDescriptor(name=name, description=descr, where=[PluginDescriptor.WHERE_SESSIONSTART], fnc=autostart),
]
Loading