[glabels] String cleanup.



commit 0d5e8e336aa6d3b76470c8b396e442e0e7f2dd83
Author: Jim Evins <evins snaught com>
Date:   Tue Jul 6 23:13:12 2010 -0400

    String cleanup.
    
    Removed pango markup from translatable strings.  Fixed word order assumption
    with use of standalone "per sheet" string.

 data/ui/merge-properties-dialog.ui       |   12 ++++++---
 data/ui/object-editor.ui                 |    2 +-
 data/ui/prefs-dialog.ui                  |   38 ++++++++++++++++++-----------
 data/ui/print-op-dialog-custom-widget.ui |   18 +++++++++----
 libglabels/template.c                    |   10 ++++++-
 src/template-designer.c                  |    7 ++++-
 6 files changed, 57 insertions(+), 30 deletions(-)
---
diff --git a/data/ui/merge-properties-dialog.ui b/data/ui/merge-properties-dialog.ui
index 18ae33d..cda7d89 100644
--- a/data/ui/merge-properties-dialog.ui
+++ b/data/ui/merge-properties-dialog.ui
@@ -84,8 +84,10 @@
             <child type="label">
               <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">&lt;b&gt;Source&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="label" translatable="yes">Source</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
             </child>
           </object>
@@ -176,8 +178,10 @@
             <child type="label">
               <object class="GtkLabel" id="label2">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">&lt;b&gt;Record selection/preview&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="label" translatable="yes">Record selection/preview</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
             </child>
           </object>
diff --git a/data/ui/object-editor.ui b/data/ui/object-editor.ui
index 43ac7f7..833a584 100644
--- a/data/ui/object-editor.ui
+++ b/data/ui/object-editor.ui
@@ -33,7 +33,7 @@
                 <child>
                   <object class="GtkLabel" id="title_label">
                     <property name="visible">True</property>
-                    <property name="label" translatable="yes">&lt;span weight="bold" size="larger"&gt;Xxx object properties&lt;/span&gt;</property>
+                    <property name="label">&lt;span weight="bold" size="larger"&gt;Xxx object properties&lt;/span&gt;</property>
                     <property name="use_markup">True</property>
                   </object>
                   <packing>
diff --git a/data/ui/prefs-dialog.ui b/data/ui/prefs-dialog.ui
index 65d2368..75da0aa 100644
--- a/data/ui/prefs-dialog.ui
+++ b/data/ui/prefs-dialog.ui
@@ -9,6 +9,7 @@
     <child internal-child="vbox">
       <object class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
+        <property name="orientation">vertical</property>
         <child>
           <object class="GtkNotebook" id="prefs_notebook">
             <property name="visible">True</property>
@@ -17,6 +18,7 @@
               <object class="GtkVBox" id="vbox1">
                 <property name="visible">True</property>
                 <property name="border_width">12</property>
+                <property name="orientation">vertical</property>
                 <property name="spacing">12</property>
                 <child>
                   <object class="GtkLabel" id="label3">
@@ -112,8 +114,10 @@
                       <object class="GtkLabel" id="label4">
                         <property name="visible">True</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">&lt;span weight="bold"&gt;Units&lt;/span&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Units</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                     </child>
                   </object>
@@ -189,8 +193,10 @@
                       <object class="GtkLabel" id="label5">
                         <property name="visible">True</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">&lt;span weight="bold"&gt;Default page size&lt;/span&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Default page size</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                     </child>
                   </object>
@@ -215,6 +221,7 @@
               <object class="GtkVBox" id="vbox4">
                 <property name="visible">True</property>
                 <property name="border_width">12</property>
+                <property name="orientation">vertical</property>
                 <property name="spacing">12</property>
                 <child>
                   <object class="GtkLabel" id="label8">
@@ -343,7 +350,6 @@
                                       <object class="GtkImage" id="image6">
                                         <property name="visible">True</property>
                                         <property name="stock">gtk-bold</property>
-                                        <property name="icon-size">4</property>
                                       </object>
                                     </child>
                                   </object>
@@ -362,7 +368,6 @@
                                       <object class="GtkImage" id="image7">
                                         <property name="visible">True</property>
                                         <property name="stock">gtk-italic</property>
-                                        <property name="icon-size">4</property>
                                       </object>
                                     </child>
                                   </object>
@@ -409,7 +414,6 @@
                                       <object class="GtkImage" id="image3">
                                         <property name="visible">True</property>
                                         <property name="stock">gtk-justify-left</property>
-                                        <property name="icon-size">4</property>
                                       </object>
                                     </child>
                                   </object>
