Made RSDownloader translateable and added german translation
authorNabil Hanna <ali@users.schwerkraft.elitedvb.net>
Wed, 26 Nov 2008 17:39:24 +0000 (17:39 +0000)
committerNabil Hanna <ali@users.schwerkraft.elitedvb.net>
Wed, 26 Nov 2008 17:39:24 +0000 (17:39 +0000)
12 files changed:
rsdownloader/Makefile.am
rsdownloader/po/Makefile.am [new file with mode: 0644]
rsdownloader/po/RSDownloader.pot [new file with mode: 0644]
rsdownloader/po/de.po [new file with mode: 0644]
rsdownloader/src/RSConfig.py
rsdownloader/src/RSDownloadBrowser.py
rsdownloader/src/RSListBrowser.py
rsdownloader/src/RSMain.py
rsdownloader/src/RSProgress.py
rsdownloader/src/RSSearch.py
rsdownloader/src/RSTranslation.py [new file with mode: 0644]
rsdownloader/src/plugin.py

index 308a09c..8078aa5 100644 (file)
@@ -1 +1 @@
-SUBDIRS = src\r
+SUBDIRS = src po\r
diff --git a/rsdownloader/po/Makefile.am b/rsdownloader/po/Makefile.am
new file mode 100644 (file)
index 0000000..a28850e
--- /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=RSDownloader
+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/rsdownloader/po/RSDownloader.pot b/rsdownloader/po/RSDownloader.pot
new file mode 100644 (file)
index 0000000..b56f792
--- /dev/null
@@ -0,0 +1,209 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: RSDownloader\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-11-26 17:31-0000\n"
+"PO-Revision-Date: 2008-11-26 17:32-0000\n"
+"Last-Translator: AliAbdul <aliabdul1978@hotmail.de>\n"
+"Language-Team: Nabil Hanna <nabil1978@web.de>\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"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-SearchPath-0: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src\n"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:40
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:56
+msgid "Start downloading..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:41
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:66
+msgid "Show lists..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:42
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:73
+msgid "Show downloads..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:43
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:80
+msgid "Show progress..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:44
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:83
+msgid "Edit configs..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:45
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:86
+msgid "Show status..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:46
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:92
+msgid "Show log..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:47
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:95
+msgid "Delete log..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:48
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:98
+msgid "Use search-engine..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:49
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:105
+msgid "Show info..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:60
+msgid "Started downloading..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:62
+msgid "Could not start downloading!"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:64
+msgid "Already downloading!"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:71
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:78
+#, python-format
+msgid "Couldn't find the directory %s!"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:88
+#, python-format
+msgid "Downloading %s."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:90
+msgid "Stopped!"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:99
+msgid "Search http://rapidshare-search-engine.com for:"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:106
+msgid ""
+"RS Downloader\n"
+"by AliAbdul\n"
+"\n"
+"This plugin allows you to download files from rapidshare in the background."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSProgress.py:30
+msgid "Downloading"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSProgress.py:31
+msgid "Files"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSProgress.py:32
+msgid "Downloaded"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSProgress.py:33
+msgid "Failed"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:40
+msgid "Save"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:43
+msgid "Username:"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:44
+msgid "Password:"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:45
+msgid "Lists directory:"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:46
+msgid "Downloads directory:"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:47
+msgid "Don't download before:"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:48
+msgid "Don't download after:"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:49
+msgid "Write log:"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:50
+msgid "Reconnect fritz.Box before downloading:"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSTranslation.py:33
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/plugin.py:25
+msgid "RS Downloader"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/plugin.py:25
+msgid "Download files from rapidshare in the background"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:61
+#, python-format
+msgid "Added %s to the download-list."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:63
+#, python-format
+msgid "Error while adding %s to the download-list!"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:73
+msgid ""
+"Error while searching http://rapidshare-search-engine.com!\n"
+"\n"
+"Error: Nothing found, sorry."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:74
+msgid "Nothing found, sorry."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:90
+#, python-format
+msgid "Page %d / %d. Push < > to switch the page..."
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:117
+#, python-format
+msgid ""
+"Error while searching http://rapidshare-search-engine.com!\n"
+"\n"
+"Error: %s"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:122
+msgid "Loading previous page... please wait!"
+msgstr ""
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:128
+msgid "Loading next page... please wait!"
+msgstr ""
+
diff --git a/rsdownloader/po/de.po b/rsdownloader/po/de.po
new file mode 100644 (file)
index 0000000..cc619ed
--- /dev/null
@@ -0,0 +1,219 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: RSDownloader\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-11-26 17:31-0000\n"
+"PO-Revision-Date: 2008-11-26 17:33-0000\n"
+"Last-Translator: AliAbdul <aliabdul1978@hotmail.de>\n"
+"Language-Team: Nabil Hanna <nabil1978@web.de>\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"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-SearchPath-0: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src\n"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:40
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:56
+msgid "Start downloading..."
+msgstr "Herunterladen..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:41
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:66
+msgid "Show lists..."
+msgstr "Zeige die Listen..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:42
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:73
+msgid "Show downloads..."
+msgstr "Zeige die Downloads..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:43
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:80
+msgid "Show progress..."
+msgstr "Zeige den Fortschritt..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:44
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:83
+msgid "Edit configs..."
+msgstr "Einstellungen editieren..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:45
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:86
+msgid "Show status..."
+msgstr "Zeige den Status..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:46
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:92
+msgid "Show log..."
+msgstr "Lese Log..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:47
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:95
+msgid "Delete log..."
+msgstr "Lösche Log..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:48
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:98
+msgid "Use search-engine..."
+msgstr "Benutze Suchmaschine..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:49
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:105
+msgid "Show info..."
+msgstr "Zeige Info..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:60
+msgid "Started downloading..."
+msgstr "Download gestartet..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:62
+msgid "Could not start downloading!"
+msgstr "Konnte das Herunterladen nicht starten!"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:64
+msgid "Already downloading!"
+msgstr "Bereits am Herunterladen!"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:71
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:78
+#, python-format
+msgid "Couldn't find the directory %s!"
+msgstr "Konnte den Pfad %s nicht finden!"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:88
+#, python-format
+msgid "Downloading %s."
+msgstr "Lade %s herunter."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:90
+msgid "Stopped!"
+msgstr "Gestoppt!"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:99
+msgid "Search http://rapidshare-search-engine.com for:"
+msgstr "Durchsuche http://rapidshare-search-engine.com nach:"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSMain.py:106
+msgid ""
+"RS Downloader\n"
+"by AliAbdul\n"
+"\n"
+"This plugin allows you to download files from rapidshare in the background."
+msgstr ""
+"RS Downloader\n"
+"von AliAbdul\n"
+"\n"
+"Dieses Plugin erlaubt dir, Dateien von rapidshare im Hintergrund herunterzuladen."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSProgress.py:30
+msgid "Downloading"
+msgstr "Herunterladen"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSProgress.py:31
+msgid "Files"
+msgstr "Dateien"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSProgress.py:32
+msgid "Downloaded"
+msgstr "Heruntergeladen"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSProgress.py:33
+msgid "Failed"
+msgstr "Fehlgeschlagen"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:40
+msgid "Save"
+msgstr "Speichern"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:43
+msgid "Username:"
+msgstr "Benutzername:"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:44
+msgid "Password:"
+msgstr "Passwort:"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:45
+msgid "Lists directory:"
+msgstr "Pfad der Listen:"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:46
+msgid "Downloads directory:"
+msgstr "Pfad der Downloads:"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:47
+msgid "Don't download before:"
+msgstr "Herunterladen nicht vor:"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:48
+msgid "Don't download after:"
+msgstr "Herunterladen nicht nach:"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:49
+msgid "Write log:"
+msgstr "Schreibe Log:"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSConfig.py:50
+msgid "Reconnect fritz.Box before downloading:"
+msgstr "fritz.Box vor Download neu verbinden:"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSTranslation.py:33
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/plugin.py:25
+msgid "RS Downloader"
+msgstr "RS Downloader"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/plugin.py:25
+msgid "Download files from rapidshare in the background"
+msgstr "Lade Dateien von rapidshare im Hintergrund herunter"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:61
+#, python-format
+msgid "Added %s to the download-list."
+msgstr "%s zur Downloadliste hinzugefügt."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:63
+#, python-format
+msgid "Error while adding %s to the download-list!"
+msgstr "Fehler während dem Hinzufügen von %s zur Downloadliste!"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:73
+msgid ""
+"Error while searching http://rapidshare-search-engine.com!\n"
+"\n"
+"Error: Nothing found, sorry."
+msgstr ""
+"Fehler während dem Suchen auf http://rapidshare-search-engine.com!\n"
+"\n"
+"Fehler: Nichts gefunden, sorry."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:74
+msgid "Nothing found, sorry."
+msgstr "Nichts gefunden, sorry."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:90
+#, python-format
+msgid "Page %d / %d. Push < > to switch the page..."
+msgstr "Seite %d / %d. Drücke <> um die Seite zu blättern..."
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:117
+#, python-format
+msgid ""
+"Error while searching http://rapidshare-search-engine.com!\n"
+"\n"
+"Error: %s"
+msgstr ""
+"Fehler während dem Suchen auf http://rapidshare-search-engine.com!\n"
+"\n"
+"Fehler: %s"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:122
+msgid "Loading previous page... please wait!"
+msgstr "Lade vorherige Seite... bitte warten!"
+
+#: /home/aliabdul/dream/enigma2-plugins/rsdownloader/src/RSSearch.py:128
+msgid "Loading next page... please wait!"
+msgstr "Lade nächste Seite... bitte warten!"
+
index c427c00..734c6cf 100644 (file)
@@ -5,8 +5,8 @@
 from Components.ActionMap import ActionMap\r
 from Components.config import config, ConfigText, ConfigYesNo, ConfigClock, ConfigSubsection, getConfigListEntry\r
 from Components.ConfigList import ConfigListScreen\r
