[empathy] Remove Pango markup from translatable strings where possible



commit e38cc7c99febaf760bc07e118c8ce3f2d1ffe615
Author: Philip Withnall <philip tecnocode co uk>
Date:   Fri Jan 1 13:02:23 2010 +0000

    Remove Pango markup from translatable strings where possible
    
    Use GtkBuilder attributes on labels instead, and change one instance of code
    to automatically add markup to the translated string.

 libempathy-gtk/empathy-account-widget-aim.ui       |   10 +++++-
 libempathy-gtk/empathy-account-widget-groupwise.ui |   10 +++++-
 libempathy-gtk/empathy-account-widget-icq.ui       |   10 +++++-
 libempathy-gtk/empathy-account-widget-jabber.ui    |   20 +++++++++--
 libempathy-gtk/empathy-account-widget-msn.ui       |   10 +++++-
 libempathy-gtk/empathy-account-widget-sip.ui       |   34 ++++++++++++++------
 libempathy-gtk/empathy-account-widget-yahoo.ui     |   10 +++++-
 libempathy-gtk/empathy-contact-widget.c            |    6 +++-
 8 files changed, 85 insertions(+), 25 deletions(-)
---
diff --git a/libempathy-gtk/empathy-account-widget-aim.ui b/libempathy-gtk/empathy-account-widget-aim.ui
index 2dfdde2..63d8946 100644
--- a/libempathy-gtk/empathy-account-widget-aim.ui
+++ b/libempathy-gtk/empathy-account-widget-aim.ui
@@ -107,8 +107,11 @@
             <property name="visible">True</property>
             <property name="xalign">0</property>
             <property name="xpad">3</property>
-            <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; MyScreenName&lt;/span&gt;</property>
+            <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; MyScreenName</property>
             <property name="use_markup">True</property>
+            <attributes>
+              <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+            </attributes>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -253,8 +256,11 @@
               <object class="GtkLabel" id="label_example">
                 <property name="visible">True</property>
                 <property name="xalign">0.10000000149011612</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; MyScreenName&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; MyScreenName</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">1</property>
diff --git a/libempathy-gtk/empathy-account-widget-groupwise.ui b/libempathy-gtk/empathy-account-widget-groupwise.ui
index d8ce768..1f6c5aa 100644
--- a/libempathy-gtk/empathy-account-widget-groupwise.ui
+++ b/libempathy-gtk/empathy-account-widget-groupwise.ui
@@ -108,8 +108,11 @@
             <property name="visible">True</property>
             <property name="xalign">0</property>
             <property name="xpad">3</property>
-            <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; username&lt;/span&gt;</property>
+            <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; username</property>
             <property name="use_markup">True</property>
+            <attributes>
+              <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+            </attributes>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -254,8 +257,11 @@
               <object class="GtkLabel" id="label_example">
                 <property name="visible">True</property>
                 <property name="xalign">0.10000000149011612</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; username&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; username</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">1</property>
diff --git a/libempathy-gtk/empathy-account-widget-icq.ui b/libempathy-gtk/empathy-account-widget-icq.ui
index 495d6e9..f889fd0 100644
--- a/libempathy-gtk/empathy-account-widget-icq.ui
+++ b/libempathy-gtk/empathy-account-widget-icq.ui
@@ -107,8 +107,11 @@
             <property name="visible">True</property>
             <property name="xalign">0</property>
             <property name="xpad">3</property>
-            <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; 123456789&lt;/span&gt;</property>
+            <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; 123456789</property>
             <property name="use_markup">True</property>
+            <attributes>
+              <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+            </attributes>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -282,8 +285,11 @@
               <object class="GtkLabel" id="label_example">
                 <property name="visible">True</property>
                 <property name="xalign">0.10000000149011612</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; 123456789&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; 123456789</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">1</property>
diff --git a/libempathy-gtk/empathy-account-widget-jabber.ui b/libempathy-gtk/empathy-account-widget-jabber.ui
index ac70fc4..f9210c6 100644
--- a/libempathy-gtk/empathy-account-widget-jabber.ui
+++ b/libempathy-gtk/empathy-account-widget-jabber.ui
@@ -112,8 +112,11 @@
                 <property name="visible">True</property>
                 <property name="xalign">0</property>
                 <property name="xpad">3</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; user jabber org&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; user jabber org</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">0</property>
@@ -123,8 +126,11 @@
               <object class="GtkLabel" id="label_username_g_example">
                 <property name="xalign">0</property>
                 <property name="xpad">3</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; user gmail com&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; user gmail com</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">1</property>
@@ -443,8 +449,11 @@
               <object class="GtkLabel" id="label_example">
                 <property name="visible">True</property>
                 <property name="xalign">0.10000000149011612</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; user jabber org&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; user jabber org</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">1</property>
@@ -542,8 +551,11 @@
               <object class="GtkLabel" id="label_g_example">
                 <property name="visible">True</property>
                 <property name="xalign">0.10000000149011612</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; user gmail com&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; user gmail com</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">1</property>
