[gtranslator] Remove markup from translatable string



commit 224f4ef07c9f7b570db2a3e2ad873d810fdfa3a4
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Mon Mar 25 22:32:34 2013 +0200

    Remove markup from translatable string
    
    Fixes bug 696587.

 .../gtr-translation-memory-dialog.c                |    8 ++++++--
 src/gtr-assistant.c                                |   13 ++++++++++---
 src/gtr-preferences-dialog.c                       |   13 +++++++++----
 src/gtr-tab.c                                      |    9 +++++++--
 4 files changed, 32 insertions(+), 11 deletions(-)
---
diff --git a/plugins/translation-memory/gtr-translation-memory-dialog.c 
b/plugins/translation-memory/gtr-translation-memory-dialog.c
index 5652c6c..2b24716 100644
--- a/plugins/translation-memory/gtr-translation-memory-dialog.c
+++ b/plugins/translation-memory/gtr-translation-memory-dialog.c
@@ -153,6 +153,7 @@ add_to_database (gpointer data_pointer)
   else
     {
       GtkWidget *dialog;
+      gchar *markup;
 
       gtk_progress_bar_set_fraction (data->progress, 1.0);
 
@@ -161,8 +162,11 @@ add_to_database (gpointer data_pointer)
                                        GTK_MESSAGE_INFO,
                                        GTK_BUTTONS_CLOSE, NULL);
 
-      gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
-                                     _("<span weight=\"bold\" size=\"large\">Strings added to 
database</span>"));
+      markup =
+        g_strdup_printf("<span weight=\"bold\" size=\"large\">%s</span>",
+                        _("Strings added to database"));
+      gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), markup);
+      g_free(markup);
 
       g_signal_connect (dialog, "response",
                         G_CALLBACK (gtk_widget_destroy), NULL);
diff --git a/src/gtr-assistant.c b/src/gtr-assistant.c
index 0ffe296..679039a 100644
--- a/src/gtr-assistant.c
+++ b/src/gtr-assistant.c
@@ -230,6 +230,7 @@ create_profiles_page1 (GtrAssistant * as)
   GtkWidget *box, *hbox;
   GtkWidget *label;
   GtrAssistantPrivate *priv = as->priv;
+  gchar *markup;
 
   box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
   gtk_widget_show (box);
@@ -243,7 +244,9 @@ create_profiles_page1 (GtrAssistant * as)
   gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0);
 
   label = gtk_label_new (NULL);
-  gtk_label_set_markup (GTK_LABEL (label), _("<b>Profile name:</b>"));
+  markup = g_strdup_printf("<b>%s</b>", _("Profile name:"));
+  g_free(markup);
+  gtk_label_set_markup (GTK_LABEL (label), markup);
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_widget_show (label);
   gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
@@ -262,7 +265,9 @@ create_profiles_page1 (GtrAssistant * as)
   gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0);
 
   label = gtk_label_new (NULL);
-  gtk_label_set_markup (GTK_LABEL (label), _("<b>Translator name:</b>"));
+  markup = g_strdup_printf("<b>%s</b>", ("Translator name:"));
+  gtk_label_set_markup (GTK_LABEL (label), markup);
+  g_free(markup);
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_widget_show (label);
   gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
@@ -281,7 +286,9 @@ create_profiles_page1 (GtrAssistant * as)
   gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0);
 
   label = gtk_label_new (NULL);
-  gtk_label_set_markup (GTK_LABEL (label), _("<b>Translator email:</b>"));
+  markup = g_strdup_printf("<b>%s</b>", _("Translator email:"));
+  gtk_label_set_markup (GTK_LABEL (label), markup);
+  g_free(markup);
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_widget_show (label);
   gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
diff --git a/src/gtr-preferences-dialog.c b/src/gtr-preferences-dialog.c
index e08b93a..426125b 100644
--- a/src/gtr-preferences-dialog.c
+++ b/src/gtr-preferences-dialog.c
@@ -380,6 +380,7 @@ delete_button_clicked (GtkWidget *button, GtrPreferencesDialog *dlg)
   GtkTreeSelection *selection;
   gboolean active;
   GtkWidget *dialog;
+  gchar *markup;
 
   model = gtk_tree_view_get_model (GTK_TREE_VIEW (dlg->priv->profile_treeview));
   g_return_if_fail (model != NULL);
@@ -397,8 +398,10 @@ delete_button_clicked (GtkWidget *button, GtrPreferencesDialog *dlg)
                                            GTK_MESSAGE_ERROR,
                                            GTK_BUTTONS_CLOSE, NULL);
 
-          gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
-                                         _("<span weight=\"bold\" size=\"large\">Impossible to remove the 
active profile</span>"));
+          markup = g_strdup_printf("<span weight=\"bold\" size=\"large\">%s</span>",
+                                   _("Impossible to remove the active profile"));
+          gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), markup);
+          g_free(markup);
 
           gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG
                                                     (dialog),
@@ -414,8 +417,10 @@ delete_button_clicked (GtkWidget *button, GtrPreferencesDialog *dlg)
                                            GTK_MESSAGE_QUESTION,
                                            GTK_BUTTONS_NONE, NULL);
 
-          gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
-                                         _("<span weight=\"bold\" size=\"large\">Are you sure you want to 
delete this profile?</span>"));
+          markup = g_strdup_printf("<span weight=\"bold\" size=\"large\">%s</span>",
+                                   _("Are you sure you want to delete this profile?"));
+          gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), markup);
+          g_free(markup);
 
           gtk_dialog_add_button (GTK_DIALOG (dialog),
                                  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index 63f7bfe..211c7ff 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -705,6 +705,7 @@ gtr_tab_init (GtrTab * tab)
   GtkWidget *scroll;
   GtkWidget *dockbar;
   GtrTabPrivate *priv;
+  gchar *markup;
 
   tab->priv = GTR_TAB_GET_PRIVATE (tab);
   priv = tab->priv;
@@ -755,7 +756,9 @@ gtr_tab_init (GtrTab * tab)
   gtk_widget_show (priv->msgid_hbox);
 
   msgid_label = gtk_label_new (NULL);
-  gtk_label_set_markup (GTK_LABEL (msgid_label), _("<b>Original Message:</b>"));
+  markup = g_strdup_printf("<b>%s</b>", _("Original Message:"));
+  gtk_label_set_markup (GTK_LABEL (msgid_label), markup);
+  g_free(markup);
   gtk_misc_set_padding (GTK_MISC (msgid_label), 0, 5);
   gtk_widget_show (msgid_label);
 
@@ -807,8 +810,10 @@ gtr_tab_init (GtrTab * tab)
 
   /* Translation widgets */
   priv->msgstr_label = gtk_label_new (NULL);
+  markup = g_strdup_printf("<b>%s</b>", _("Translate_d Text:"));
   gtk_label_set_markup_with_mnemonic (GTK_LABEL (priv->msgstr_label),
-                                      _("<b>Translate_d Text:</b>"));
+                                      markup);
+  g_free(markup);
   gtk_misc_set_padding (GTK_MISC (priv->msgstr_label), 0, 5);
   gtk_misc_set_alignment (GTK_MISC (priv->msgstr_label), 0, 0.5);
   gtk_widget_show (priv->msgstr_label);


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