-from Components.Label import Label\r
-from Screens.Screen import Screen\r
+from Components.Label import Label
+from RSTranslation import _, TitleScreen\r
 from time import time\r
 \r
 ##############################################################################\r
@@ -23,7 +23,7 @@ config.plugins.RSDownloader.reconnect_fritz = ConfigYesNo(default = False)
 \r
 ##############################################################################\r
 \r
-class RSConfig(ConfigListScreen, Screen):\r
+class RSConfig(ConfigListScreen, TitleScreen):\r
        skin = """\r
                <screen position="80,170" size="560,270" title="RS Downloader">\r
                        <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" transparent="1" alphatest="on" />\r
@@ -35,7 +35,7 @@ class RSConfig(ConfigListScreen, Screen):
                </screen>"""\r
 \r
        def __init__(self, session):\r
-               Screen.__init__(self, session)\r
+               TitleScreen.__init__(self, session)\r
                \r
                self["key_green"] = Label(_("Save"))\r
                \r
index fdc2448..6d8d088 100644 (file)
@@ -4,18 +4,18 @@
 ##\r
 from Components.ActionMap import ActionMap\r
 from Components.FileList import FileList\r
-from Screens.Screen import Screen\r
+from RSTranslation import TitleScreen\r
 \r
 ##############################################################################\r
 \r
