preliminary translator about screen - can be displayed by pressing 'green' in about...
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 9 Nov 2007 01:13:19 +0000 (01:13 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 9 Nov 2007 01:13:19 +0000 (01:13 +0000)
data/skin_default.xml
lib/python/Screens/About.py

index bdc64a3..088bf05 100644 (file)
                <widget source="hddA" render="Label" position="10,230" size="340,40" font="Regular;18"/>
                <ePixmap pixmap="skin_default/dmm_logo.png" position="250,285" zPosition="1" size="98,53" alphatest="on" />
        </screen>
                <widget source="hddA" render="Label" position="10,230" size="340,40" font="Regular;18"/>
                <ePixmap pixmap="skin_default/dmm_logo.png" position="250,285" zPosition="1" size="98,53" alphatest="on" />
        </screen>
+       <!-- Translator Info -->
+       <screen name="TranslationInfo" position="180,123" size="360,340" title="Translation" >
+               <eLabel position="10,30" size="100,20" font="Regular;18" text="Translation:" />
+               <widget source="TranslatorName" render="Label" position="110,30" size="350,20" font="Regular;18"/>
+               <widget source="TranslationInfo" render="Label" position="10,60" size="340,140" font="Regular;18"/>
+       </screen>
        <!-- Adapter setup -->
        <screen name="AdapterSetup" position="130,140" size="460,330" title="Network Setup" >
                <widget name="iface" position="10,10" size="440,30" zPosition="1" font="Regular;20" />
        <!-- Adapter setup -->
        <screen name="AdapterSetup" position="130,140" size="460,330" title="Network Setup" >
                <widget name="iface" position="10,10" size="440,30" zPosition="1" font="Regular;20" />
index 03fbd10..8db58e7 100644 (file)
@@ -39,6 +39,45 @@ class About(Screen):
                else:                   
                        self["hddA"] = StaticText(_("none"))
 
                else:                   
                        self["hddA"] = StaticText(_("none"))
 
+               self["actions"] = ActionMap(["SetupActions", "ColorActions"], 
+                       {
+                               "cancel": self.close,
+                               "ok": self.close,
+                               "green": self.showTranslationInfo
+                       })
+
+       def showTranslationInfo(self):
+               self.session.open(TranslationInfo)
+
+class TranslationInfo(Screen):
+       def __init__(self, session):
+               Screen.__init__(self, session)
+               # don't remove the string out of the _(), or it can't be "translated" anymore.
+
+               # TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline)
+               info = _("TRANSLATOR_INFO")
+
+               if info == "TRANSLATOR_INFO":
+                       info = "(N/A)"
+
+               infolines = _("").split("\n")
+               infomap = {}
+               for x in infolines:
+                       l = x.split(': ')
+                       if len(l) != 2:
+                               continue
+                       (type, value) = l
+                       infomap[type] = value
+               print infomap
+
+               self["TranslationInfo"] = StaticText(info)
+
+               translator_name = infomap.get("Language-Team", "none")
+               if translator_name == "none":
+                       translator_name = infomap.get("Last-Translator", "")
+
+               self["TranslatorName"] = StaticText(translator_name)
+
                self["actions"] = ActionMap(["SetupActions"], 
                        {
                                "cancel": self.close,
                self["actions"] = ActionMap(["SetupActions"], 
                        {
                                "cancel": self.close,