remove most of the markup from translatable strings
authorPaul <paul@claws-mail.org>
Sat, 14 Nov 2015 11:44:17 +0000 (11:44 +0000)
committerPaul <paul@claws-mail.org>
Sat, 14 Nov 2015 11:44:17 +0000 (11:44 +0000)
src/gtk/gtkaspell.c
src/gtk/icon_legend.c
src/gtk/menu.c
src/plugins/libravatar/libravatar_prefs.c
src/plugins/pgpcore/passphrase.c
src/plugins/vcalendar/vcalendar.c
src/prefs_account.c
src/summaryview.c
src/wizard.c

index c88cab4..74001c1 100644 (file)
@@ -1456,8 +1456,8 @@ static void replace_with_create_dialog_cb(GtkWidget *w, gpointer data)
 
        utf8buf  = g_strdup(gtkaspell->theword);
 
-       thelabel = g_strdup_printf(_("<span weight=\"bold\" "
-                                       "size=\"larger\">Replace \"%s\" with: </span>"), 
+       thelabel = g_strdup_printf(g_strconcat("<span weight=\"bold\" size=\"larger\">",
+                                       _("Replace \"%s\" with: "), "</span>", NULL),
                                   utf8buf);
        
        icon = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION,
index b0676bc..abe1a39 100644 (file)
@@ -137,9 +137,9 @@ static void legend_create(void)
        gtk_widget_show(hbox);
        gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
-       label = gtk_label_new(_("<span weight=\"bold\">The following icons "
+       label = gtk_label_new(g_strconcat("<span weight=\"bold\">",_("The following icons "
                                "are used to show the status of messages and "
-                               "folders:</span>"));
+                               "folders:"), "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
        gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
        gtk_widget_show(label);
index 87abbad..438a56b 100644 (file)
@@ -134,9 +134,11 @@ GtkWidget *cm_menu_item_new_label_from_url(gchar *url)
                url[64] = '\0', url[63] = url[62] = url[61] = '.', url[60] = ' ';
                GtkWidget *newlabel = gtk_menu_item_new_with_label(url);
                gtk_widget_set_tooltip_markup(GTK_WIDGET(newlabel),
-                       _("<span><b>Warning:</b> This URL was too long for displaying and\n"
+                       g_strconcat("<span><b>", _("Warning:"), "</b>",
+                       _("This URL was too long for displaying and\n"
                        "has been truncated for safety. This message could be\n"
-                       "corrupted, malformed or part of some DoS attempt.</span>"));
+                       "corrupted, malformed or part of some DoS attempt."),
+                       "</span>", NULL));
                return newlabel;
        }
        
index 2fb31ac..bd1f7da 100644 (file)
@@ -133,13 +133,13 @@ static GtkWidget *labeled_spinner_box(gchar *label, GtkWidget *spinner, gchar *u
 static gchar *avatar_stats_label_markup(AvatarCacheStats *stats)
 {
        if (stats == NULL)
-               return g_strdup(
-                       _("<span color=\"red\">Error reading cache stats</span>"));
+               return g_strdup(g_strconcat("<span color=\"red\">",
+                       _("Error reading cache stats"), "</span>", NULL));
 
        if (stats->errors > 0)
-               return g_markup_printf_escaped(
-                       _("<span color=\"red\">Using %s in %d files, %d "
-                       "directories, %d others and %d errors</span>"),
+               return g_markup_printf_escaped(g_strconcat("<span color=\"red\">",
+                       _("Using %s in %d files, %d "
+                       "directories, %d others and %d errors"), "</span>", NULL),
                        to_human_readable((goffset) stats->bytes),
                        stats->files,
                        stats->dirs,
@@ -184,8 +184,8 @@ static void cache_clean_button_clicked_cb(GtkButton *button, gpointer data)
                        "• %u missing entries removed.\n"
                        "• %u files removed."),
                        misses, acr->removed);
-               gtk_label_set_markup(label,
-                       _("<span color=\"#006400\">Icon cache successfully cleared!</span>"));
+               gtk_label_set_markup(label, g_strconcat("<span color=\"#006400\">",
+                       _("Icon cache successfully cleared!"), "</span>", NULL));
        }
        else {
                alertpanel_warning(_("Errors clearing icon cache:\n"
@@ -194,8 +194,8 @@ static void cache_clean_button_clicked_cb(GtkButton *button, gpointer data)
                        "• %u files failed to be read.\n"
                        "• %u files couldn't be removed."),
                        misses, acr->removed, acr->e_stat, acr->e_unlink);
-               gtk_label_set_markup(label,
-                       _("<span color=\"red\">Error clearing icon cache.</span>"));
+               gtk_label_set_markup(label, g_strconcat("<span color=\"red\">",
+                       _("Error clearing icon cache."), "</span>", NULL));
        }
        gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
        g_free(acr);
index c4392dc..4bf4243 100644 (file)
@@ -257,18 +257,21 @@ create_description(const gchar *uid_hint, gint prev_bad, gint new_key)
        *(strchr(my_uid, '>')) = ')';
 
     if (new_key == 1) {
-           buf = g_strdup_printf (_("<span weight=\"bold\" size=\"larger\">%sPlease enter the passphrase for the new key:</span>\n\n"
-                           "%.*s\n"),
+           buf = g_strdup_printf (g_strconcat("<span weight=\"bold\" size=\"larger\">%s",
+                                       _("Please enter the passphrase for the new key:"),
+                                       "</span>\n\n%.*s\n", NULL),
                            prev_bad ?
                            _("Passphrases did not match.\n") : "",
                            linelen (my_uid), my_uid);
     } else if (new_key == 2) {
-           buf = g_strdup_printf (_("<span weight=\"bold\" size=\"larger\">Please re-enter the passphrase for the new key:</span>\n\n"
-                           "%.*s\n"),
+           buf = g_strdup_printf (g_strconcat("<span weight=\"bold\" size=\"larger\">",
+                               _("Please re-enter the passphrase for the new key:"),
+                               "</span>\n\n%.*s\n", NULL),
                            linelen (my_uid), my_uid);
     } else {
-           buf = g_strdup_printf (_("<span weight=\"bold\" size=\"larger\">%sPlease enter the passphrase for:</span>\n\n"
-                           "%.*s\n"),
+           buf = g_strdup_printf (g_strconcat("<span weight=\"bold\" size=\"larger\">%s",
+                               _("Please enter the passphrase for:"),
+                               "</span>\n\n%.*s\n", NULL),
                            prev_bad ?
                            _("Bad passphrase.\n") : "",
                            linelen (my_uid), my_uid);
index 94153b4..2a924e4 100644 (file)
@@ -561,13 +561,16 @@ void vcalviewer_display_event (VCalViewer *vcalviewer, VCalEvent *event)
 /* start */
        if (event->start && *(event->start)) {
                if (event->recur && *(event->recur)) {
-                       gchar *tmp = g_strdup_printf(_("%s <span weight=\"bold\">(this event recurs)</span>"),
+                       gchar *tmp = g_strdup_printf(g_strconcat("%s <span weight=\"bold\">",
+                                                       _("(this event recurs)"),"</span>", NULL),
                                        event->start);
                        GTK_LABEL_SET_TEXT_TRIMMED(GTK_LABEL(vcalviewer->start), tmp);
                        gtk_label_set_use_markup(GTK_LABEL(vcalviewer->start), TRUE);
                        g_free(tmp);
                } else if (event->rec_occurence) {
-                       gchar *tmp = g_strdup_printf(_("%s <span weight=\"bold\">(this event is part of a recurring event)</span>"),
+                       gchar *tmp = g_strdup_printf(g_strconcat("%s <span weight=\"bold\">",
+                                                       _("(this event is part of a recurring event)"),
+                                                       "</span>", NULL),
                                        event->start);
                        GTK_LABEL_SET_TEXT_TRIMMED(GTK_LABEL(vcalviewer->start), tmp);
                        gtk_label_set_use_markup(GTK_LABEL(vcalviewer->start), TRUE);
index b2d0d67..3fad6cc 100644 (file)
@@ -1143,8 +1143,9 @@ static void basic_create_widget_func(PrefsPage * _page,
 
        no_imap_warn_icon = gtk_image_new_from_stock
                         (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR);
-       no_imap_warn_label = gtk_label_new(_("<span weight=\"bold\">Warning: this version of Claws Mail\n"
-                         "has been built without IMAP and News support.</span>"));
+       no_imap_warn_label = gtk_label_new(g_strconcat("<span weight=\"bold\">",
+                       _("Warning: this version of Claws Mail\n"
+                         "has been built without IMAP and News support."), "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(no_imap_warn_label), TRUE);
 
        gtk_box_pack_start(GTK_BOX (optmenubox), no_imap_warn_icon, FALSE, FALSE, 0);
index 540a86f..1843801 100644 (file)
@@ -3417,14 +3417,18 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
                        _("(No Subject)");
        if ((vert_layout || small_layout) && prefs_common.two_line_vert) {
                if (!FOLDER_SHOWS_TO_HDR(summaryview->folder_item)) {
-                       gchar *tmp = g_markup_printf_escaped(_("%s\n<span color='%s' style='italic'>From: %s, on %s</span>"),
+                       gchar *tmp = g_markup_printf_escaped(g_strconcat("%s\n",
+                                                                       "<span color='%s' style='italic'>",
+                                                                       _("From: %s, on %s"), "</span>", NULL),
                                        text[col_pos[S_COL_SUBJECT]],
                                        color_dim_rgb,
                                        text[col_pos[S_COL_FROM]],
                                        text[col_pos[S_COL_DATE]]);
                        text[col_pos[S_COL_SUBJECT]] = tmp;
                } else {
-                       gchar *tmp = g_markup_printf_escaped(_("%s\n<span color='%s' style='italic'>To: %s, on %s</span>"),
+                       gchar *tmp = g_markup_printf_escaped(g_strconcat("%s\n",
+                                                                        "<span color='%s' style='italic'>",
+                                                                       _("To: %s, on %s"), "</span>", NULL),
                                        text[col_pos[S_COL_SUBJECT]],
                                        color_dim_rgb,
                                        text[col_pos[S_COL_TO]],
index b40d863..e2e9a91 100644 (file)
@@ -965,7 +965,8 @@ static GtkWidget* user_page (WizardWindow * wizard)
        gtk_table_set_row_spacings(GTK_TABLE(user_table), VSPACING_NARROW);
        gtk_box_pack_start(GTK_BOX(vbox), user_table, FALSE, FALSE, 0);
 
-       label = gtk_label_new(_("<span weight=\"bold\">Your name:</span>"));
+       label = gtk_label_new(g_strconcat("<span weight=\"bold\">", _("Your name:"),
+                                         "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
        gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
        gtk_table_attach(GTK_TABLE(user_table), label, 0,1,0,1, 
@@ -975,7 +976,8 @@ static GtkWidget* user_page (WizardWindow * wizard)
        gtk_table_attach(GTK_TABLE(user_table), wizard->full_name, 1,2,0,1, 
                         GTK_EXPAND|GTK_FILL, 0, 0, 0);
 
-       label = gtk_label_new(_("<span weight=\"bold\">Your email address:</span>"));
+       label = gtk_label_new(g_strconcat("<span weight=\"bold\">", _("Your email address:"),
+                                         "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
        gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
        gtk_table_attach(GTK_TABLE(user_table), label, 0,1,1,2, 
@@ -1018,7 +1020,8 @@ static GtkWidget* mailbox_page (WizardWindow * wizard)
        hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
-       wizard->mailbox_label = gtk_label_new(_("<span weight=\"bold\">Mailbox name:</span>"));
+       wizard->mailbox_label = gtk_label_new(g_strconcat("<span weight=\"bold\">",
+                                                         _("Mailbox name:"), "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(wizard->mailbox_label), TRUE);
        if (GTK_IS_MISC(wizard->mailbox_label))                                               
                gtk_misc_set_alignment(GTK_MISC(wizard->mailbox_label), 1, 0.5);              
@@ -1100,8 +1103,8 @@ static GtkWidget* smtp_page (WizardWindow * wizard)
                             _("You can specify the port number by appending it at the end: "
                               "\"mail.example.com:25\""));
 
-       PACK_BOX(hbox, _("<span weight=\"bold\">SMTP server address:</span>"),
-                wizard->smtp_server);
+       PACK_BOX(hbox, g_strconcat("<span weight=\"bold\">", _("SMTP server address:"),
+                                  "</span>", NULL), wizard->smtp_server);
 
        hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
@@ -1114,7 +1117,8 @@ static GtkWidget* smtp_page (WizardWindow * wizard)
                         wizard);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_auth, FALSE, FALSE, 0);
 
-       label = gtk_label_new(_("<span size=\"small\">(empty to use the same as receive)</span>"));
+       label = gtk_label_new(g_strconcat("<span size=\"small\">",
+                                         _("(empty to use the same as receive)"), "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
        SET_TOGGLE_SENSITIVITY (wizard->smtp_auth, label);      
        gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 0);
@@ -1242,7 +1246,9 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_hide(wizard->auto_configure_cancel_btn);
                gtk_widget_show(wizard->auto_configure_lbl);
 #endif
-               gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Server address:</span>"));
+               gtk_label_set_text(GTK_LABEL(wizard->recv_label),
+                                  g_strconcat("<span weight=\"bold\">", _("Server address:"),
+                                               "</span>", NULL));
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
                g_free(text);
@@ -1272,7 +1278,9 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_hide(wizard->auto_configure_cancel_btn);
                gtk_widget_show(wizard->auto_configure_lbl);
 #endif
-               gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Server address:</span>"));
+               gtk_label_set_text(GTK_LABEL(wizard->recv_label),
+                                  g_strconcat("<span weight=\"bold\">", _("Server address:"),
+                                               "</span>", NULL));
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
                g_free(text);
@@ -1302,7 +1310,9 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
 #endif
        } else if (protocol == A_LOCAL) {
                gtk_entry_set_text(GTK_ENTRY(wizard->recv_server), tmpl.mboxfile?tmpl.mboxfile:"");
-               gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Local mailbox:</span>"));
+               gtk_label_set_text(GTK_LABEL(wizard->recv_label), 
+                                  g_strconcat("<span weight=\"bold\">", _("Local mailbox:"),
+                                              "</span>", NULL));
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_widget_hide(wizard->no_imap_warning);
                gtk_widget_hide(wizard->recv_imap_label);
@@ -1470,7 +1480,7 @@ static GtkWidget* recv_page (WizardWindow * wizard)
 
        gtk_box_pack_start(GTK_BOX(vbox), recv_table, FALSE, FALSE, 0);
 
-       label = gtk_label_new(_("<span weight=\"bold\">Server type:</span>"));
+       label = gtk_label_new(g_strconcat("<span weight=\"bold\">", _("Server type:"), "</span>", NULL));
        gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
        gtk_table_attach(GTK_TABLE(recv_table), label, 0,1,0,1, 
@@ -1523,7 +1533,8 @@ static GtkWidget* recv_page (WizardWindow * wizard)
                          G_CALLBACK (auto_configure_cb), wizard);
 #endif
 
-       wizard->recv_label = gtk_label_new(_("<span weight=\"bold\">Server address:</span>"));
+       wizard->recv_label = gtk_label_new(g_strconcat("<span weight=\"bold\">",
+                                               _("Server address:"), "</span>", NULL));
        gtk_misc_set_alignment(GTK_MISC(wizard->recv_label), 1, 0.5);
        gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
        gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_label, 0,1,2,3,
@@ -1539,7 +1550,8 @@ static GtkWidget* recv_page (WizardWindow * wizard)
        gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_server, 1,2,2,3,
                         GTK_EXPAND|GTK_FILL, 0, 0, 0);
        
-       wizard->recv_username_label = gtk_label_new(_("<span weight=\"bold\">Username:</span>"));
+       wizard->recv_username_label = gtk_label_new(g_strconcat("<span weight=\"bold\">",
+                                                               _("Username:"),"</span>", NULL));
        gtk_misc_set_alignment(GTK_MISC(wizard->recv_username_label), 1, 0.5);
        gtk_label_set_use_markup(GTK_LABEL(wizard->recv_username_label), TRUE);
        gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_username_label, 0,1,3,4,
@@ -1647,9 +1659,9 @@ static GtkWidget* recv_page (WizardWindow * wizard)
        
        hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-       wizard->no_imap_warning = gtk_label_new(_(
-                         "<span weight=\"bold\">Warning: this version of Claws Mail\n"
-                         "has been built without IMAP support.</span>"));
+       wizard->no_imap_warning = gtk_label_new(g_strconcat("<span weight=\"bold\">",
+                       _("Warning: this version of Claws Mail\n"
+                         "has been built without IMAP support."), "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(wizard->no_imap_warning), TRUE);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->no_imap_warning, FALSE, FALSE, 0);