-class RSDownloadBrowser(Screen):\r
+class RSDownloadBrowser(TitleScreen):\r
        skin = """\r
                <screen position="80,100" size="560,400" title="RS Downloader">\r
                        <widget name="list" position="0,0" size="560,395" scrollbarMode="showOnDemand" />\r
                </screen>"""\r
 \r
        def __init__(self, session, path):\r
-               Screen.__init__(self, session)\r
+               TitleScreen.__init__(self, session)\r
                self["list"] = FileList(path, False)\r
                self["actions"] = ActionMap(["OkCancelActions"], {"ok": self.okClicked, "cancel": self.close}, -1)\r
 \r
index 80622df..0a20eb8 100644 (file)
@@ -4,18 +4,18 @@
 ##\r
 from Components.ActionMap import ActionMap\r
 from Components.FileList import FileList\r
-from Screens.Screen import Screen\r
+from RSTranslation import TitleScreen\r
 \r
 ##############################################################################\r
 \r
-class RSListBrowser(Screen):\r
+class RSListBrowser(TitleScreen):\r
        skin = """\r
                <screen position="80,100" size="560,400" title="RS Downloader">\r
                        <widget name="list" position="0,0" size="560,395" scrollbarMode="showOnDemand" />\r
                </screen>"""\r
 \r
        def __init__(self, session, path):\r
-               Screen.__init__(self, session)\r
+               TitleScreen.__init__(self, session)\r
                self["list"] = FileList(path, False, True, "^.*\.(txt)")\r
                self["actions"] = ActionMap(["OkCancelActions"], {"ok": self.okClicked, "cancel": self.close}, -1)\r
 \r
index 1c4d8a6..6d270bc 100644 (file)
@@ -11,9 +11,9 @@ from RSDownloadBrowser import RSDownloadBrowser
 from RSListBrowser import RSListBrowser
 from RSProgress import RSProgress
 from RSSearch import RSSearch
+from RSTranslation import _, TitleScreen
 from Screens.Console import Console
 from Screens.MessageBox import MessageBox
-from Screens.Screen import Screen
 from Tools.Directories import fileExists
 
 if fileExists("/usr/lib/enigma2/python/Screens/LTKeyBoard.pyc"):
@@ -26,14 +26,14 @@ else:
 
 ##############################################################################
 
-class RSMain(Screen):
+class RSMain(TitleScreen):
        skin = """
                <screen position="200,165" size="320,270" title="RS Downloader">
                        <widget name="list" position="10,10" size="300,250" />
                </screen>"""
 
        def __init__(self, session, args = None):
