[gcalctool/gnome-2-30] Mark strings for translation that were missing (Gert Kulyk, Bug #614491)



commit 50af621e4d8265ea5a9a1071bf8b3fe9aebcaad8
Author: Robert Ancell <robert ancell gmail com>
Date:   Thu Apr 1 09:31:46 2010 +1100

    Mark strings for translation that were missing (Gert Kulyk, Bug #614491)

 NEWS              |    2 ++
 data/gcalctool.ui |    6 +++---
 src/gtk.c         |   26 +++++++++++++++++++++++++-
 3 files changed, 30 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index ad4d3c9..c59a5fe 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@
 Overview of changes in gcalctool 5.30.1
 
     * Fix bug stopping translations from working (Gert Kulyk, Bug #614489)
+    
+    * Mark strings for translation that were missing (Gert Kulyk, Bug #614491)
  
 Overview of changes in gcalctool 5.30.0
 
diff --git a/data/gcalctool.ui b/data/gcalctool.ui
index d9a7db9..2714dbc 100644
--- a/data/gcalctool.ui
+++ b/data/gcalctool.ui
@@ -146,7 +146,7 @@
                   <object class="GtkMenu" id="menuitem4_menu">
                     <child>
                       <object class="GtkImageMenuItem" id="help_menu">
-                        <property name="label" comments="Help|Contents menu">_Contents</property>
+                        <property name="label" translatable="yes" comments="Help|Contents menu">_Contents</property>
                         <property name="visible">True</property>
                         <property name="use_underline">True</property>
                         <property name="image">image1</property>
@@ -4709,7 +4709,7 @@
                           <object class="GtkLabel" id="decimal_places_label1">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
-                            <property name="label">Show</property>
+                            <property name="label" comments="Not translated by Gtk+, is translated as one string">Show</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">decimal_places_spin</property>
                           </object>
@@ -4735,7 +4735,7 @@
                           <object class="GtkLabel" id="decimal_places_label2">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
-                            <property name="label">decimal _places</property>
+                            <property name="label" comments="Not translated by Gtk+, is translated as one string">decimal _places</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">decimal_places_spin</property>
                           </object>
diff --git a/src/gtk.c b/src/gtk.c
index b140526..d7b2c61 100644
--- a/src/gtk.c
+++ b/src/gtk.c
@@ -1634,6 +1634,7 @@ create_main_window()
     GtkWidget *widget;
     PangoFontDescription *font_desc;
     GtkCellRenderer *renderer;
+    gchar *string, **tokens;
 
     X.ui = gtk_builder_new();
     load_ui(X.ui, UI_FILE);
@@ -1768,7 +1769,30 @@ create_main_window()
     gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(widget), renderer, TRUE);
     gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(widget), renderer, "text", 0);
 
-    // _("Show %d decimal places") decimal_places_label1, decimal_places_label2
+    /* Label used in preferences dialog.  The %d is replaced by a spinbutton */
+    string = _("Show %d decimal places");
+    tokens = g_strsplit(string, "%d", 2);
+    widget = GET_WIDGET("decimal_places_label1");
+    if (tokens[0])
+        string = g_strstrip(tokens[0]);
+    else
+        string = "";
+    if (string[0] != '\0')
+        gtk_label_set_text(GTK_LABEL(widget), string);
+    else
+        gtk_widget_hide(widget);
+
+    widget = GET_WIDGET("decimal_places_label2");
+    if (tokens[0] && tokens[1])
+        string = g_strstrip(tokens[1]);
+    else
+        string = "";
+    if (string[0] != '\0')
+        gtk_label_set_text(GTK_LABEL(widget), string);
+    else
+        gtk_widget_hide(widget);
+
+    g_strfreev(tokens);
 }
 
 



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