[Tails-dev] Fix some translation related bugs in tails-greet…

このメッセージを削除

このメッセージに返信
著者: winterfairy
日付:  
To: tails-dev
題目: [Tails-dev] Fix some translation related bugs in tails-greeter
The following bugs in tails-greeter is fixed by
the attached patches:

* "Forward" button was not translatable.

* "Forward" button didn't use the intended icon,
but had the same icon as the "Login" button.

* If toggling more options on and off the "Login" button
ended up in English regardless of available translation.

* Wrong passphrase message for persistent volume
always ended up in English even when translation existed.

* Administrator password mismatch message always
ended up in English even when translation existed.

The last patch (0003) simply updates the pot-file, which needs to be
submitted to Transifex because of the added "Forward" string.

>From 5a9618f019b5742c6d4ac121dbb087079e273810 Mon Sep 17 00:00:00 2001
From: Tails developers <tails@???>
Date: Mon, 6 May 2013 09:49:44 +0000
Subject: [PATCH 1/3] Fix so translations is applied on password mismatch messages

---
 GdmGreeter/optionswindow.py     |    4 +---
 GdmGreeter/persistencewindow.py |    1 -
 glade/optionswindow.glade       |    3 ++-
 glade/persistencewindow.glade   |    3 ++-
 4 files changed, 5 insertions(+), 6 deletions(-)


diff --git a/GdmGreeter/optionswindow.py b/GdmGreeter/optionswindow.py
index 2c2965d..9042cb9 100644
--- a/GdmGreeter/optionswindow.py
+++ b/GdmGreeter/optionswindow.py
@@ -20,8 +20,7 @@

"""

-import logging, gtk, gettext, os
-_ = gettext.gettext
+import logging, gtk, os
import GdmGreeter
from GdmGreeter.language import TranslatableWindow

@@ -65,7 +64,6 @@ class OptionsWindow(TranslatableWindow):
         test_password = self.entry_password2.get_text()
         passwords_match = test_password == auth_password
         if not passwords_match:
-            self.warning_label.set_markup(_('<i>Passwords do not match</i>'))
             self.warning_area.show()
         return passwords_match


diff --git a/GdmGreeter/persistencewindow.py b/GdmGreeter/persistencewindow.py
index 7b21d21..3db106a 100644
--- a/GdmGreeter/persistencewindow.py
+++ b/GdmGreeter/persistencewindow.py
@@ -91,7 +91,6 @@ class PersistenceWindow(TranslatableWindow):
                 return True
             except GdmGreeter.errors.WrongPassphraseError:
                 self.entry_passphrase.set_text('')
-                self.warning_label.set_markup(_('<i>Wrong passphrase. Please try again.</i>'))
                 self.warning_area.show_all()
                 return False
         else:
diff --git a/glade/optionswindow.glade b/glade/optionswindow.glade
index 5c9cd51..9733f7c 100644
--- a/glade/optionswindow.glade
+++ b/glade/optionswindow.glade
@@ -209,7 +209,8 @@ Otherwise it will be disabled for better security.</property>
                         <property name="xalign">0</property>
                         <property name="xpad">10</property>
                         <property name="ypad">10</property>
-                        <property name="label" translatable="yes"> </property>
+                        <property name="label" translatable="yes">&lt;i&gt;Passwords do not match&lt;/i&gt;</property>
+                        <property name="use_markup">True</property>
                       </object>
                       <packing>
                         <property name="expand">True</property>
diff --git a/glade/persistencewindow.glade b/glade/persistencewindow.glade
index 96423fc..dbd1c7c 100644
--- a/glade/persistencewindow.glade
+++ b/glade/persistencewindow.glade
@@ -301,7 +301,8 @@
                         <property name="xalign">0</property>
                         <property name="xpad">10</property>
                         <property name="ypad">10</property>
-                        <property name="label" translatable="yes"> </property>
+                        <property name="label" translatable="yes">&lt;i&gt;Wrong passphrase. Please try again.&lt;/i&gt;</property>
+                        <property name="use_markup">True</property>
                       </object>
                       <packing>
                         <property name="expand">True</property>
-- 
1.7.2.5

>From ce427d4da8eadd0928b99e535e30551108c930ce Mon Sep 17 00:00:00 2001
From: Tails developers <tails@???>
Date: Mon, 6 May 2013 11:23:03 +0000
Subject: [PATCH 2/3] Separate forward and login buttons and make them translatable

---
GdmGreeter/persistencewindow.py | 18 +++++++++---------
glade/persistencewindow.glade | 19 +++++++++++++++++--
2 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/GdmGreeter/persistencewindow.py b/GdmGreeter/persistencewindow.py
index 3db106a..657544f 100644
--- a/GdmGreeter/persistencewindow.py
+++ b/GdmGreeter/persistencewindow.py
@@ -21,8 +21,7 @@

"""

