diff options
author | Milan Crha <mcrha@redhat.com> | 2010-04-23 17:20:50 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-04-23 17:20:50 +0800 |
commit | 91020b05a3107e4ae51d7aa33dc0bebe5b668e6d (patch) | |
tree | e3b2445f54a7d74e5ff00ebbd8ecfa70235ed016 /plugins | |
parent | edf6286a38279e6db82dee4da50e94c587f06e02 (diff) | |
download | gsoc2013-evolution-91020b05a3107e4ae51d7aa33dc0bebe5b668e6d.tar.gz gsoc2013-evolution-91020b05a3107e4ae51d7aa33dc0bebe5b668e6d.tar.zst gsoc2013-evolution-91020b05a3107e4ae51d7aa33dc0bebe5b668e6d.zip |
Bug #360461 - Avoid markup in translatable messages
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/caldav/caldav-browse-server.c | 7 | ||||
-rw-r--r-- | plugins/google-account-setup/google-contacts-source.c | 5 | ||||
-rw-r--r-- | plugins/groupwise-features/properties.ui | 5 | ||||
-rw-r--r-- | plugins/groupwise-features/proxy-login-dialog.ui | 5 | ||||
-rw-r--r-- | plugins/itip-formatter/itip-view.c | 108 | ||||
-rw-r--r-- | plugins/webdav-account-setup/webdav-contacts-source.c | 5 |
6 files changed, 84 insertions, 51 deletions
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 <b>%s</b> on server <b>%s</b>"), username, soup_auth_get_host (auth)); + bold_user = g_strconcat ("<b>", username, "</b>", NULL); + bold_host = g_strconcat ("<b>", soup_auth_get_host (auth), "</b>", 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), _("<b>Server</b>")); + buff = g_strconcat ("<b>", _("Server"), "</b>", 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 @@ <child> <object class="GtkLabel" id="users"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Users:</b></property> + <property name="label" translatable="yes">Users:</property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -177,6 +177,9 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> <packing> <property name="padding">6</property> 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 @@ <child type="label"> <object class="GtkLabel" id="label2"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Account Name</b></property> + <property name="label" translatable="yes">Account Name</property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -169,6 +169,9 @@ <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> 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 ("<b>%s</b>", 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 <b>%s</b>"), 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 <b>%s</b>"), 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 <b>%s</b>"), 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 <b>%s</b>"), 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 <b>%s</b>"), 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 <b>%s</b>"), 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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 (_("<b>%s</b> 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), _("<b>Server</b>")); + buff = g_strconcat ("<b>", _("Server"), "</b>", 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); |