From 91020b05a3107e4ae51d7aa33dc0bebe5b668e6d Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 23 Apr 2010 11:20:50 +0200 Subject: Bug #360461 - Avoid markup in translatable messages --- plugins/caldav/caldav-browse-server.c | 7 +- .../google-account-setup/google-contacts-source.c | 5 +- plugins/groupwise-features/properties.ui | 5 +- plugins/groupwise-features/proxy-login-dialog.ui | 5 +- plugins/itip-formatter/itip-view.c | 108 ++++++++++++--------- .../webdav-account-setup/webdav-contacts-source.c | 5 +- 6 files changed, 84 insertions(+), 51 deletions(-) (limited to 'plugins') diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c index c1edc21639..8b2d1ae0e4 100644 --- a/plugins/caldav/caldav-browse-server.c +++ b/plugins/caldav/caldav-browse-server.c @@ -788,6 +788,7 @@ soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gbool if (!password || !*password || retrying) { gchar *pass, *prompt, *add = NULL; + gchar *bold_user, *bold_host; if (retrying && msg && msg->reason_phrase) { add = g_strdup_printf (_("Previous attempt failed: %s"), msg->reason_phrase); @@ -795,7 +796,11 @@ soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gbool add = g_strdup_printf (_("Previous attempt failed with code %d"), msg->status_code); } - prompt = g_strdup_printf (_("Enter password for user %s on server %s"), username, soup_auth_get_host (auth)); + bold_user = g_strconcat ("", username, "", NULL); + bold_host = g_strconcat ("", soup_auth_get_host (auth), "", NULL); + prompt = g_strdup_printf (_("Enter password for user %s on server %s"), bold_user, bold_host); + g_free (bold_user); + g_free (bold_host); if (add) { gchar *tmp; diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c index d7554ebe10..289a939dec 100644 --- a/plugins/google-account-setup/google-contacts-source.c +++ b/plugins/google-account-setup/google-contacts-source.c @@ -231,6 +231,7 @@ plugin_google_contacts (EPlugin *epl, const gchar *refresh_interval_str; guint refresh_interval; const gchar *use_ssl_str; + gchar *buff; gboolean use_ssl; GtkWidget *parent; GtkWidget *vbox; @@ -270,7 +271,9 @@ plugin_google_contacts (EPlugin *epl, gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0); section = gtk_label_new (NULL); - gtk_label_set_markup (GTK_LABEL (section), _("Server")); + buff = g_strconcat ("", _("Server"), "", NULL); + gtk_label_set_markup (GTK_LABEL (section), buff); + g_free (buff); gtk_misc_set_alignment (GTK_MISC (section), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox2), section, FALSE, FALSE, 0); diff --git a/plugins/groupwise-features/properties.ui b/plugins/groupwise-features/properties.ui index ca39309ff4..941c9a5ae8 100644 --- a/plugins/groupwise-features/properties.ui +++ b/plugins/groupwise-features/properties.ui @@ -167,7 +167,7 @@ True - <b>Users:</b> + Users: False True GTK_JUSTIFY_LEFT @@ -177,6 +177,9 @@ 0.5 0 0 + + + 6 diff --git a/plugins/groupwise-features/proxy-login-dialog.ui b/plugins/groupwise-features/proxy-login-dialog.ui index a18acf988d..a8c33317ca 100644 --- a/plugins/groupwise-features/proxy-login-dialog.ui +++ b/plugins/groupwise-features/proxy-login-dialog.ui @@ -155,7 +155,7 @@ True - <b>Account Name</b> + Account Name False True GTK_JUSTIFY_LEFT @@ -169,6 +169,9 @@ -1 False 0 + + + diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index f3d072e922..6ade3cabe3 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -333,6 +333,22 @@ format_date_and_time_x (struct tm *date_tm, buffer[0] = '\0'; } +static gchar * +dupe_first_bold (const gchar *format, const gchar *first, const gchar *second) +{ + gchar *f, *s, *res; + + f = g_markup_printf_escaped ("%s", first ? first : ""); + s = g_markup_escape_text (second ? second : "", -1); + + res = g_strdup_printf (format, f, s); + + g_free (f); + g_free (s); + + return res; +} + static void set_calendar_sender_text (ItipView *view) { @@ -348,64 +364,64 @@ set_calendar_sender_text (ItipView *view) /* The current account ID (i.e. the delegatee) is receiving a copy of the request/response. Here we ask the delegatee to respond/accept on behalf of the delegator. */ if (priv->organizer && priv->proxy) - on_behalf_of = g_markup_printf_escaped (_("Please respond on behalf of %s"), priv->proxy); + on_behalf_of = dupe_first_bold (_("Please respond on behalf of %s"), priv->proxy, NULL); else if (priv->attendee && priv->proxy) - on_behalf_of = g_markup_printf_escaped (_("Received on behalf of %s"), priv->proxy); + on_behalf_of = dupe_first_bold (_("Received on behalf of %s"), priv->proxy, NULL); switch (priv->mode) { case ITIP_VIEW_MODE_PUBLISH: if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s has published the following meeting information:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s has published the following meeting information:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s has published the following meeting information:"), organizer); + sender = dupe_first_bold (_("%s has published the following meeting information:"), organizer, NULL); break; case ITIP_VIEW_MODE_REQUEST: /* FIXME is the delegator stuff handled correctly here? */ if (priv->delegator) { - sender = g_markup_printf_escaped (_("%s has delegated the following meeting to you:"), priv->delegator); + sender = dupe_first_bold (_("%s has delegated the following meeting to you:"), priv->delegator, NULL); } else { if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s requests your presence at the following meeting:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s requests your presence at the following meeting:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s requests your presence at the following meeting:"), organizer); + sender = dupe_first_bold (_("%s requests your presence at the following meeting:"), organizer, NULL); } break; case ITIP_VIEW_MODE_ADD: /* FIXME What text for this? */ if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s wishes to add to an existing meeting:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s wishes to add to an existing meeting:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s wishes to add to an existing meeting:"), organizer); + sender = dupe_first_bold (_("%s wishes to add to an existing meeting:"), organizer, NULL); break; case ITIP_VIEW_MODE_REFRESH: if (priv->attendee_sentby) - sender = g_markup_printf_escaped (_("%s through %s wishes to receive the latest information for the following meeting:"), attendee, priv->attendee_sentby); + sender = dupe_first_bold (_("%s through %s wishes to receive the latest information for the following meeting:"), attendee, priv->attendee_sentby); else - sender = g_markup_printf_escaped (_("%s wishes to receive the latest information for the following meeting:"), attendee); + sender = dupe_first_bold (_("%s wishes to receive the latest information for the following meeting:"), attendee, NULL); break; case ITIP_VIEW_MODE_REPLY: if (priv->attendee_sentby) - sender = g_markup_printf_escaped (_("%s through %s has sent back the following meeting response:"), attendee, priv->attendee_sentby); + sender = dupe_first_bold (_("%s through %s has sent back the following meeting response:"), attendee, priv->attendee_sentby); else - sender = g_markup_printf_escaped (_("%s has sent back the following meeting response:"), attendee); + sender = dupe_first_bold (_("%s has sent back the following meeting response:"), attendee, NULL); break; case ITIP_VIEW_MODE_CANCEL: if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s has canceled the following meeting:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s has canceled the following meeting:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s has canceled the following meeting."), organizer); + sender = dupe_first_bold (_("%s has canceled the following meeting."), organizer, NULL); break; case ITIP_VIEW_MODE_COUNTER: if (priv->attendee_sentby) - sender = g_markup_printf_escaped (_("%s through %s has proposed the following meeting changes."), attendee, priv->attendee_sentby); + sender = dupe_first_bold (_("%s through %s has proposed the following meeting changes."), attendee, priv->attendee_sentby); else - sender = g_markup_printf_escaped (_("%s has proposed the following meeting changes."), attendee); + sender = dupe_first_bold (_("%s has proposed the following meeting changes."), attendee, NULL); break; case ITIP_VIEW_MODE_DECLINECOUNTER: if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s has declined the following meeting changes:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s has declined the following meeting changes:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s has declined the following meeting changes."), organizer); + sender = dupe_first_bold (_("%s has declined the following meeting changes."), organizer, NULL); break; default: break; @@ -436,64 +452,64 @@ set_tasklist_sender_text (ItipView *view) /* The current account ID (i.e. the delegatee) is receiving a copy of the request/response. Here we ask the delegatee to respond/accept on behalf of the delegator. */ if (priv->organizer && priv->proxy) - on_behalf_of = g_markup_printf_escaped (_("Please respond on behalf of %s"), priv->proxy); + on_behalf_of = dupe_first_bold (_("Please respond on behalf of %s"), priv->proxy, NULL); else if (priv->attendee && priv->proxy) - on_behalf_of = g_markup_printf_escaped (_("Received on behalf of %s"), priv->proxy); + on_behalf_of = dupe_first_bold (_("Received on behalf of %s"), priv->proxy, NULL); switch (priv->mode) { case ITIP_VIEW_MODE_PUBLISH: if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s has published the following task:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s has published the following task:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s has published the following task:"), organizer); + sender = dupe_first_bold (_("%s has published the following task:"), organizer, NULL); break; case ITIP_VIEW_MODE_REQUEST: /* FIXME is the delegator stuff handled correctly here? */ if (priv->delegator) { - sender = g_markup_printf_escaped (_("%s requests the assignment of %s to the following task:"), organizer, priv->delegator); + sender = dupe_first_bold (_("%s requests the assignment of %s to the following task:"), organizer, priv->delegator); } else { if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s has assigned you a task:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s has assigned you a task:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s has assigned you a task:"), organizer); + sender = dupe_first_bold (_("%s has assigned you a task:"), organizer, NULL); } break; case ITIP_VIEW_MODE_ADD: /* FIXME What text for this? */ if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s wishes to add to an existing task:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s wishes to add to an existing task:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s wishes to add to an existing task:"), organizer); + sender = dupe_first_bold (_("%s wishes to add to an existing task:"), organizer, NULL); break; case ITIP_VIEW_MODE_REFRESH: if (priv->attendee_sentby) - sender = g_markup_printf_escaped (_("%s through %s wishes to receive the latest information for the following assigned task:"), attendee, priv->attendee_sentby); + sender = dupe_first_bold (_("%s through %s wishes to receive the latest information for the following assigned task:"), attendee, priv->attendee_sentby); else - sender = g_markup_printf_escaped (_("%s wishes to receive the latest information for the following assigned task:"), attendee); + sender = dupe_first_bold (_("%s wishes to receive the latest information for the following assigned task:"), attendee, NULL); break; case ITIP_VIEW_MODE_REPLY: if (priv->attendee_sentby) - sender = g_markup_printf_escaped (_("%s through %s has sent back the following assigned task response:"), attendee, priv->attendee_sentby); + sender = dupe_first_bold (_("%s through %s has sent back the following assigned task response:"), attendee, priv->attendee_sentby); else - sender = g_markup_printf_escaped (_("%s has sent back the following assigned task response:"), attendee); + sender = dupe_first_bold (_("%s has sent back the following assigned task response:"), attendee, NULL); break; case ITIP_VIEW_MODE_CANCEL: if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s has canceled the following assigned task:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s has canceled the following assigned task:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s has canceled the following assigned task:"), organizer); + sender = dupe_first_bold (_("%s has canceled the following assigned task:"), organizer, NULL); break; case ITIP_VIEW_MODE_COUNTER: if (priv->attendee_sentby) - sender = g_markup_printf_escaped (_("%s through %s has proposed the following task assignment changes:"), attendee, priv->attendee_sentby); + sender = dupe_first_bold (_("%s through %s has proposed the following task assignment changes:"), attendee, priv->attendee_sentby); else - sender = g_markup_printf_escaped (_("%s has proposed the following task assignment changes:"), attendee); + sender = dupe_first_bold (_("%s has proposed the following task assignment changes:"), attendee, NULL); break; case ITIP_VIEW_MODE_DECLINECOUNTER: if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s has declined the following assigned task:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s has declined the following assigned task:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s has declined the following assigned task:"), organizer); + sender = dupe_first_bold (_("%s has declined the following assigned task:"), organizer, NULL); break; default: break; @@ -523,29 +539,29 @@ set_journal_sender_text (ItipView *view) /* The current account ID (i.e. the delegatee) is receiving a copy of the request/response. Here we ask the delegatee to respond/accept on behalf of the delegator. */ if (priv->organizer && priv->proxy) - on_behalf_of = g_markup_printf_escaped (_("Please respond on behalf of %s"), priv->proxy); + on_behalf_of = dupe_first_bold (_("Please respond on behalf of %s"), priv->proxy, NULL); else if (priv->attendee && priv->proxy) - on_behalf_of = g_markup_printf_escaped (_("Received on behalf of %s"), priv->proxy); + on_behalf_of = dupe_first_bold (_("Received on behalf of %s"), priv->proxy, NULL); switch (priv->mode) { case ITIP_VIEW_MODE_PUBLISH: if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s has published the following memo:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s has published the following memo:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s has published the following memo:"), organizer); + sender = dupe_first_bold (_("%s has published the following memo:"), organizer, NULL); break; case ITIP_VIEW_MODE_ADD: /* FIXME What text for this? */ if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s wishes to add to an existing memo:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s wishes to add to an existing memo:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s wishes to add to an existing memo:"), organizer); + sender = dupe_first_bold (_("%s wishes to add to an existing memo:"), organizer, NULL); break; case ITIP_VIEW_MODE_CANCEL: if (priv->organizer_sentby) - sender = g_markup_printf_escaped (_("%s through %s has canceled the following shared memo:"), organizer, priv->organizer_sentby); + sender = dupe_first_bold (_("%s through %s has canceled the following shared memo:"), organizer, priv->organizer_sentby); else - sender = g_markup_printf_escaped (_("%s has canceled the following shared memo:"), organizer); + sender = dupe_first_bold (_("%s has canceled the following shared memo:"), organizer, NULL); break; default: break; diff --git a/plugins/webdav-account-setup/webdav-contacts-source.c b/plugins/webdav-account-setup/webdav-contacts-source.c index 9f35d0bd54..8d822e6c9e 100644 --- a/plugins/webdav-account-setup/webdav-contacts-source.c +++ b/plugins/webdav-account-setup/webdav-contacts-source.c @@ -212,6 +212,7 @@ plugin_webdav_contacts(EPlugin *epl, EConfigHookItemFactoryData *data) GtkWidget *label; ui_data *uidata; + gchar *buff; source = t->source; @@ -232,7 +233,9 @@ plugin_webdav_contacts(EPlugin *epl, EConfigHookItemFactoryData *data) gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); section = gtk_label_new(NULL); - gtk_label_set_markup(GTK_LABEL(section), _("Server")); + buff = g_strconcat ("", _("Server"), "", NULL); + gtk_label_set_markup(GTK_LABEL(section), buff); + g_free (buff); gtk_misc_set_alignment(GTK_MISC(section), 0.0, 0.0); gtk_box_pack_start(GTK_BOX(vbox2), section, FALSE, FALSE, 0); -- cgit