-import logging, gtk, gettext, os
-_ = gettext.gettext
+import logging, gtk, os
import GdmGreeter
from GdmGreeter.language import TranslatableWindow

@@ -49,8 +48,7 @@ class PersistenceWindow(TranslatableWindow):
         self.btn_moreoptions_yes = builder.get_object("moreoptions_yes_button")
         self.btn_moreoptions_no = builder.get_object("moreoptions_no_button")
         self.btn_login = builder.get_object("login_button")
-        self.img_login = builder.get_object("login_image")
-        self.img_next = builder.get_object("next_image")
+        self.btn_next = builder.get_object("next_button")
         self.box_persistence = builder.get_object("persistence_box")
         self.readonly_checkbutton = builder.get_object("readonly_checkbutton")
         self.warning_label = builder.get_object("warning_label")
@@ -121,12 +119,11 @@ class PersistenceWindow(TranslatableWindow):


     def update_login_button(self, moreoptions):
         if moreoptions:
-            self.btn_login.set_label("gtk-go-forward")
-            self.btn_login.set_use_stock(True)
+            self.btn_login.hide()
+            self.btn_next.show()
         else:
-            self.btn_login.set_label(_("Login"))
-            self.btn_login.set_use_stock(False)
-            self.btn_login.set_image(self.img_login)
+            self.btn_login.show()
+            self.btn_next.hide()


     def update_moreoptions_buttons(self, moreoptions):
         self.btn_moreoptions_yes.set_active(moreoptions)
@@ -184,6 +181,9 @@ class PersistenceWindow(TranslatableWindow):
     def cb_login_clicked(self, widget, data=None):
         self.go()


+    def cb_next_clicked(self, widget, data=None):
+        self.go()
+
     def key_press_event_cb(self, widget, event=None):
         """Handle key press"""
         if event:
diff --git a/glade/persistencewindow.glade b/glade/persistencewindow.glade
index dbd1c7c..f4d8487 100644
--- a/glade/persistencewindow.glade
+++ b/glade/persistencewindow.glade
@@ -21,6 +21,21 @@
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
+              <object class="GtkButton" id="next_button">
+                <property name="label" translatable="yes">Forward</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="image">next_image</property>
+                <signal name="clicked" handler="cb_next_clicked" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkButton" id="login_button">
                 <property name="label" translatable="yes">Login</property>
                 <property name="visible">True</property>
@@ -32,8 +47,8 @@
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
               </packing>
             </child>
           </object>
-- 
1.7.2.5

>From 0a98d66fada6cb59cb5bda799abe5ab8a51bcc66 Mon Sep 17 00:00:00 2001
From: Tails developers <tails@???>
Date: Mon, 6 May 2013 11:24:25 +0000
Subject: [PATCH 3/3] Update tails-greeter.pot to pick up "Forward"

---
po/tails-greeter.pot | 70 +++++++++++++++++++++++++------------------------
1 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/po/tails-greeter.pot b/po/tails-greeter.pot
index 46d47f7..4d6fbd3 100644
--- a/po/tails-greeter.pot
+++ b/po/tails-greeter.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-06-01 15:10+0200\n"
+"POT-Creation-Date: 2013-05-06 11:18+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@???>\n"
@@ -17,21 +17,20 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

