[PATCH 4/5] Move markup out of translatable strings

David Shea dshea at redhat.com
Wed Oct 16 17:27:22 UTC 2013


For glade strings wrapped in markup, use pango attributes. For "Free
space" in resize.py, move the markup out of the translation.

The markup has to stay in strings that contain markup that does not
apply to the entire string (e.g., one word is marked as bold).
---
 pyanaconda/ui/gui/spokes/advstorage/fcoe.glade  |  6 ++-
 pyanaconda/ui/gui/spokes/advstorage/iscsi.glade | 12 ++++--
 pyanaconda/ui/gui/spokes/custom.glade           | 56 +++++++++++++++++--------
 pyanaconda/ui/gui/spokes/lib/refresh.glade      |  6 ++-
 pyanaconda/ui/gui/spokes/lib/resize.py          |  3 +-
 pyanaconda/ui/gui/spokes/network.glade          |  6 ++-
 pyanaconda/ui/gui/spokes/source.glade           | 18 +++++---
 pyanaconda/ui/gui/spokes/storage.glade          | 12 ++++--
 8 files changed, 80 insertions(+), 39 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/advstorage/fcoe.glade b/pyanaconda/ui/gui/spokes/advstorage/fcoe.glade
index 176fb7d..47d514f 100644
--- a/pyanaconda/ui/gui/spokes/advstorage/fcoe.glade
+++ b/pyanaconda/ui/gui/spokes/advstorage/fcoe.glade
@@ -195,8 +195,10 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Error adding FCoE SAN.&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
+                    <property name="label" translatable="yes">Error adding FCoE SAN.</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
index d1597d3..8050e06 100644
--- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
+++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
@@ -560,8 +560,10 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
-                                <property name="label" translatable="yes">&lt;b&gt;Discovery login rejected.&lt;/b&gt;</property>
-                                <property name="use_markup">True</property>
+                                <property name="label" translatable="yes">Discovery login rejected.</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"/>
+                                </attributes>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
@@ -1120,8 +1122,10 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">&lt;b&gt;Node login failed.&lt;/b&gt;</property>
-                                    <property name="use_markup">True</property>
+                                    <property name="label" translatable="yes">Node login failed.</property>
+                                    <attributes>
+                                      <attribute name="weight" value="bold"/>
+                                    </attributes>
                                   </object>
                                   <packing>
                                     <property name="left_attach">1</property>
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade
index c269be0..608efdd 100644
--- a/pyanaconda/ui/gui/spokes/custom.glade
+++ b/pyanaconda/ui/gui/spokes/custom.glade
@@ -67,10 +67,12 @@
                 <property name="can_focus">False</property>
                 <property name="margin_top">6</property>
                 <property name="xalign">1</property>
-                <property name="label" translatable="yes">&lt;b&gt;_Desired Capacity:&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="label" translatable="yes">_Desired Capacity:</property>
                 <property name="use_underline">True</property>
                 <property name="mnemonic_widget">addSizeEntry</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
               <packing>
                 <property name="left_attach">0</property>
@@ -84,10 +86,12 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes">&lt;b&gt;Mount _Point:&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="label" translatable="yes">Mount _Point:</property>
                 <property name="use_underline">True</property>
                 <property name="mnemonic_widget">addMountPointEntry</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
               <packing>
                 <property name="left_attach">0</property>
@@ -877,10 +881,12 @@ use.  Try something else?</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">&lt;b&gt;Mount _Point:&lt;/b&gt;</property>
-                                    <property name="use_markup">True</property>
+                                    <property name="label" translatable="yes">Mount _Point:</property>
                                     <property name="use_underline">True</property>
                                     <property name="mnemonic_widget">mountPointEntry</property>
+                                    <attributes>
+                                      <attribute name="weight" value="bold"/>
+                                    </attributes>
                                   </object>
                                   <packing>
                                     <property name="left_attach">0</property>
@@ -910,10 +916,12 @@ use.  Try something else?</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">&lt;b&gt;_Label:&lt;/b&gt;</property>
-                                    <property name="use_markup">True</property>
+                                    <property name="label" translatable="yes">_Label:</property>
                                     <property name="use_underline">True</property>
                                     <property name="mnemonic_widget">labelEntry</property>
+                                    <attributes>
+                                      <attribute name="weight" value="bold"/>
+                                    </attributes>
                                   </object>
                                   <packing>
                                     <property name="left_attach">0</property>
@@ -976,10 +984,12 @@ use.  Try something else?</property>
                                     <property name="can_focus">False</property>
                                     <property name="halign">end</property>
                                     <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">&lt;b&gt;_Desired Capacity:&lt;/b&gt;</property>
-                                    <property name="use_markup">True</property>
+                                    <property name="label" translatable="yes">_Desired Capacity:</property>
                                     <property name="use_underline">True</property>
                                     <property name="mnemonic_widget">sizeEntry</property>
+                                    <attributes>
+                                      <attribute name="weight" value="bold"/>
+                                    </attributes>
                                   </object>
                                   <packing>
                                     <property name="left_attach">0</property>
@@ -1015,10 +1025,12 @@ use.  Try something else?</property>
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
                                         <property name="xalign">0</property>
-                                        <property name="label" translatable="yes">&lt;b&gt;Device _Type:&lt;/b&gt;</property>
-                                        <property name="use_markup">True</property>
+                                        <property name="label" translatable="yes">Device _Type:</property>
                                         <property name="use_underline">True</property>
                                         <property name="mnemonic_widget">deviceTypeCombo</property>
