change description in control-file
authorDr.Best <dr_best@users.schwerkraft.elitedvb.net>
Sun, 14 Jun 2009 12:44:30 +0000 (12:44 +0000)
committerDr.Best <dr_best@users.schwerkraft.elitedvb.net>
Sun, 14 Jun 2009 12:44:30 +0000 (12:44 +0000)
add timerlist for quickbutton-selection
add support for custom localizations and german translation

configure.ac
quickbutton/CONTROL/control
quickbutton/Makefile.am
quickbutton/po/Makefile.am [new file with mode: 0644]
quickbutton/po/Quickbutton.pot [new file with mode: 0644]
quickbutton/po/de.po [new file with mode: 0644]
quickbutton/src/__init__.py
quickbutton/src/plugin.py

index 416f303..9168450 100644 (file)
@@ -204,6 +204,7 @@ partnerbox/src/servicewebts/Makefile
 partnerbox/src/icons/Makefile
 
 quickbutton/Makefile
+quickbutton/po/Makefile
 quickbutton/src/Makefile
 
 setpasswd/Makefile
index 113b18f..02d01a9 100644 (file)
@@ -1,6 +1,6 @@
 Package: enigma2-plugin-extensions-quickbutton
 Version: 1.0
-Description: Quickbutton - assign long key-press (red/green/yellow/blue) to plugins or E2 functions
+Description: Quickbutton: assign long key-press (red/green/yellow/blue) to plugins or E2 functions
 Architecture: mipsel
 Section: extra
 Priority: optional