-#: ../glade/persistencewindow.glade.h:1 ../glade/optionswindow.glade.h:1
-#: ../GdmGreeter/persistencewindow.py:128
-msgid "Login"
+#: ../glade/persistencewindow.glade.h:1
+msgid "<i>Wrong passphrase. Please try again.</i>"
msgstr ""

-#: ../glade/persistencewindow.glade.h:2 ../glade/optionswindow.glade.h:2
-msgid "Welcome to Tails"
+#: ../glade/persistencewindow.glade.h:2
+msgid "Forward"
msgstr ""

-#: ../glade/persistencewindow.glade.h:3
-msgid "Use persistence?"
+#: ../glade/persistencewindow.glade.h:3 ../glade/optionswindow.glade.h:6
+msgid "Login"
msgstr ""

#: ../glade/persistencewindow.glade.h:4
-msgid "Yes"
+msgid "More options?"
msgstr ""

#: ../glade/persistencewindow.glade.h:5
@@ -46,13 +45,24 @@ msgstr ""
msgid "Read-Only?"
msgstr ""

-#: ../glade/persistencewindow.glade.h:8 ../glade/optionswindow.glade.h:8
-#: ../glade/langpanel.glade.h:1
-msgid " "
+#: ../glade/persistencewindow.glade.h:8
+msgid "Use persistence?"
msgstr ""

-#: ../glade/persistencewindow.glade.h:9
-msgid "More options?"
+#: ../glade/persistencewindow.glade.h:9 ../glade/optionswindow.glade.h:10
+msgid "Welcome to Tails"
+msgstr ""
+
+#: ../glade/persistencewindow.glade.h:10
+msgid "Yes"
+msgstr ""
+
+#: ../glade/optionswindow.glade.h:1
+msgid "<i>Passwords do not match</i>"
+msgstr ""
+
+#: ../glade/optionswindow.glade.h:2
+msgid "Activate Microsoft Windows XP Camouflage"
msgstr ""

#: ../glade/optionswindow.glade.h:3
@@ -66,26 +76,26 @@ msgid ""
"Otherwise it will be disabled for better security."
msgstr ""

-#: ../glade/optionswindow.glade.h:6
+#: ../glade/optionswindow.glade.h:7
msgid "Password:"
msgstr ""

-#: ../glade/optionswindow.glade.h:7
-msgid "Verify Password:"
+#: ../glade/optionswindow.glade.h:8
+msgid ""
+"This option makes Tails look more like Microsoft Windows XP. This may be "
+"useful in public places in order to avoid attracting suspicion."
msgstr ""

#: ../glade/optionswindow.glade.h:9
-msgid "Windows Camouflage"
+msgid "Verify Password:"
msgstr ""

-#: ../glade/optionswindow.glade.h:10
-msgid ""
-"This option makes Tails look more like Microsoft Windows XP. This may be "
-"useful in public places in order to avoid attracting suspicion."
+#: ../glade/optionswindow.glade.h:11
+msgid "Windows Camouflage"
msgstr ""

-#: ../glade/optionswindow.glade.h:11
-msgid "Activate Microsoft Windows XP Camouflage"
+#: ../glade/langpanel.glade.h:1
+msgid " "
msgstr ""

#: ../glade/langpanel.glade.h:2 ../GdmGreeter/langpanel.py:42
@@ -93,15 +103,11 @@ msgid "Language"
msgstr ""

#: ../glade/langpanel.glade.h:3
-msgid "Locale"
-msgstr ""
-
-#: ../glade/langpanel.glade.h:4
msgid "Layout"
msgstr ""

-#: ../GdmGreeter/optionswindow.py:68
-msgid "<i>Passwords do not match</i>"
+#: ../glade/langpanel.glade.h:4
+msgid "Locale"
msgstr ""

#: ../GdmGreeter/persistence.py:59
@@ -127,10 +133,6 @@ msgid ""
"%(stderr)s"
msgstr ""

-#: ../GdmGreeter/persistencewindow.py:94
-msgid "<i>Wrong passphrase. Please try again.</i>"
-msgstr ""
-
#: ../GdmGreeter/langpanel.py:124 ../GdmGreeter/langpanel.py:148
#: ../GdmGreeter/langpanel.py:181
msgid "Other..."
--
1.7.2.5