[master][PATCH] Retranslate language filtering placeholder texts (#1007090)

Vratislav Podzimek vpodzime at redhat.com
Fri Sep 13 06:55:55 UTC 2013


On the Welcome spoke we need to retranslate the language filtering entry's
placeholder text manually, on the Langsupport spoke it happens automatically if
it is marked as translatable.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/spokes/langsupport.glade | 2 +-
 pyanaconda/ui/gui/spokes/welcome.glade     | 2 +-
 pyanaconda/ui/gui/spokes/welcome.py        | 7 +++++++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/langsupport.glade b/pyanaconda/ui/gui/spokes/langsupport.glade
index 6727c9b..d499780 100644
--- a/pyanaconda/ui/gui/spokes/langsupport.glade
+++ b/pyanaconda/ui/gui/spokes/langsupport.glade
@@ -171,7 +171,7 @@
                         <property name="invisible_char">●</property>
                         <property name="invisible_char_set">True</property>
                         <property name="secondary_icon_name">edit-clear-symbolic</property>
-                        <property name="placeholder_text">Type here to search.</property>
+                        <property name="placeholder_text" translatable="yes">Type here to search.</property>
                         <signal name="changed" handler="on_entry_changed" swapped="no"/>
                       </object>
                       <packing>
diff --git a/pyanaconda/ui/gui/spokes/welcome.glade b/pyanaconda/ui/gui/spokes/welcome.glade
index da6d7ae..8dafd38 100644
--- a/pyanaconda/ui/gui/spokes/welcome.glade
+++ b/pyanaconda/ui/gui/spokes/welcome.glade
@@ -447,7 +447,7 @@
                         <property name="invisible_char">●</property>
                         <property name="invisible_char_set">True</property>
                         <property name="secondary_icon_name">edit-clear-symbolic</property>
-                        <property name="placeholder_text">Type here to search.</property>
+                        <property name="placeholder_text" translatable="yes">Type here to search.</property>
                         <signal name="changed" handler="on_entry_changed" swapped="no"/>
                         <signal name="icon-release" handler="on_clear_icon_clicked" swapped="no"/>
                       </object>
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index 79efdd2..e4fca21 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -224,6 +224,13 @@ class WelcomeLanguageSpoke(LangLocaleHandler, StandaloneSpoke):
         xlated = _(before) % {"name" : productName.upper(), "version" : productVersion}
         welcomeLabel.set_label(xlated)
 
+        # Retranslate the language (filtering) entry's placeholder text
+        languageEntry = self.builder.get_object("languageEntry")
+        if not languageEntry in self._origStrings:
+            self._origStrings[languageEntry] = languageEntry.get_placeholder_text()
+
+        languageEntry.set_placeholder_text(_(self._origStrings[languageEntry]))
+
         # And of course, don't forget the underlying window.
         self.window.set_property("distribution", distributionText().upper())
         self.window.retranslate(lang)
-- 
1.7.11.7



More information about the anaconda-patches mailing list