Commits

Guido Draheim committed 1106a2a

switch to babel compile_catalog / single message catalog

Comments (0)

Files changed (16)

 upd up: rpm update restart
 
 msgfmt:
-	for po in $(PKG)/*.po; do : \
-	; name=`basename "$$po" | sed -e "s|.po\$$||"` \
-	; lang=`echo "$$name" | sed -e "s|.*[.]||"` \
-	; file=`echo "$$name" | sed -e "s|[.][^.]*$$||"` \
-	; messages=$(PKG)/messages.$$lang.po \
-	; [ -s "$$messages" ] || messages="" \
-	; [ "$$file" = "messages" ] && messages="" \
-	; dirpath=$(PKG)/locale/$$lang/LC_MESSAGES \
-	; test -d $$dirpath || mkdir -p $$dirpath \
-	; echo msgfmt $$messages $$po -o $$dirpath/$$file.mo \
-	; msgfmt $$messages $$po -o $$dirpath/$$file.mo || exit 1 \
-	; done
+	python setup.py copy_catalog
+	python setup.py compile_catalog
 	
+# builds: msgfmt
 builds: msgfmt
 	: python setup.py --help build 
 	python setup.py build --build-base=$(BUILDDIR)
                      '--define=_builddir $(BUILDDIR)' \
                 $(RPMBUILDOPTIONS)
 
-# setuptools sdist is broken for package_data in 0.6c11 vs python 2.6.5	
+# setuptools sdist is broken for package_data in 0.6c11 vs python 2.6.5, known bug!
+# It does simply not work - so use "make dist" instead of "setup.py sdist"
+sdist:
+	test -d $(RPMROOT)/SOURCES || mkdir -p $(RPMROOT)/SOURCES
+	python setup.py sdist --dist-dir $(RPMROOT)/SOURCES -v -v 
 dist: msgfmt
 	: python setup.py sdist --build-base=$(BUILDDIR) \
 	   --dist-dir SOURCES -v -v $X
 	test -d $(RPMROOT)/SOURCES || mkdir -p $(RPMROOT)/SOURCES
-	tar czvf $(RPMROOT)/SOURCES/$(PKG).tgz *.py *.txt *.spec $(PKG)/
+	tar czvf $(RPMROOT)/SOURCES/$(PKG).tgz *.py *.cfg *.txt *.spec $(PKG)/
 	ls -l $(RPMROOT)/SOURCES/$(PKG).tgz
 	@ version=`cat $(SPECNAME).spec | sed -e '/define _version/!d' -e 's/.*_version //'` \
 	; echo mv $(RPMROOT)/SOURCES/$(PKG).tgz $(RPMROOT)/SOURCES/$(PKG)-$$version.tgz \

src/dvbcronrecording/channels.de.po

-msgid ""
-msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
-"Report-Msgid-Bugs-To: guidod@gmx.de\n"
-"Plural-Forms: nplurals=3; plural=(n==0 ? 0 : (n == 1 ? 1 : 2));\n"
-
-msgid "insert"
-msgstr "einfügen"
-
-msgid "delete"
-msgstr "[loeschen]"
-
-msgid "update"
-msgstr "aktualisieren"
-
-msgid "play"
-msgstr "Abspielen"
-
-msgid "mplay"
-msgstr "mit MPlayer"
-
-
-msgid "adapter"
-msgstr "Adapter"
-
-msgid "channel.conf title"
-msgstr "Bezeichnung in der channel.conf"
-
-msgid "channel.conf show"
-msgstr "channel.conf Ansicht"
-
-msgid "channel.conf text"
-msgstr "channel.conf Text"
-
-msgid "action buttons"
-msgstr "Betriebsschalter"
-
-msgid "status"
-msgstr "Status"
-
-msgid "NEW"
-msgstr "NEU"
-
-msgid "SAVE"
-msgstr "SPEICHERN"
-
-msgid "newchannel"
-msgstr "neusender"
-
-msgid "existing channel.conf entry"
-msgstr "existierender channel.conf Eintrag"
-
-msgid "please do not use umlauts"
-msgstr "Bitte keine Umlaute verwenden"
-
-msgid "-default-channels"
-msgstr "3sat,arte"

src/dvbcronrecording/channels.py

     """
     def process_request(self, req):
         req.perm.assert_permission(CHANNELS_VIEW)
-        translate = Translate("channels", req.locale)
+        translate = Translate(PACKAGE, req.locale)
 
         page = req.args['page']
         if not page: page = "list"
 
     def show_text(self, req, page):
         # passing variables to template
-        translate = Translate("channels", req.locale)
+        translate = Translate(PACKAGE, req.locale)
         adapter = req.args["adapter"]
         conf = self.channelsconf_for_adapter(adapter)
         data = {}
     
 
     def _newchannel_list(self, req):
-        translate = Translate("channels", req.locale)
+        translate = Translate(PACKAGE, req.locale)
         _ = ['channelname', 'adapter', 'title']
         defs = {}
         defs["channelname"] = translate("newchannel")
         """ Returns list of the adapter settings """
         session = db_cnx(self.env)
         if defaults is None:
-            translate = Translate("channels", req.locale)
+            translate = Translate(PACKAGE, req.locale)
             _defaults = translate.get("-default-channels", "3sat")
             defaults = [ item.strip() for item in _defaults.split(",") ]
         cols = ['channelname']

src/dvbcronrecording/channelsconf.de.po

-msgid ""
-msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
-"Report-Msgid-Bugs-To: guidod@gmx.de\n"
-"Plural-Forms: nplurals=3; plural=(n==0 ? 0 : (n == 1 ? 1 : 2));\n"
-
-msgid "insert"
-msgstr "einfügen"
-
-msgid "delete"
-msgstr "löchen"
-
-msgid "update"
-msgstr "aktualisieren"
-
-msgid "takeover"
-msgstr "übernehmen"
-
-msgid "play"
-msgstr "Abspielen"
-
-msgid "mplay"
-msgstr "mit MPlayer"
-
-msgid "channel.conf title"
-msgstr "Bezeichnung in der channel.conf"
-
-msgid "channel.conf show"
-msgstr "channel.conf Ansicht"
-
-msgid "action"
-msgstr "vorgehen"
-
-msgid "adapter"
-msgstr "Adapter"
-
-msgid "frequency"
-msgstr "Frequenz"
-
-msgid "polarity"
-msgstr "Polarität"
-
-msgid "source"
-msgstr "Quelle"
-
-msgid "symbolrate"
-msgstr "SymbolRate"
-
-msgid "vpid"
-msgstr "V-pid"
-
-msgid "apid"
-msgstr "A-pid"
-
-msgid "tpid"
-msgstr "T-pid"
-
-msgid "action buttons"
-msgstr "Betriebsschalter"
-
-msgid "status"
-msgstr "Status"
-
-msgid "NEW"
-msgstr "NEU"
-
-msgid "SAVE"
-msgstr "SPEICHERN"
-
-msgid "please do not use umlauts"
-msgstr "Bitte keine Umlaute verwenden"
-
-msgid "use the traditional dvbscan/zap syntax"
-msgstr "Nutze die uebliche dvbscan/zap Syntax"
-
-msgid "have NOT checked it!"
-msgstr "wurde NICHT überprüft!"
-
-msgid "have checked it!"
-msgstr "wurde überprüft!"
-
-msgid "-new-channelsconf"
-msgstr "NEW CHANNEL"
-
-msgid "-new-frequency"
-msgstr "12000"
-
-msgid "-new-polarity"
-msgstr "H"
-
-msgid "-new-symbolrate"
-msgstr "27500"
-
-msgid "Saved"
-msgstr "Abgespeichert"
-
-msgid "Edit"
-msgstr "Editor"
-
-msgid "Takeover"
-msgstr "Übernommen"
-

src/dvbcronrecording/channelsconf.py

     """
     def process_request(self, req):
         req.perm.assert_permission(CHANNELSCONF_VIEW)
-        translate = Translate("channelsconf", req.locale)
+        translate = Translate(PACKAGE, req.locale)
 
         # getting cursor
         page = req.args['page']
     
     def _newchannels_list(self, req):
         _ = ['adapter', 'title','frequency','polarity','source','symbolrate','vpid', 'apid', 'tpid']
-        translate = Translate("channelsconf", req.locale)
+        translate = Translate(PACKAGE, req.locale)
         defs = {}
         defs["adapter"] = "0"
         defs["title"] = translate.get("-new-channel", "NEW CHANNEL")

src/dvbcronrecording/core.de.po

-msgid ""
-msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
-"Report-Msgid-Bugs-To: guidod@gmx.de\n"
-"Plural-Forms: nplurals=3; plural=(n==0 ? 0 : (n == 1 ? 1 : 2));\n"
-
-msgid ".recorder."
-msgstr "Recorder"
-
-msgid ".recording."
-msgstr "Recorder"
-
-msgid "insert" 
-msgstr "einfügen"
-
-msgid "delete" 
-msgstr "[löschen]"
-
-msgid "update"
-msgstr "aktualisieren"
-
-
-msgid "play"
-msgstr "Abspielen"
-
-msgid "mplay"
-msgstr "mit MPlayer"
-
-msgid "starts"
-msgstr "Startzeit"
-
-msgid "ends"
-msgstr "Endzeit"
-
-msgid "extra"
-msgstr "Extra"
-
-msgid "weekday"
-msgstr "Wo-Tag"
-
-msgid "onlydate"
-msgstr " +Datum"
-
-msgid "status"
-msgstr "Status"
-
-msgid "priority"
-msgstr "Priorität"
-
-msgid "prio"
-msgstr "Prio"
-
-msgid "adapter"
-msgstr "Adapter"
-
-msgid "channel.conf title"
-msgstr "Bezeichnung in der channel.conf"
-
-msgid "channel.conf show"
-msgstr "channel.conf Ansicht"
-
-msgid "scansettings"
-msgstr "Scan-Einstellungen"
-
-msgid "satellite"
-msgstr "Satellit"
-
-msgid "transponder"
-msgstr "Transponder"
-
-msgid "action buttons"
-msgstr "Betriebsschalter"
-
-msgid "newtime"
-msgstr "Startzeit"
-
-msgid "endtime"
-msgstr "Endzeit"
-
-msgid "hint"
-msgstr "Hinweis"
-
-msgid "NEW"
-msgstr "NEU"
-
-msgid "SAVE"
-msgstr "SPEICHERN"
-
-msgid "Show Video"
-msgstr "Video Anzeigen"
-
-msgid "Recorded Files Overview"
-msgstr "Überblick aufgezeichneter Dateien"
-
-msgid "Makefile Overview"
-msgstr "Make-Datei Überblick"
-
-msgid "Cronfile Overview"
-msgstr "Cron-Datei Überblick"
-
-msgid "Recording Plan"
-msgstr "Der Aufnahmeplan"
-
-msgid "Cron Activate"
-msgstr "Cron Aktivierung"
-
-msgid "Recordings List"
-msgstr "Die Recorder-Liste"
-
-
-# ---------------------------------------------------------
-
-msgid "fully internationalized"
-msgstr "Umlaute sind jetzt möglich."
-
-msgid "-.prio"
-msgstr "--"
-
-msgid "0.prio"
-msgstr "hmm"
-
-msgid "1.prio" 
-msgstr "egal"
-
-msgid "2.prio"
-msgstr "kann"
-
-msgid "3.prio"
-msgstr "soll"
-
-msgid "4.prio"
-msgstr "muss"
-
-msgid "5.prio"
-msgstr "muss!"
-
-msgid "6.prio"
-msgstr "top!"
-
-msgid "7.prio"
-msgstr "über!"
-
-msgid "-.status"
-msgstr "--"
-
-msgid "no.status"
-msgstr "no"
-
-msgid "ok.status"
-msgstr "ok"
-
-msgid "prime-time-channel"
-msgstr "pro7"
-
-msgid "prime-time-starts"
-msgstr "20:15"
-
-msgid "prime-time-ends"
-msgstr "22:10"
-
-msgid "prime-time-extra"
-msgstr "7"
-
-msgid "prime-time-movie"
-msgstr "der-hauptfilm-heute"
-
-msgid "cron.will.be.updated.every"
-msgstr "Der Zeitdienst übernimmt die Änderungen jeweils"
-
-msgid "ERROR:"
-msgstr "FEHLER:"
-
-msgid "create.directory '%(directory)s':"
-msgstr "Anlegen des Verzeichnisses '%(directory)s':"
-
-msgid "save.to.file '%(filename)s':"
-msgstr "Speichern in Datei '%(filename)s':"
-
-msgid "done.save.to.file '%(filename)s'"
-msgstr "'%(filename)s' Datei wurde gespeichert"
-
-msgid "(%(n)s line)"
-msgid_plural "(%(n)s lines)"
-msgstr[0] "(leer)"
-msgstr[1] "(eine Zeile)"
-msgstr[2] "(%(n)s Zeilen)"

src/dvbcronrecording/core.py

     def get_navigation_items(self, req):
         if not req.perm.has_permission(LIST_VIEW):
             return
-        translate = Translate("core", req.locale)
+        translate = Translate(PACKAGE, req.locale)
         yield ('mainnav', NAV, Markup('<a href="%s">%s</a>' % 
           (req.href(URL), translate.get(self.title, TITLE))))
 
     """
     def process_request(self, req):
         req.perm.assert_permission(LIST_VIEW)
-        translate = Translate("core", req.locale, req.languages )
+        translate = Translate(PACKAGE, req.locale, req.languages )
 
         page = req.args['page']
         if not page: page = "list"
         return channels.channelname_list(req)
     
     def _newrecordings_list(self, req):
-        translate = Translate("core", req.locale)
+        translate = Translate(PACKAGE, req.locale)
         channel = translate.get("prime-time-channel", "pro7")
         starts = translate.get("prime-time-start", "20:15")
         ends = translate.get("prime-time-ends", "22:10") 
     # ---------------------------------------------------------------
     
     def savetext(self, req, text):
-        translate = Translate("core", req.locale)
+        translate = Translate(PACKAGE, req.locale)
         msgs = []
         for line in text.split("\n"):
             if line.startswith("+"):
         return int(spec)
         
     def writefile(self, req, filename, lines):
-        translate = Translate("core", req.locale)
+        translate = Translate(PACKAGE, req.locale)
         directory = os.path.dirname(filename)
         try:
             if not os.path.isdir(directory):

src/dvbcronrecording/dvbcronrecording.de.po

+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Report-Msgid-Bugs-To: guidod@gmx.de\n"
+"Plural-Forms: nplurals=3; plural=(n==0 ? 0 : (n == 1 ? 1 : 2));\n"
+
+msgid "channel list"
+msgstr "Sender-Liste"
+
+msgid "Channel List"
+msgstr "Die Sender-Liste"
+
+msgid "channel"
+msgstr "Sender"
+
+msgid "channelname"
+msgstr "Senderkennung"
+
+msgid "recorder list"
+msgstr "Recorder-Liste"
+
+msgid "recording list"
+msgstr "Recorder-Liste"
+
+msgid "activate!"
+msgstr "Aktivieren!"
+
+msgid "makefile"
+msgstr "Make-Datei"
+
+msgid "cronfile"
+msgstr "Cron-Datei"
+
+msgid "edit as text"
+msgstr "(Texteditor)"
+
+msgid "show recorded files"
+msgstr "Aufgezeichnete Dateien"
+
+msgid "title"
+msgstr "Bezeichnung"
+
+msgid "recording plan"
+msgstr "Aufnahmeplan"
+
+msgid "tuning list"
+msgstr "Tuning-Liste"
+
+msgid "Tuning List"
+msgstr "Die Tuning-Liste"
+
+msgid "time"
+msgstr "Zeit"
+
+msgid "size"
+msgstr "Größe"
+
+msgid "name"
+msgstr "Name"
+
+msgid "Pages:"
+msgstr "Seiten:"
+
+msgid "shown"
+msgstr "zeigt"
+
+msgid " of "
+msgstr " von "
+
+msgid "entries"
+msgstr "Einträgen"
+
+msgid "%(n)s entry"
+msgid_plural "%(n)s entries"
+msgstr[0] "keine Einträge"
+msgstr[1] "%(n)s Eintrag"
+msgstr[2] "%(n)s Einträge"
+
+msgid "channel type"
+msgstr "Kanaltyp"
+
+msgid "video channels"
+msgstr "Fernsehkanäle"
+
+msgid "radio channels"
+msgstr "Radiokanäle"
+
+msgid "data channels"
+msgstr "Datenkanäle"
+
+msgid "all channel types"
+msgstr "Alle Sendekanäle"
+
+msgid "channel subselection"
+msgstr "Teilauswahl Kanäle"
+ 
+msgid "channels.conf editor"
+msgstr "channels.conf Editor"
+
+#  channels.de.po
+
+msgid "insert"
+msgstr "einfügen"
+
+msgid "delete"
+msgstr "[loeschen]"
+
+msgid "update"
+msgstr "aktualisieren"
+
+msgid "play"
+msgstr "Abspielen"
+
+msgid "mplay"
+msgstr "mit MPlayer"
+
+
+msgid "adapter"
+msgstr "Adapter"
+
+msgid "channel.conf title"
+msgstr "Bezeichnung in der channel.conf"
+
+msgid "channel.conf show"
+msgstr "channel.conf Ansicht"
+
+msgid "channel.conf text"
+msgstr "channel.conf Text"
+
+msgid "action buttons"
+msgstr "Betriebsschalter"
+
+msgid "status"
+msgstr "Status"
+
+msgid "NEW"
+msgstr "NEU"
+
+msgid "SAVE"
+msgstr "SPEICHERN"
+
+msgid "newchannel"
+msgstr "neusender"
+
+msgid "existing channel.conf entry"
+msgstr "existierender channel.conf Eintrag"
+
+msgid "please do not use umlauts"
+msgstr "Bitte keine Umlaute verwenden"
+
+msgid "-default-channels"
+msgstr "3sat,arte"
+
+# channelsconf.de.po
+
+
+msgid "insert"
+msgstr "einfügen"
+
+msgid "delete"
+msgstr "löchen"
+
+msgid "update"
+msgstr "aktualisieren"
+
+msgid "takeover"
+msgstr "übernehmen"
+
+msgid "play"
+msgstr "Abspielen"
+
+msgid "mplay"
+msgstr "mit MPlayer"
+
+msgid "channel.conf title"
+msgstr "Bezeichnung in der channel.conf"
+
+msgid "channel.conf show"
+msgstr "channel.conf Ansicht"
+
+msgid "action"
+msgstr "vorgehen"
+
+msgid "adapter"
+msgstr "Adapter"
+
+msgid "frequency"
+msgstr "Frequenz"
+
+msgid "polarity"
+msgstr "Polarität"
+
+msgid "source"
+msgstr "Quelle"
+
+msgid "symbolrate"
+msgstr "SymbolRate"
+
+msgid "vpid"
+msgstr "V-pid"
+
+msgid "apid"
+msgstr "A-pid"
+
+msgid "tpid"
+msgstr "T-pid"
+
+msgid "action buttons"
+msgstr "Betriebsschalter"
+
+msgid "status"
+msgstr "Status"
+
+msgid "NEW"
+msgstr "NEU"
+
+msgid "SAVE"
+msgstr "SPEICHERN"
+
+msgid "please do not use umlauts"
+msgstr "Bitte keine Umlaute verwenden"
+
+msgid "use the traditional dvbscan/zap syntax"
+msgstr "Nutze die uebliche dvbscan/zap Syntax"
+
+msgid "have NOT checked it!"
+msgstr "wurde NICHT überprüft!"
+
+msgid "have checked it!"
+msgstr "wurde überprüft!"
+
+msgid "-new-channelsconf"
+msgstr "NEW CHANNEL"
+
+msgid "-new-frequency"
+msgstr "12000"
+
+msgid "-new-polarity"
+msgstr "H"
+
+msgid "-new-symbolrate"
+msgstr "27500"
+
+msgid "Saved"
+msgstr "Abgespeichert"
+
+msgid "Edit"
+msgstr "Editor"
+
+msgid "Takeover"
+msgstr "Übernommen"
+
+# core.de.po
+
+msgid ".recorder."
+msgstr "Recorder"
+
+msgid ".recording."
+msgstr "Recorder"
+
+msgid "insert" 
+msgstr "einfügen"
+
+msgid "delete" 
+msgstr "[löschen]"
+
+msgid "update"
+msgstr "aktualisieren"
+
+
+msgid "play"
+msgstr "Abspielen"
+
+msgid "mplay"
+msgstr "mit MPlayer"
+
+msgid "starts"
+msgstr "Startzeit"
+
+msgid "ends"
+msgstr "Endzeit"
+
+msgid "extra"
+msgstr "Extra"
+
+msgid "weekday"
+msgstr "Wo-Tag"
+
+msgid "onlydate"
+msgstr " +Datum"
+
+msgid "status"
+msgstr "Status"
+
+msgid "priority"
+msgstr "Priorität"
+
+msgid "prio"
+msgstr "Prio"
+
+msgid "adapter"
+msgstr "Adapter"
+
+msgid "channel.conf title"
+msgstr "Bezeichnung in der channel.conf"
+
+msgid "channel.conf show"
+msgstr "channel.conf Ansicht"
+
+msgid "scansettings"
+msgstr "Scan-Einstellungen"
+
+msgid "satellite"
+msgstr "Satellit"
+
+msgid "transponder"
+msgstr "Transponder"
+
+msgid "action buttons"
+msgstr "Betriebsschalter"
+
+msgid "newtime"
+msgstr "Startzeit"
+
+msgid "endtime"
+msgstr "Endzeit"
+
+msgid "hint"
+msgstr "Hinweis"
+
+msgid "NEW"
+msgstr "NEU"
+
+msgid "SAVE"
+msgstr "SPEICHERN"
+
+msgid "Show Video"
+msgstr "Video Anzeigen"
+
+msgid "Recorded Files Overview"
+msgstr "Überblick aufgezeichneter Dateien"
+
+msgid "Makefile Overview"
+msgstr "Make-Datei Überblick"
+
+msgid "Cronfile Overview"
+msgstr "Cron-Datei Überblick"
+
+msgid "Recording Plan"
+msgstr "Der Aufnahmeplan"
+
+msgid "Cron Activate"
+msgstr "Cron Aktivierung"
+
+msgid "Recordings List"
+msgstr "Die Recorder-Liste"
+
+
+# ---------------------------------------------------------
+
+msgid "fully internationalized"
+msgstr "Umlaute sind jetzt möglich."
+
+msgid "-.prio"
+msgstr "--"
+
+msgid "0.prio"
+msgstr "hmm"
+
+msgid "1.prio" 
+msgstr "egal"
+
+msgid "2.prio"
+msgstr "kann"
+
+msgid "3.prio"
+msgstr "soll"
+
+msgid "4.prio"
+msgstr "muss"
+
+msgid "5.prio"
+msgstr "muss!"
+
+msgid "6.prio"
+msgstr "top!"
+
+msgid "7.prio"
+msgstr "über!"
+
+msgid "-.status"
+msgstr "--"
+
+msgid "no.status"
+msgstr "no"
+
+msgid "ok.status"
+msgstr "ok"
+
+msgid "prime-time-channel"
+msgstr "pro7"
+
+msgid "prime-time-starts"
+msgstr "20:15"
+
+msgid "prime-time-ends"
+msgstr "22:10"
+
+msgid "prime-time-extra"
+msgstr "7"
+
+msgid "prime-time-movie"
+msgstr "der-hauptfilm-heute"
+
+msgid "cron.will.be.updated.every"
+msgstr "Der Zeitdienst übernimmt die Änderungen jeweils"
+
+msgid "ERROR:"
+msgstr "FEHLER:"
+
+msgid "create.directory '%(directory)s':"
+msgstr "Anlegen des Verzeichnisses '%(directory)s':"
+
+msgid "save.to.file '%(filename)s':"
+msgstr "Speichern in Datei '%(filename)s':"
+
+msgid "done.save.to.file '%(filename)s'"
+msgstr "'%(filename)s' Datei wurde gespeichert"
+
+msgid "(%(n)s line)"
+msgid_plural "(%(n)s lines)"
+msgstr[0] "(leer)"
+msgstr[1] "(eine Zeile)"
+msgstr[2] "(%(n)s Zeilen)"
+
+# files.de.po
+
+msgid "play"
+msgstr "Abspielen"
+
+msgid "mplay"
+msgstr "mit MPlayer"
+
+msgid "Show Video"
+msgstr "Video Anzeigen"
+
+msgid "Recorded Files Overview"
+msgstr "Überblick aufgezeichneter Dateien"
+
+# tuning.de.po
+
+msgid "insert"
+msgstr "einfügen"
+
+msgid "delete"
+msgstr "[löschen]"
+
+msgid "update"
+msgstr "aktualisieren"
+
+msgid "play"
+msgstr "Abspielen"
+
+msgid "mplay"
+msgstr "mit MPlayer"
+
+msgid "adapter"
+msgstr "Adapter"
+
+msgid "channel.conf title"
+msgstr "Bezeichnung in der channel.conf"
+
+msgid "channel.conf show"
+msgstr "channel.conf Ansicht"
+
+msgid "scansettings"
+msgstr "Scan-Einstellungen"
+
+msgid "satellite"
+msgstr "Satellit"
+
+msgid "transponder"
+msgstr "Transponder"
+
+msgid "status"
+msgstr "Status"
+
+msgid "action buttons"
+msgstr "Betriebsschalter"
+
+msgid "NEW"
+msgstr "NEU"
+
+msgid "SAVE"
+msgstr "SPEICHERN"
+
+msgid "from"
+msgstr "aus"
+
+msgid "related"
+msgstr "verknüpft"
+
+msgid "as the original channels.conf"
+msgstr "als ursprünglicher channels.conf"
+
+msgid "input 0:0 for <adapter>:<frontend>"
+msgstr "Eingabe 0:0 meint <Adapter>:<Frontend>"
+

src/dvbcronrecording/files.de.po

-msgid ""
-msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
-"Report-Msgid-Bugs-To: guidod@gmx.de\n"
-"Plural-Forms: nplurals=3; plural=(n==0 ? 0 : (n == 1 ? 1 : 2));\n"
-
-msgid "play"
-msgstr "Abspielen"
-
-msgid "mplay"
-msgstr "mit MPlayer"
-
-msgid "Show Video"
-msgstr "Video Anzeigen"
-
-msgid "Recorded Files Overview"
-msgstr "Überblick aufgezeichneter Dateien"

src/dvbcronrecording/files.py

     """
     def process_request(self, req):
         req.perm.assert_permission('DVBREC_LIST_VIEW')
-        translate = Translate("files", req.locale)
+        translate = Translate(PACKAGE, req.locale)
 
         page = req.args['page']
         if not page: page = "list"

src/dvbcronrecording/messages.de.po

-msgid "\n"
-msgstr "\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Report-Msgid-Bugs-To: guidod@gmx.de\n"
-"Plural-Forms: nplurals=3; plural=(n==0 ? 0 : (n == 1 ? 1 : 2));\n"
-
-msgid "channel list"
-msgstr "Sender-Liste"
-
-msgid "Channel List"
-msgstr "Die Sender-Liste"
-
-msgid "channel"
-msgstr "Sender"
-
-msgid "channelname"
-msgstr "Senderkennung"
-
-msgid "recorder list"
-msgstr "Recorder-Liste"
-
-msgid "recording list"
-msgstr "Recorder-Liste"
-
-msgid "activate!"
-msgstr "Aktivieren!"
-
-msgid "makefile"
-msgstr "Make-Datei"
-
-msgid "cronfile"
-msgstr "Cron-Datei"
-
-msgid "edit as text"
-msgstr "(Texteditor)"
-
-msgid "show recorded files"
-msgstr "Aufgezeichnete Dateien"
-
-msgid "title"
-msgstr "Bezeichnung"
-
-msgid "recording plan"
-msgstr "Aufnahmeplan"
-
-msgid "tuning list"
-msgstr "Tuning-Liste"
-
-msgid "Tuning List"
-msgstr "Die Tuning-Liste"
-
-msgid "time"
-msgstr "Zeit"
-
-msgid "size"
-msgstr "Größe"
-
-msgid "name"
-msgstr "Name"
-
-msgid "Pages:"
-msgstr "Seiten:"
-
-msgid "shown"
-msgstr "zeigt"
-
-msgid " of "
-msgstr " von "
-
-msgid "entries"
-msgstr "Einträgen"
-
-msgid "%(n)s entry"
-msgid_plural "%(n)s entries"
-msgstr[0] "keine Einträge"
-msgstr[1] "%(n)s Eintrag"
-msgstr[2] "%(n)s Einträge"
-
-msgid "channel type"
-msgstr "Kanaltyp"
-
-msgid "video channels"
-msgstr "Fernsehkanäle"
-
-msgid "radio channels"
-msgstr "Radiokanäle"
-
-msgid "data channels"
-msgstr "Datenkanäle"
-
-msgid "all channel types"
-msgstr "Alle Sendekanäle"
-
-msgid "channel subselection"
-msgstr "Teilauswahl Kanäle"
- 
-msgid "channels.conf editor"
-msgstr "channels.conf Editor"

src/dvbcronrecording/tuning.de.po

-msgid ""
-msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
-"Report-Msgid-Bugs-To: guidod@gmx.de\n"
-"Plural-Forms: nplurals=3; plural=(n==0 ? 0 : (n == 1 ? 1 : 2));\n"
-
-msgid "insert"
-msgstr "einfügen"
-
-msgid "delete"
-msgstr "[löschen]"
-
-msgid "update"
-msgstr "aktualisieren"
-
-msgid "play"
-msgstr "Abspielen"
-
-msgid "mplay"
-msgstr "mit MPlayer"
-
-msgid "adapter"
-msgstr "Adapter"
-
-msgid "channel.conf title"
-msgstr "Bezeichnung in der channel.conf"
-
-msgid "channel.conf show"
-msgstr "channel.conf Ansicht"
-
-msgid "scansettings"
-msgstr "Scan-Einstellungen"
-
-msgid "satellite"
-msgstr "Satellit"
-
-msgid "transponder"
-msgstr "Transponder"
-
-msgid "status"
-msgstr "Status"
-
-msgid "action buttons"
-msgstr "Betriebsschalter"
-
-msgid "NEW"
-msgstr "NEU"
-
-msgid "SAVE"
-msgstr "SPEICHERN"
-
-msgid "from"
-msgstr "aus"
-
-msgid "related"
-msgstr "verknüpft"
-
-msgid "as the original channels.conf"
-msgstr "als ursprünglicher channels.conf"
-
-msgid "input 0:0 for <adapter>:<frontend>"
-msgstr "Eingabe 0:0 meint <Adapter>:<Frontend>"

src/dvbcronrecording/tuning.py

     if type(text) is str: return unicode(text)
     return unicode(str(text))
 
-PACKAGE = 'tracsimplerecorder'
+PACKAGE = u'dvbcronrecording'
 NAV = 'recordings'
 URL = 'recording'
 SUBURL = 'channeltuning'
         if not page: page = "list"
         
         # ------------------------------------------------
-        translate = Translate("tuning", req.locale)
+        translate = Translate(PACKAGE, req.locale)
         message = ""
         
         if page in [ None, '', 'list' ]:
+## not quite like the GNUmakefile but better to have the
+## "compile_catalog" in the normal setup.py build phase
+## such that py-installer users can install as normal.
+
+
+from distutils.cmd import Command
+from distutils import log
+import re, glob
+
+import os.path
+import shutil
+
+EXTRA_DIST = { "." : [ "*.txt", "*.spec", "*/*.po" ]}
+
+class copy_catalog(Command):
+    description = "copies a message catalog named <domain>.<lang>.po into <directory>/<lang>/LC_MESSAGES/<domain>.po"
+    user_options = [
+        ('output-dir=', 'd',
+         'path to base directory containing the output catalogs - defaults to "./locale"'),
+        ('source-dir=', 'd',
+         'path to base directory containing the input catalogs - defaults to parent of "directory"'),
+        ]
+    def initialize_options(self):
+        self.domain = 'messages'
+        self.output_dir = 'locale'
+        self.source_dir = None
+    def finalize_options(self):
+        pass
+    def run(self):
+        check = re.compile(r"(.*)[.](\w+)([.]po)$")
+        directory = self.output_dir or "locale"
+        sourcedir = self.source_dir or os.path.dirname(directory)
+        sourcepattern = os.path.join(sourcedir, "*.po")
+        log.debug("looking for %s", sourcepattern)
+        for filename in glob.glob(sourcepattern):
+            m = check.match(os.path.basename(filename))
+            if m:
+                domain, locale, ext = m.groups()
+                po_file = os.path.join(directory, locale,
+                    "LC_MESSAGES", domain + ext)
+                log.error("copying %s into %s", filename, po_file)
+                po_dirpath = os.path.dirname(po_file)
+                if not os.path.isdir(po_dirpath):
+                    os.makedirs(po_dirpath)
+                shutil.copy(filename, po_file)
+            
+from distutils.command.sdist import sdist
+
+class dist(sdist):
+    description = "create a source distribution (tarball, zip file, etc.)"
+    extra_dist = EXTRA_DIST
+    def get_file_list(self):
+        sdist.get_file_list(self)
+        for data in [ "package_data", "data_files", "extra_dist" ]:
+            package_data = getattr(self.distribution, data, getattr(self, data, {}))           
+            if not package_data: continue
+            for package, patterns in package_data.items():
+                for pattern in patterns:
+                    import glob, os.path
+                    for name in glob.glob(os.path.join(package, pattern)):
+                        self.filelist.append(name)
+
+def spec(filename, variable):
+    section = None
+    for line in open(filename):
+        if section is not None:
+            if line.startswith("%"):
+                return section
+            section += line
+            continue
+        m = re.match(r"%define\s+(\w+)\s+(\S+)", line)
+        if m and m.group(1) == "_"+variable:
+            return m.group(2)
+        m = re.match(r"(\w+):\s+(\S+)", line)
+        if m and m.group(1) == variable:
+            return m.group(2)
+        m = re.match(r"%(\w+)\s*$", line)
+        if m and m.group(1) == variable:
+            section = ""
+        
+[compile_catalog]
+directory = dvbcronrecording/locale
+domain = dvbcronrecording
+statistics = true
+# input_file
+# statistics
+
+[extract_dvbcronrecording]
+add_comments = TRANSLATORS:
+output_file = dvbcronrecording/locale/dvbcronrecording.pot
+width = 80
+statistics = true
+
+[init_catalog]
+domain = dvbcronrecording
+input_file = dvbcronrecording/locale/dvbcronrecording.pot
+output_dir = dvbcronrecording/locale
+
+[update_catalog]
+domain = dvbcronrecording
+input_file = dvbcronrecording/locale/dvbcronrecording.pot
+output_dir = dvbcronrecording/locale
+previous = true
+
+[copy_catalog]
+output_dir = dvbcronrecording/locale
+
+[bdist_rpm]
+release=2
 from setuptools import setup
 import re
 
