I believe that this commit (quoted below) is incorrect.  The
names that it causes to be translated are the "id" members of
toggle buttons in the UI file.  If you translate those, then
get_widget_assert() will assert-fail, because the toggle buttons
will not be found.

Here's an example from text-data-import.ui.  Notice how the "id"
is "space", which should not be translated.  The "label" is
"_Space" and is marked for translation:

      <object class="GtkCheckButton" id="space">
        <property name="label" translatable="yes">_Space</property>
        <property name="visible">True</property>
        <property name="can_focus">True</property>
        <property name="receives_default">False</property>
        <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
        <property name="use_underline">True</property>
        <property name="draw_indicator">True</property>
      </object>

If I properly understand the change that your commit makes, then
will you please revert it?

Thanks,

Ben.

--8<--------------------------cut here-------------------------->8--

From: John Darrington <[email protected]>
Date: Mon, 13 Feb 2012 18:35:53 +0100
Subject: [PATCH] Mark separator names for translation

---
 src/ui/gui/text-data-import-dialog.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/ui/gui/text-data-import-dialog.c 
b/src/ui/gui/text-data-import-dialog.c
index 4f9e5d6..547105f 100644
--- a/src/ui/gui/text-data-import-dialog.c
+++ b/src/ui/gui/text-data-import-dialog.c
@@ -1009,15 +1009,15 @@ struct separator
 /* All the separators in the dialog box. */
 static const struct separator separators[] =
   {
-    {"space", ' '},
-    {"tab", '\t'},
-    {"bang", '!'},
-    {"colon", ':'},
-    {"comma", ','},
-    {"hyphen", '-'},
-    {"pipe", '|'},
-    {"semicolon", ';'},
-    {"slash", '/'},
+    {N_("space"), ' '},
+    {N_("tab"), '\t'},
+    {N_("bang"), '!'},
+    {N_("colon"), ':'},
+    {N_("comma"), ','},
+    {N_("hyphen"), '-'},
+    {N_("pipe"), '|'},
+    {N_("semicolon"), ';'},
+    {N_("slash"), '/'},
   };
 #define SEPARATOR_CNT (sizeof separators / sizeof *separators)
 
@@ -1077,7 +1077,7 @@ init_separators_page (struct import_assistant *ia)
   g_signal_connect (p->custom_cb, "toggled",
                     G_CALLBACK (on_separators_custom_cb_toggle), ia);
   for (i = 0; i < SEPARATOR_CNT; i++)
-    g_signal_connect (get_widget_assert (builder, separators[i].name),
+    g_signal_connect (get_widget_assert (builder, gettext(separators[i].name)),
                       "toggled", G_CALLBACK (on_separator_toggle), ia);
   g_signal_connect (p->escape_cb, "toggled",
                     G_CALLBACK (on_separator_toggle), ia);
-- 
1.7.2.5


-- 
Ben Pfaff 
http://benpfaff.org

_______________________________________________
pspp-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to