index af437a6..dd6709f 100755 (executable)
@@ -1 +1 @@
-SUBDIRS = src
+SUBDIRS = src po
diff --git a/quickbutton/po/Makefile.am b/quickbutton/po/Makefile.am
new file mode 100644 (file)
index 0000000..7d72ba4
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# to use this for the localisation of other plugins,
+# just change the DOMAIN to the name of the Plugin.
+# It is assumed, that the domain ist the same as
+# the directory name of the plugin.
+#
+
+DOMAIN=Quickbutton
+installdir = /usr/lib/enigma2/python/Plugins/Extensions/$(DOMAIN)
+#GETTEXT=./pygettext.py
+GETTEXT=xgettext
+
+#MSGFMT = ./msgfmt.py
+MSGFMT = msgfmt
+
+LANGS := de
+LANGPO := $(foreach LANG, $(LANGS),$(LANG).po)
+LANGMO := $(foreach LANG, $(LANGS),$(LANG).mo)
+
+default: $(DOMAIN).pot $(LANGPO) merge $(LANGMO)
+       for lang in $(LANGS); do \
+               mkdir -p $$lang/LC_MESSAGES; \
+               cp $$lang.mo $$lang/LC_MESSAGES/$(DOMAIN).mo; \
+       done
+
+merge:
+       for lang in $(LANGS); do \
+               msgmerge --no-location -s -N -U $$lang.po $(DOMAIN).pot; \
+       done
+
+
+# the TRANSLATORS: allows putting translation comments before the to-be-translated line.
+$(DOMAIN).pot:
+       $(GETTEXT) -L python --add-comments="TRANSLATORS:" -d $(DOMAIN) -s -o $(DOMAIN).pot ../src/*.py
+       msguniq -o $(DOMAIN)uniq.pot $(DOMAIN).pot
+       $(RM) $(DOMAIN).pot
+       mv $(DOMAIN)uniq.pot $(DOMAIN).pot
+
+.PHONY: $(DOMAIN).pot
+
+
+%.mo: %.po
+       $(MSGFMT) -o $@ $<
+
+%.po:
+       msginit -l $@ -o $@ -i $(DOMAIN).pot --no-translator
+
+CLEANFILES = $(foreach LANG, $(LANGS),$(LANG).mo)
+
+clean-local:
+       $(RM) -r $(LANGS)
+
+install-data-am: default
+       for lang in $(LANGS); do \
+               mkdir -p $(DESTDIR)$(installdir)/locale/$$lang/LC_MESSAGES; \
+               cp $$lang.mo $(DESTDIR)$(installdir)/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo; \
+       done
diff --git a/quickbutton/po/Quickbutton.pot b/quickbutton/po/Quickbutton.pot
new file mode 100644 (file)
index 0000000..bccfb9c
--- /dev/null
@@ -0,0 +1,130 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-06-14 14:29+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/plugin.py:84
+msgid "Assign plugin to long blue key pressed"
+msgstr ""
+
+#: ../src/plugin.py:81
+msgid "Assign plugin to long green key pressed"
+msgstr ""
+
+#: ../src/plugin.py:83
+msgid "Assign plugin to long red key pressed"
+msgstr ""
+
+#: ../src/plugin.py:82
+msgid "Assign plugin to long yellow key pressed"
+msgstr ""
+
+#: ../src/plugin.py:86
+msgid "Assign plugin to red key pressed"
+msgstr ""
+
+#: ../src/plugin.py:180
+msgid "Cancel"
+msgstr ""
+
+#: ../src/plugin.py:143
+msgid "Display 4:3 content as"
+msgstr ""
+
+#: ../src/plugin.py:121 ../src/plugin.py:190 ../src/plugin.py:234
+msgid "EPG List"
+msgstr ""
+
+#: ../src/plugin.py:131 ../src/plugin.py:159
+#, python-format
+msgid ""
+"Error!\n"
+"Error Text: %s"
+msgstr ""
+
+#: ../src/plugin.py:139
+msgid "Just Scale"
+msgstr ""
+
+#: ../src/plugin.py:125 ../src/plugin.py:191 ../src/plugin.py:236
+msgid "MediaPlayer"
+msgstr ""
+
+#: ../src/plugin.py:163
+msgid "No plugin assigned!"
+msgstr ""
+
+#: ../src/plugin.py:36 ../src/plugin.py:37 ../src/plugin.py:38
+#: ../src/plugin.py:39 ../src/plugin.py:40 ../src/plugin.py:120
+#: ../src/plugin.py:189
+msgid "Nothing"
+msgstr ""
+
+#: ../src/plugin.py:181
+msgid "OK"
+msgstr ""
+
+#: ../src/plugin.py:138
+msgid "Pan&Scan"
+msgstr ""
+
+#: ../src/plugin.py:137
+msgid "Pillarbox"
+msgstr ""
+
+#: ../src/plugin.py:132 ../src/plugin.py:192 ../src/plugin.py:238
+msgid "Plugin browser"
+msgstr ""
+
+#: ../src/plugin.py:161
+msgid "Plugin not found!"
+msgstr ""
+
+#: ../src/plugin.py:145 ../src/plugin.py:194 ../src/plugin.py:242
+msgid "Timer"
+msgstr ""
+
+#: ../src/plugin.py:118
+msgid "Unknown Error"
+msgstr ""
+
+#: ../src/plugin.py:219
+msgid "assigned to long blue"
+msgstr ""
+
+#: ../src/plugin.py:217
+msgid "assigned to long green"
+msgstr ""
+
+#: ../src/plugin.py:216
+msgid "assigned to long red"
+msgstr ""
+
+#: ../src/plugin.py:218
+msgid "assigned to long yellow"
+msgstr ""
+
+#: ../src/plugin.py:224
+msgid "assigned to red"
+msgstr ""
+
+#: ../src/plugin.py:74
+msgid "setup for Quickbutton"
+msgstr ""
+
+#: ../src/plugin.py:136 ../src/plugin.py:193 ../src/plugin.py:240
+msgid "switch 4:3 content display"
+msgstr ""
diff --git a/quickbutton/po/de.po b/quickbutton/po/de.po
new file mode 100644 (file)
index 0000000..b7a9411
--- /dev/null
@@ -0,0 +1,99 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Quickbutton\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-06-14 14:29+0200\n"
+"PO-Revision-Date: \n"
+"Last-Translator: Dr.Best <dr.best@dreambox-tools.info>\n"
+"Language-Team: Dr.Best <dr.best@dreambox-tools.info>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: German\n"
+"X-Poedit-Country: GERMANY\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+
+msgid "Assign plugin to long blue key pressed"
+msgstr "Langer Tastendruck auf Blau"
+
+msgid "Assign plugin to long green key pressed"
+msgstr "Langer Tastendruck auf Grün"
+
+msgid "Assign plugin to long red key pressed"
+msgstr "Langer Tastendruck auf Rot"
+
+msgid "Assign plugin to long yellow key pressed"
+msgstr "Langer Tastendruck auf Gelb"
+
+msgid "Assign plugin to red key pressed"
+msgstr "Tastendruck auf Rot"
+
+msgid "Cancel"
+msgstr "Abbrechen"
+
+msgid "Display 4:3 content as"
+msgstr "4:3 Bild Darstellung als"
+
+msgid "EPG List"
+msgstr "EPG Liste"
+
+#, python-format
+msgid ""
+"Error!\n"
+"Error Text: %s"
+msgstr ""
+
+msgid "Just Scale"
+msgstr ""
+
+msgid "MediaPlayer"
+msgstr "Medienwiedergabe"
+
+msgid "No plugin assigned!"
+msgstr "Keine Funktion zugeordnet"
+
+msgid "Nothing"
+msgstr "Keine Zuordnung"
+
+msgid "OK"
+msgstr ""
+
+msgid "Pan&Scan"
+msgstr ""
+
+msgid "Pillarbox"
+msgstr ""
+
+msgid "Plugin browser"
+msgstr "Plugin Browser"
+
+msgid "Plugin not found!"
+msgstr "Plugin wurde nicht gefunden!"
+
+msgid "Timer"
+msgstr "Timerliste"
+
+msgid "Unknown Error"
+msgstr "Unbekannter Fehler"
+
+msgid "assigned to long blue"
+msgstr "Langer Tastendruck auf Blau"
+
+msgid "assigned to long green"
+msgstr "Langer Tastendruck auf Grün"
+
+msgid "assigned to long red"
+msgstr "Langer Tastendruck auf Rot"
+
+msgid "assigned to long yellow"
+msgstr "Langer Tastendruck auf Gelb"
+
+msgid "assigned to red"
+msgstr "Tastendruck auf Rot"
+
+msgid "setup for Quickbutton"
+msgstr "Quickbutton Setup"
+
+msgid "switch 4:3 content display"
+msgstr "4:3 Bildumschaltung"
+
index e69de29..ad8ffcc 100644 (file)
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+from Components.Language import language
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
+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("Quickbutton", resolveFilename(SCOPE_PLUGINS, "Extensions/Quickbutton/locale"))
+
+def _(txt):
+       t = gettext.dgettext("Quickbutton", txt)
+       if t == txt:
+               print "[Quickbutton] fallback to default translation for", txt
+               t = gettext.gettext(txt)
+       return t
+
+localeInit()
+language.addCallback(localeInit)
+
index 109acac..e52db55 100644 (file)
@@ -29,6 +29,8 @@ from Components.config import config
 from Components.Button import Button
 from Screens.MessageBox import MessageBox
 from Tools.HardwareInfo import HardwareInfo
+# for localized messages
+from . import _
 
 config.plugins.Quickbutton = ConfigSubsection()
 config.plugins.Quickbutton.red = ConfigText(default = _("Nothing"), visible_width = 50, fixed_size = False)
@@ -140,6 +142,10 @@ def startPlugin(self,pname):
                        config.av.policy_43.save()
                        self.session.open(MessageBox,_("Display 4:3 content as") + " " + ar[config.av.policy_43.value], MessageBox.TYPE_INFO, timeout = 3)
                        no_plugin = False
+               elif pname == _("Timer"):
+                       from Screens.TimerEdit import TimerEditList
+                       self.session.open(TimerEditList)
+                       no_plugin = False
                else:
                        plugin = None
                        for p in plugins.getPlugins(where = [PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU]):
@@ -185,8 +191,9 @@ class QuickbuttonSetup(ConfigListScreen, Screen):
                self.entryguilist.append(("2",_("MediaPlayer")))
                self.entryguilist.append(("3",_("Plugin browser")))
                self.entryguilist.append(("4",_("switch 4:3 content display")))
+               self.entryguilist.append(("5",_("Timer")))
                # Vorgaben aus EXTENSIONSMENU, PLUGINMENU
-               index = 5
+               index = 6
                for p in plugins.getPlugins(where = [PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU]):
                        self.entryguilist.append((str(index),str(p.name)))
                        if config.plugins.Quickbutton.red.value == str(p.name):
@@ -232,6 +239,8 @@ class QuickbuttonSetup(ConfigListScreen, Screen):
                        return "3"
                elif value == _("switch 4:3 content display"):
                        return "4"
+               if value == _("Timer"):
+                       return "5"
                else:
                        return "0"