-def spec(filename, variable):
-    section = None
-    for line in open(filename):
-        if section is not None:
-            if line.startswith("%"):
-                return section
-            section += line
-            continue
-        m = re.match(r"%define\s+(\w+)\s+(\S+)", line)
-        if m and m.group(1) == "_"+variable:
-            return m.group(2)
-        m = re.match(r"(\w+):\s+(\S+)", line)
-        if m and m.group(1) == variable:
-            return m.group(2)
-        m = re.match(r"%(\w+)\s*$", line)
-        if m and m.group(1) == variable:
-            section = ""
-
+from mysetup import spec, copy_catalog, dist
 ##########################################        
 
 RPM = "trac-dvbcronrecording-plugin.spec"
 PACKAGE = 'dvbcronrecording'
 VERSION = spec(RPM, "version")
 README = spec(RPM, "description")
+
+from babel.messages import frontend as babel
+
+extractors = { PACKAGE : [
+     ('**.py', 'python', None),
+     ('templates/**.mako', 'mako', None),
+     ('templates/**.html', 'genshi', None),
+     ('public/**', 'ignore', None)]}
+
+cmdclass = {
+    'compile_catalog': babel.compile_catalog,
+    'extract_messages': babel.extract_messages,
+    'init_catalog': babel.init_catalog,
+    'update_catalog': babel.update_catalog,
+    'copy_catalog': copy_catalog,
+    'dist' : dist, 'sdist' : dist,
+    }
+
+from distutils.command.build import build 
+build.sub_commands.insert(0, ('compile_catalog', lambda x: True))    
+build.sub_commands.insert(0, ('copy_catalog', lambda x: True))    
  
 setup(
   package_data = { PACKAGE: ['templates/*.html', 
   url = 'http://guidod.homelinux.org',
   description = README,
   license = '''BSD''',
+  message_extractors = extractors, cmdclass = cmdclass,
 )