Commits

Guido Draheim committed 474461d

translations for time adjustment computer messages

  • Participants
  • Parent commits f9ab5c7

Comments (0)

Files changed (4)

File src/GNUmakefile

 all: builds install restart
 upd up: rpm update restart
 
+
+msg msgchk:
+	python setup.py copy_catalog
+	python setup.py extract_messages
+	python setup.py update_catalog
+	python setup.py compile_catalog
+	grep -B 2 'msgstr.*""' */*/*/LC_MESSAGES/*.po | sed -e 's/^--$$//'
 msgfmt:
 	python setup.py copy_catalog
 	python setup.py compile_catalog

File src/dvbcronrecording/computer.py

     from channels import DvbCronRecordingChannelsPlugin
 except:
     DvbCronRecordingChannelsPlugin = None
+    
+from translate import Translate
 
 DEBUG = False
 PACKAGE = 'dvbcronrecording'
                 ranges += [ (months[0],months[0])]
             item.cronmonths = ranges
         return group
-    def plan1(self, entries):
+    def plan1(self, req, entries):
         """ main entry point """
         plan = RecorderGroupPlan()
         for group in self.recordinglist_to_recordergroups(entries):
         for item in itemlist:
             if item.newtimeMMM == item.endtimeMMM:
                 yield item
-    def plan2(self, entries):
+    def plan2(self, req, entries):
         """ main entry point """
         itemlist = list(self.recordinglist_to_flat_recorderitems(entries))
         deleted = 0
                         yield elem
                 except:
                     pass
-    def adjust_recordertimelist(self, recordertimelist, adapter = None):
+    def adjust_recordertimelist(self, req, recordertimelist, adapter = None):
         """ recordertimelist contains absolute X Y dates """
+        _ = Translate(PACKAGE, req.locale)
         minimum = datetime.timedelta(minutes = 2)
         previous = None
         for current in recordertimelist:
                     previous.extratimeM -= overlapM
                     previous.datetimeY -= overlapY
                     if current.item.channelname != previous.item.channelname:
-                        previous.message += " cut extratimeM %03d," % overlapM
+                        previous.message += _(" extra minutes minus %03d,") % overlapM
                     else:
-                        previous.message += " continues"
+                        previous.message += _(" continues")
                     previous = current
                 else: 
                     extraY = datetime.timedelta(minutes = previous.extratimeM)
                         previous.datetimeY = previous.datetimeX
                         previous.endtimeMMM = previous.newtimeMMM
                         previous.extratimeM = 0
-                        previous.message += " deleted as next one starts %s," % MMMtoHHMM(current.newtimeMMM)
+                        previous.message += _(" deleted as next one starts %s,") % MMMtoHHMM(current.newtimeMMM)
                     else:
                         if previous.datetimeY > current.datetimeX:
                             previous.datetimeY = current.datetimeX
                             previous.endtimeMMM = current.newtimeMMM
                             if current.item.channelname != previous.item.channelname:
-                                previous.message += " end time set to next start %s," % MMMtoHHMM(current.newtimeMMM)
+                                previous.message += _(" end time set to next start %s,") % MMMtoHHMM(current.newtimeMMM)
                             else:
-                                previous.message += " continue"
+                                previous.message += _(" continue")
                         if previous.datetimeY - previous.datetimeX < minimum:
                             previous.deleted = True
                             previous.datetimeY = previous.datetimeX
                             previous.endtimeMMM = previous.newtimeMMM
                             previous.extratimeM = 0
-                            previous.message += " and deleted as it is too short now"
+                            previous.message += _(" and deleted as it is too short now")
                         else:
                             previous = current
             else:
                 # move current starttime up
                 if current.datetimeY <= previous.datetimeY:
                     if previous.datetimeX > current.datetimeX:
-                        current.message+= "previous starts after current"
+                        current.message+= _(" previous starts after current")
                     current.deleted = True
                     current.datetimeX = current.datetimeY
                     current.newtimeMMM = current.endtimeMMM
                     current.extratimeM = 0
-                    current.message += " deleted as previous one ends %s," % MMMtoHHMM(previous.endtimeMMM)
+                    current.message += _(" deleted as previous one ends %s,") % MMMtoHHMM(previous.endtimeMMM)
                 else:
                     if current.datetimeX < previous.datetimeY:
                         current.datetimeX = previous.datetimeY
                         #    current.item.months = [ current.datetimeX.month ] 
                         current.newtimeMMM = previous.endtimeMMM + previous.extratimeM
                         if current.item.channelname != previous.item.channelname:
-                            current.message += " set start time to previous end %s," % MMMtoHHMM(current.newtimeMMM)
+                            current.message += _(" set start time to previous end %s,") % MMMtoHHMM(current.newtimeMMM)
                         else:
-                            current.message += " continue"
+                            current.message += _(" continue")
                     if current.datetimeY - current.datetimeX < minimum:
                         current.deleted = True
                         current.datetimeX = current.datetimeY
                         current.newtimeMMM = current.endtimeMMM
                         current.extratimeM = 0
-                        current.message += " and deleted as it is too short now"
+                        current.message += _(" and deleted as it is too short now")
                     else:
                         previous = current
     def assign_adapters_for_timelist(self, recordertimelist):
             if not done:
                 # can not split overlapping recordings to different adapers
                 pass
-    def timelist_groups(self, timelist, adapter = None):
+    def timelist_groups(self, req, timelist, adapter = None):
+        _ = Translate(PACKAGE, req.locale)
         group = None
         previous = None
         previousgroup = None
                     yield group ; previousgroup = group; group = None
                 item.message = " ."+item.message
                 if elem.deleted: 
-                    item.message += " [DEL]"
+                    item.message += _(" [DEL]")
                     predeletes += [ item ]
                 else:
                     previous = elem
                 # HANDOVER
                 item.message = " :"+item.message
                 if elem.deleted: 
-                    item.message += " [DEL]"
+                    item.message += _(" [DEL]")
                     group.items += [ item ]
                 else:
                     previous = elem
             if group.deleted: continue
             newplan.addgroup(group)
         return newplan
-    def plan3(self, entries):
+    def plan3(self, req, entries):
         """ main entry point """
         self.logg.info("plan3")
         timelist = list(self.recordinglist_to_recordertimelist(entries))
         old_deleted = 0
         for round in xrange(2):
             timelist = sorted(timelist, key = lambda x: x.datetimeX )
-            self.adjust_recordertimelist(timelist)
+            self.adjust_recordertimelist(req, timelist)
             deleted = [ elem for elem in timelist if elem.deleted ]
             new_deleted = len(deleted)
             if old_deleted < new_deleted:
                 continue
         timelist = sorted(timelist, key = lambda x: x.datetimeX )
         plan = RecorderGroupPlan()
-        for group in self.timelist_groups(timelist):
+        for group in self.timelist_groups(req, timelist):
             plan.addgroup(group)
         if True:
             return self.new_reduce_regular_groups(plan)
         if True:
             return self.reduce_regular_groups(plan)
         return plan
-    def plan4(self, entries):
+    def plan4(self, req, entries):
         """ main entry point """
         self.logg.info("plan4")
         timelist = list(self.recordinglist_to_recordertimelist(entries))
         for round in xrange(2):
             timelist = sorted(timelist, key = lambda x: x.datetimeX )
             for adapter in self.adapterlist():
-                self.adjust_recordertimelist(timelist, adapter)
+                self.adjust_recordertimelist(req, timelist, adapter)
             deleted = [ elem for elem in timelist if elem.deleted ]
             new_deleted = len(deleted)
             if old_deleted < new_deleted:
         timelist = sorted(timelist, key = lambda x: x.datetimeX )
         plan = RecorderGroupPlan()
         for adapter in self.adapterlist():
-            for group in self.timelist_groups(timelist, adapter):
+            for group in self.timelist_groups(req, timelist, adapter):
                 plan.addgroup(group)
         self.logg.info("adapterlist = %s", self.adapterlist())
         if True:
             plan.timelist_sort()
             return plan
             
-    def plan(self, entries):
+    def plan(self, req, entries):
         if self.algorithm == "plan1":
-            return self.plan1(entries)
+            return self.plan1(req, entries)
         if self.algorithm == "plan2":
-            return self.plan2(entries)
+            return self.plan2(req, entries)
         self.set_adapters_from_channels_list(self.channels_list())
         if self.algorithm == "plan3":
-            return self.plan3(entries)
+            return self.plan3(req, entries)
         if self.algorithm == "plan4":
-            return self.plan4(entries)
+            return self.plan4(req, entries)
         #else:
-        return self.plan4(entries)
+        return self.plan4(req, entries)
 
 def deltaM(td):
     return td.seconds / 60 + (td.days * 24 * 60)

File src/dvbcronrecording/core.py

     def loadtextlines(self, req):
         entries = self._recordings_list(req)
         computer = DvbCronRecordingPlanComputer(self.env)
-        plan = computer.plan(entries)
+        plan = computer.plan(req, entries)
         for group in plan.groups():
             newtime = MMMtoHHMM(group.newtimeMMM).replace(":","")
             weekday = group.weekday
     # ---------------------------------------------------------------
     def _recording_plan(self, req):
         entries = self._recordings_list(req)
-        return list(self._recording_plan_from(entries))
-    def _recording_plan_from(self, entries):
+        return list(self._recording_plan_from(req, entries))
+    def _recording_plan_from(self, req, entries):
         computer = DvbCronRecordingPlanComputer(self.env)
-        plan = computer.plan(entries)
+        plan = computer.plan(req, entries)
         for item in plan.items():
             yield item
             
     def _makefile_entries(self, req):
         entries = self._recordings_list(req)
         computer = DvbCronRecordingPlanComputer(self.env)
-        plan = computer.plan(entries)
+        plan = computer.plan(req, entries)
         adapterlist = AdapterList()
         for group in plan.groups():
             if not group.items: continue

File src/dvbcronrecording/dvbcronrecording.de.po

 msgstr "Startzeit"
 
 msgid "ends"
-msgstr "Endzeit"
+msgstr "Ende"
 
 msgid "extra"
 msgstr "Extra"
 msgstr "Startzeit"
 
 msgid "endtime"
-msgstr "Endzeit"
+msgstr "Endet"
 
 msgid "hint"
 msgstr "Hinweis"
 
 msgid "Download"
 msgstr "Herunterladen"
+
+# time adjustment computer ...
+msgid " extra minutes minus %03d,"
+msgstr " Extraminuten minus %03d"
+
+#, python-format
+msgid " deleted as next one starts %s,"
+msgstr " gelöscht denn nächste Aufnahme startet %s,"
+
+#, python-format
+msgid " end time set to next start %s,"
+msgstr " Schlusszeit gesetzt auf nächste Startzeit %s"
+
+#
+msgid " and deleted as it is too short now"
+msgstr " gelöscht denn die Aufnahme ist nun zu kurz"
+
+#
+msgid " previous starts after current"
+msgstr " vorherige Aufnahme startet nach aktueller"
+
+#, python-format
+msgid " deleted as previous one ends %s,"
+msgstr " gelöscht denn vorige Aufnahme endet %s"
+
+#, python-format
+msgid " set start time to previous end %s,"
+msgstr " Startzeit gesetzt auf vorige Schlusszeit %s"
+
+#
+msgid " [DEL]"
+msgstr " [ENTF]"