-               Screen.__init__(self, session)
+               TitleScreen.__init__(self, session)
                self.session = session
                
                self["list"] = MenuList([
index ef2abab..aee5108 100644 (file)
@@ -5,12 +5,12 @@
 from Components.ActionMap import ActionMap\r
 from Components.Label import Label\r
 from Components.MenuList import MenuList\r
-from RS import rapidshare\r
-from Screens.Screen import Screen\r
+from RS import rapidshare
+from RSTranslation import _, TitleScreen\r
 \r
 ##############################################################################\r
 \r
-class RSProgress(Screen):\r
+class RSProgress(TitleScreen):\r
        skin = """\r
                <screen position="80,120" size="560,360" title="RS Downloader">\r
                        <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" transparent="1" alphatest="on" />\r
@@ -25,7 +25,7 @@ class RSProgress(Screen):
                </screen>"""\r
 \r
        def __init__(self, session):\r
-               Screen.__init__(self, session)\r
+               TitleScreen.__init__(self, session)\r
                \r
                self["key_red"] = Label(_("Downloading"))\r
                self["key_green"] = Label(_("Files"))\r
index beaf816..af78bdf 100644 (file)
@@ -5,20 +5,20 @@
 from Components.ActionMap import ActionMap
 from Components.MenuList import MenuList
 from RSConfig import config
+from RSTranslation import _, TitleScreen
 from Screens.MessageBox import MessageBox
-from Screens.Screen import Screen
 from twisted.web.client import getPage
 
 ##############################################################################
 
-class RSSearch(Screen):
+class RSSearch(TitleScreen):
        skin = """
                <screen position="75,75" size="570,425" title="Searching... please wait!">
                        <widget name="list" position="0,0" size="570,425" scrollbarMode="showOnDemand" />
                </screen>"""
 
        def __init__(self, session, searchFor):
-               Screen.__init__(self, session)
+               TitleScreen.__init__(self, session)
                self.session = session
                
                self.searchFor = searchFor.replace(" ", "%2B")
@@ -87,7 +87,7 @@ class RSSearch(Screen):
                                except:
                                        pass
                                
-                               self.instance.setTitle("Page %d / %d. Push < > to switch the page..." % (self.curPage, self.maxPage))
+                               self.instance.setTitle(_("Page %d / %d. Push < > to switch the page...") % (self.curPage, self.maxPage))
                        
                        while html.__contains__('title="Download"'):
                                idx = html.index('title="Download"')
@@ -119,12 +119,12 @@ class RSSearch(Screen):
        def previousPage(self):
                if self.curPage > 1:
                        self.curPage -= 1
-                       self.instance.setTitle("Loading previous page... please wait!")
+                       self.instance.setTitle(_("Loading previous page... please wait!"))
                        self.search()
 
        def nextPage(self):
                if self.curPage < self.maxPage:
                        self.curPage += 1
-                       self.instance.setTitle("Loading next page... please wait!")
+                       self.instance.setTitle(_("Loading next page... please wait!"))
                        self.search()
 
diff --git a/rsdownloader/src/RSTranslation.py b/rsdownloader/src/RSTranslation.py
new file mode 100644 (file)
index 0000000..4c80e10
--- /dev/null
@@ -0,0 +1,34 @@
+##\r
+## RS Downloader\r
+## by AliAbdul\r
+##\r
+from Components.Language import language
+from os import environ
+from Screens.Screen import Screen
+from Tools.Directories import resolveFilename, SCOPE_LANGUAGE
+import gettext
+\r
+##############################################################################\r
+
+lang = language.getLanguage()
+environ["LANGUAGE"] = lang[:2]\r
+gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE))\r
+gettext.textdomain("enigma2")\r
+gettext.bindtextdomain("RSDownloader", resolveFilename(SCOPE_LANGUAGE))
+
+def _(txt):\r
+       t = gettext.dgettext("RSDownloader", txt)\r
+       if t == txt:\r
+               t = gettext.gettext(txt)\r
+       return t
+
+##############################################################################
+
+class TitleScreen(Screen):
+       def __init__(self, session, parent=None):\r
+               Screen.__init__(self, session, parent)\r
+               self.onLayoutFinish.append(self.setScreenTitle)\r
+\r
+       def setScreenTitle(self):\r
+               self.setTitle(_("RS Downloader"))
+
index f950883..0762b21 100644 (file)
@@ -4,7 +4,8 @@
 ##\r
 from Plugins.Plugin import PluginDescriptor\r
 from RS import rapidshare\r
-from RSMain import RSMain\r
+from RSMain import RSMain
+from RSTranslation import _\r
 \r
 ##############################################################################\r
 \r