diff --git a/libempathy-gtk/empathy-account-widget-msn.ui b/libempathy-gtk/empathy-account-widget-msn.ui
index 083f4f9..9a9250b 100644
--- a/libempathy-gtk/empathy-account-widget-msn.ui
+++ b/libempathy-gtk/empathy-account-widget-msn.ui
@@ -108,8 +108,11 @@
             <property name="visible">True</property>
             <property name="xalign">0</property>
             <property name="xpad">3</property>
-            <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; user hotmail com&lt;/span&gt;</property>
+            <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; user hotmail com</property>
             <property name="use_markup">True</property>
+            <attributes>
+              <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+            </attributes>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -254,8 +257,11 @@
               <object class="GtkLabel" id="label_example">
                 <property name="visible">True</property>
                 <property name="xalign">0.10000000149011612</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; user hotmail com&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; user hotmail com</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">1</property>
diff --git a/libempathy-gtk/empathy-account-widget-sip.ui b/libempathy-gtk/empathy-account-widget-sip.ui
index 1f465e4..13cc2f9 100644
--- a/libempathy-gtk/empathy-account-widget-sip.ui
+++ b/libempathy-gtk/empathy-account-widget-sip.ui
@@ -102,8 +102,11 @@
             <property name="visible">True</property>
             <property name="xalign">0</property>
             <property name="xpad">3</property>
-            <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; user my sip server&lt;/span&gt;</property>
+            <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; user my sip server</property>
             <property name="use_markup">True</property>
+            <attributes>
+              <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+            </attributes>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -199,8 +202,10 @@ username.</property>
                   <object class="GtkLabel" id="label_nat_traversal">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes">&lt;b&gt;NAT Traversal Options&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
+                    <property name="label" translatable="yes">NAT Traversal Options</property>
+                    <attributes>
+                      <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
+                    </attributes>
                   </object>
                   <packing>
                     <property name="right_attach">4</property>
@@ -210,8 +215,10 @@ username.</property>
                   <object class="GtkLabel" id="label_proxy">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Proxy Options&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
+                    <property name="label" translatable="yes">Proxy Options</property>
+                    <attributes>
+                      <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
+                    </attributes>
                   </object>
                   <packing>
                     <property name="right_attach">4</property>
@@ -223,8 +230,10 @@ username.</property>
                   <object class="GtkLabel" id="label_misc">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Miscellaneous Options&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
+                    <property name="label" translatable="yes">Miscellaneous Options</property>
+                    <attributes>
+                      <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
+                    </attributes>
                   </object>
                   <packing>
                     <property name="right_attach">4</property>
@@ -318,8 +327,10 @@ username.</property>
                   <object class="GtkLabel" id="label_keep_alive">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Keep-Alive Options&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
+                    <property name="label" translatable="yes">Keep-Alive Options</property>
+                    <attributes>
+                      <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
+                    </attributes>
                   </object>
                   <packing>
                     <property name="right_attach">4</property>
@@ -555,8 +566,11 @@ username.</property>
               <object class="GtkLabel" id="label_example">
                 <property name="visible">True</property>
                 <property name="xalign">0.10000000149011612</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; user my sip server&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; user my sip server</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">1</property>
diff --git a/libempathy-gtk/empathy-account-widget-yahoo.ui b/libempathy-gtk/empathy-account-widget-yahoo.ui
index 0880cc7..c595a34 100644
--- a/libempathy-gtk/empathy-account-widget-yahoo.ui
+++ b/libempathy-gtk/empathy-account-widget-yahoo.ui
@@ -108,8 +108,11 @@
             <property name="visible">True</property>
             <property name="xalign">0</property>
             <property name="xpad">3</property>
-            <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; username&lt;/span&gt;</property>
+            <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; username</property>
             <property name="use_markup">True</property>
+            <attributes>
+              <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+            </attributes>
           </object>
           <packing>
             <property name="left_attach">1</property>
@@ -357,8 +360,11 @@
               <object class="GtkLabel" id="label_example">
                 <property name="visible">True</property>
                 <property name="xalign">0.10000000149011612</property>
-                <property name="label" translatable="yes">&lt;span size="small"&gt;&lt;b&gt;Example:&lt;/b&gt; username&lt;/span&gt;</property>
+                <property name="label" translatable="yes">&lt;b&gt;Example:&lt;/b&gt; username</property>
                 <property name="use_markup">True</property>
+                <attributes>
+                  <attribute name="scale" value="0.8"/><!-- PANGO_SCALE_SMALL -->
+                </attributes>
               </object>
               <packing>
                 <property name="position">1</property>
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 134f67f..8b1522d 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -1365,7 +1365,11 @@ contact_widget_location_update (EmpathyContactWidget *information)
 
   value = g_hash_table_lookup (location, EMPATHY_LOCATION_TIMESTAMP);
   if (value == NULL)
-    gtk_label_set_markup (GTK_LABEL (information->label_location), _("<b>Location</b>"));
+    {
+      gchar *location = g_strdup_printf ("<b>%s</b>", _("Location"));
+      gtk_label_set_markup (GTK_LABEL (information->label_location), location);
+      g_free (location);
+    }
   else
     {
       gchar *user_date;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]