@@ -428,7 +432,6 @@
                                       <object class="GtkImage" id="image4">
                                         <property name="visible">True</property>
                                         <property name="stock">gtk-justify-center</property>
-                                        <property name="icon-size">4</property>
                                       </object>
                                     </child>
                                   </object>
@@ -447,7 +450,6 @@
                                       <object class="GtkImage" id="image5">
                                         <property name="visible">True</property>
                                         <property name="stock">gtk-justify-right</property>
-                                        <property name="icon-size">4</property>
                                       </object>
                                     </child>
                                   </object>
@@ -505,8 +507,10 @@
                     <child type="label">
                       <object class="GtkLabel" id="label9">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">&lt;span weight="bold"&gt;Text&lt;/span&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Text</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                     </child>
                   </object>
@@ -631,8 +635,10 @@
                     <child type="label">
                       <object class="GtkLabel" id="label10">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">&lt;span weight="bold"&gt;Line&lt;/span&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Line</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                     </child>
                   </object>
@@ -703,8 +709,10 @@
                     <child type="label">
                       <object class="GtkLabel" id="label11">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">&lt;span weight="bold"&gt;Fill&lt;/span&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Fill</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                     </child>
                   </object>
diff --git a/data/ui/print-op-dialog-custom-widget.ui b/data/ui/print-op-dialog-custom-widget.ui
index 59afddb..e2e0716 100644
--- a/data/ui/print-op-dialog-custom-widget.ui
+++ b/data/ui/print-op-dialog-custom-widget.ui
@@ -178,8 +178,10 @@
                     <child type="label">
                       <object class="GtkLabel" id="label2">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Copies&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Copies</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                     </child>
                   </object>
@@ -324,8 +326,10 @@
                     <child type="label">
                       <object class="GtkLabel" id="label3">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Merge Control&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Merge Control</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                     </child>
                   </object>
@@ -407,8 +411,10 @@
                 <child type="label">
                   <object class="GtkLabel" id="label4">
                     <property name="visible">True</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Options&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
+                    <property name="label" translatable="yes">Options</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
                   </object>
                 </child>
               </object>
diff --git a/libglabels/template.c b/libglabels/template.c
index c942e8b..d5bf037 100644
--- a/libglabels/template.c
+++ b/libglabels/template.c
@@ -719,11 +719,17 @@ lgl_template_frame_get_layout_description (const lglTemplateFrame *frame)
         if ( frame->all.layouts && (frame->all.layouts->next == NULL) )
         {
                 layout = (lglTemplateLayout *)frame->all.layouts->data;
-                string = g_strdup_printf ("%d Ã? %d (%d %s)", layout->nx, layout->ny, n_labels, _("per sheet"));
+                /*
+                 * Translators: 1st %d = number of labels across a page,
+                 *              2nd %d = number of labels down a page,
+                 *              3rd %d = total number of labels on a page (sheet).
+                 */
+                string = g_strdup_printf (_("%d Ã? %d (%d per sheet)"), layout->nx, layout->ny, n_labels);
         }
         else
         {
-                string = g_strdup_printf ("%d %s", n_labels, _("per sheet"));
+                /* Translators: %d is the total number of labels on a page (sheet). */
+                string = g_strdup_printf (_("%d per sheet"), n_labels);
         }
 
         return string;
diff --git a/src/template-designer.c b/src/template-designer.c
index 891648a..4a8473e 100644
--- a/src/template-designer.c
+++ b/src/template-designer.c
@@ -1393,6 +1393,7 @@ static void
 name_page_changed_cb (glTemplateDesigner *dialog)
 {
 	gchar *brand, *part_num, *desc;
+        gchar *string;
 
 	brand    = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->brand_entry), 0, -1));
 	part_num = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->part_num_entry), 0, -1));
@@ -1418,8 +1419,10 @@ name_page_changed_cb (glTemplateDesigner *dialog)
 
                                 gtk_image_set_from_stock (GTK_IMAGE (dialog->priv->name_warning_image),
                                                           GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_BUTTON);
-                                gtk_label_set_markup (GTK_LABEL (dialog->priv->name_warning_label),
-                                                      _("<span foreground='red' weight='bold'>Brand and part# match an existing template!</span>"));
+                                string = g_strdup_printf ("<span foreground='red' weight='bold'>%s</span>",
+                                                          _("Brand and part# match an existing template!"));
+                                gtk_label_set_markup (GTK_LABEL (dialog->priv->name_warning_label), string);
+                                g_free (string);
 
                         }
                 }



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