+                                        <attributes>
+                                          <attribute name="weight" value="bold"/>
+                                        </attributes>
                                       </object>
                                       <packing>
                                         <property name="left_attach">0</property>
@@ -1032,10 +1044,12 @@ use.  Try something else?</property>
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
                                         <property name="xalign">0</property>
-                                        <property name="label" translatable="yes">&lt;b&gt;File S_ystem:&lt;/b&gt;</property>
-                                        <property name="use_markup">True</property>
+                                        <property name="label" translatable="yes">File S_ystem:</property>
                                         <property name="use_underline">True</property>
                                         <property name="mnemonic_widget">fileSystemTypeCombo</property>
+                                        <attributes>
+                                          <attribute name="weight" value="bold"/>
+                                        </attributes>
                                       </object>
                                       <packing>
                                         <property name="left_attach">0</property>
@@ -1736,8 +1750,11 @@ until you click on the main menu's 'Begin Installation' button.</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
-                                <property name="label" translatable="yes">&lt;span size="small" foreground="white"&gt;AVAILABLE SPACE&lt;/span&gt;</property>
-                                <property name="use_markup">True</property>
+                                <property name="label" translatable="yes">AVAILABLE SPACE</property>
+                                <attributes>
+                                  <attribute name="scale" value="0.83333333333329995"/>
+                                  <attribute name="foreground" value="#ffffffffffff"/>
+                                </attributes>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -1788,8 +1805,11 @@ until you click on the main menu's 'Begin Installation' button.</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
-                                <property name="label" translatable="yes">&lt;span size="small" foreground="white"&gt;TOTAL SPACE&lt;/span&gt;</property>
-                                <property name="use_markup">True</property>
+                                <property name="label" translatable="yes">TOTAL SPACE</property>
+                                <attributes>
+                                  <attribute name="scale" value="0.83333333333329995"/>
+                                  <attribute name="foreground" value="#ffffffffffff"/>
+                                </attributes>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/spokes/lib/refresh.glade b/pyanaconda/ui/gui/spokes/lib/refresh.glade
index 201604d..2578dd2 100644
--- a/pyanaconda/ui/gui/spokes/lib/refresh.glade
+++ b/pyanaconda/ui/gui/spokes/lib/refresh.glade
@@ -254,8 +254,10 @@ installation options while this scan completes.</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Disk rescan complete.&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Disk rescan complete.</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
index 37c887e..36ae4b1 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.py
+++ b/pyanaconda/ui/gui/spokes/lib/resize.py
@@ -174,8 +174,9 @@ class ResizeDialog(GUIObject):
             diskFree = free_space[disk.name][0]
             converted = diskFree.convertTo(spec="mb")
             if int(converted):
+                freeSpaceString = "<span foreground='grey' style='italic'>%s</span>" % _("Free space")
                 self._diskStore.append(itr, [disk.id,
-                                             _("""<span foreground='grey' style='italic'>Free space</span>"""),
+                                             freeSpaceString,
                                              "",
                                              "<span foreground='grey' style='italic'>%s</span>" % size_str(diskFree),
                                              _(PRESERVE),
diff --git a/pyanaconda/ui/gui/spokes/network.glade b/pyanaconda/ui/gui/spokes/network.glade
index f0a945d..bb20596 100644
--- a/pyanaconda/ui/gui/spokes/network.glade
+++ b/pyanaconda/ui/gui/spokes/network.glade
@@ -2580,8 +2580,10 @@ updates available for you.</property>
                     <property name="halign">start</property>
                     <property name="margin_bottom">6</property>
                     <property name="hexpand">True</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Authentication required by wireless network&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
+                    <property name="label" translatable="yes">Authentication required by wireless network</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
                   </object>
                   <packing>
                     <property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/spokes/source.glade b/pyanaconda/ui/gui/spokes/source.glade
index aa7dbd1..52a05e0 100644
--- a/pyanaconda/ui/gui/spokes/source.glade
+++ b/pyanaconda/ui/gui/spokes/source.glade
@@ -309,10 +309,12 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">&lt;b&gt;_Proxy URL&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">_Proxy URL</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">proxyURLEntry</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -389,10 +391,12 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">&lt;b&gt;User_name&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">User_name</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">proxyUsernameEntry</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -406,10 +410,12 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Pass_word&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Pass_word</property>
                         <property name="use_underline">True</property>
                         <property name="mnemonic_widget">proxyPasswordEntry</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
diff --git a/pyanaconda/ui/gui/spokes/storage.glade b/pyanaconda/ui/gui/spokes/storage.glade
index 9f908a2..8cc316f 100644
--- a/pyanaconda/ui/gui/spokes/storage.glade
+++ b/pyanaconda/ui/gui/spokes/storage.glade
@@ -198,8 +198,10 @@
                   <object class="GtkLabel" id="label3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Partition scheme:&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
+                    <property name="label" translatable="yes">Partition scheme:</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -498,8 +500,10 @@
                   <object class="GtkLabel" id="label4">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Partition scheme:&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
+                    <property name="label" translatable="yes">Partition scheme:</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
                   </object>
                   <packing>
                     <property name="expand">False</property>
-- 
1.8.3.1



More information about the anaconda-patches mailing list