GNOME Bugzilla – Bug 360461
Avoid markup in translatable messages
Last modified: 2010-04-23 09:21:35 UTC
As translators often say, please don't include markup in translateable messages. Move the markup outside of the gettext call. See http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#avoid-markup Affected messages (other than those from glade, since bug 97061 has to be fixed first to handle those): ./evolution/calendar/gui/e-itip-control.c: const_html = _("<br> Please review the following information, " ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has published meeting information."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> requests the presence of %s at a meeting."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> requests your presence at a meeting."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> wishes to add to an existing meeting."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> wishes to receive the latest meeting information."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has replied to a meeting request."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has canceled a meeting."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has sent an unintelligible message."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has published task information."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> requests %s to perform a task."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> requests you perform a task."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> wishes to add to an existing task."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> wishes to receive the latest task information."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has replied to a task assignment."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has canceled a task."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has sent an unintelligible message."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has published free/busy information."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> requests your free/busy information."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has replied to a free/busy request."); ./evolution/calendar/gui/e-itip-control.c: itip_desc = _("<b>%s</b> has sent an unintelligible message."); ./evolution/composer/e-msg-composer.c: set_editor_text (composer, _("<b>(The composer contains a non-text message body, which cannot be edited.)</b>"), -1, FALSE, FALSE); ./evolution/mail/em-filter-rule.c: label = gtk_label_new(_("<b>Then</b>")); ./evolution/mail/em-format-html.c: e_utf8_strftime(buf, sizeof(buf), _("<I> (%a, %R %Z)</I>"), &local); ./evolution/mail/em-format-html.c: e_utf8_strftime(buf, sizeof(buf), _("<I> (%R %Z)</I>"), &local); ./evolution/plugins/groupwise-features/junk-mail-settings.c: gtk_label_set_markup (GTK_LABEL (w), _("<b>Junk Mail Settings</b>")); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s has published the following meeting information:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has published the following meeting information:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has delegated the following meeting to you:"), priv->delegator); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s requests your presence at the following meeting:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> requests your presence at the following meeting:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s wishes to add to an existing meeting:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> wishes to add to an existing meeting:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> wishes to receive the latest information for the following meeting:"), attendee); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has sent back the following meeting response:"), attendee); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s has canceled the following meeting:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has canceled the following meeting."), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has proposed the following meeting changes."), attendee); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s has declined the following meeting changes:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has declined the following meeting changes."), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s has published the following task:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has published the following task:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> requests the assignment of %s to the following task:"), organizer, priv->delegator); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s has assigned you a task:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has assigned you a task:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s wishes to add to an existing task:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> wishes to add to an existing task:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> wishes to receive the latest information for the following assigned task:"), attendee); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has sent back the following assigned task response:"), attendee); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s has canceled the following assigned task:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has canceled the following assigned task:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has proposed the following task assignment changes:"), attendee); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s has declined the following assigned task:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has declined the following assigned task:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s has published the following memo:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has published the following memo:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s wishes to add to an existing memo:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> wishes to add to an existing memo:"), organizer); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> through %s has canceled the following shared memo:"), organizer, priv->sentby); ./evolution/plugins/itip-formatter/itip-view.c: sender = g_strdup_printf (_("<b>%s</b> has canceled the following shared memo:"), organizer);
Created attachment 78835 [details] [review] patch for the markup for the translations
Comment on attachment 78835 [details] [review] patch for the markup for the translations Here is the patch for the markup. I checked if it has no more errors. It's my third patch so any suggestions are welcome.
Hi " has declined the following meeting changes.", etc., are not complete sentences. Tricky.
Gaëtan Podevijn , I think your patch leaks memory. Can you rework and submit back?
Created attachment 92149 [details] [review] Simple patch for mail/em-filter-rule.c I'll start creating per-file patches. Here are the first ones, let's see if they are ok.
Created attachment 92150 [details] [review] Simple patch for em-folder-view.c
Created attachment 92151 [details] [review] Patch for em-format-html.c
Created attachment 92152 [details] [review] Patch for composer/e-msg-composer.c
Created attachment 92153 [details] [review] Patch for plugins/ipod-sync/evolution-ipod-sync.c
Created attachment 92154 [details] [review] Patch for plugins/groupwise-features/junk-mail-settings.c
Created attachment 92155 [details] [review] Patch for plugins/groupwise-features/status-track.c
Created attachment 92240 [details] [review] Updated patch Updated patch to make it actually compile
Created attachment 92241 [details] [review] Patch for plugins/itip-formatter/itip-view.c
Created attachment 92242 [details] [review] Patch for plugins/itip-formatter/itip-view.c
Created attachment 92243 [details] [review] Patch for calendar/gui/e-itip-control.c
Created attachment 92244 [details] [review] Patch for calendar/dialogs/comp-editor.c
Created attachment 92245 [details] [review] Updated patch for composer/e-msg-composer.c One more markup string less. This is the last patch, no more markup should be left in c files.
Rejecting a duplicated patch, sorry for the spam.
gabor, most of the patches look fine. I will test it again and commit it. The last two patches need rework. I dont think it prints the num_attachments at all.
Thanks for the review. I see now that the plural forms patches are bad, but I have no idea how could be the messages translated properly, keeping the plurals and eliminating the markup. Until somebody comes up with a solution, could you review please the obsolete-marked e-msg-composer patch: http://bugzilla.gnome.org/attachment.cgi?id=92152 it's the same as the last one, without the bad plural fix.
That part looks fine.
Simple. Don't eliminate the markup. Can we close this bug now? *ducks*
In all seriousness, how are we supposed to do this reliably if, for some language, the markup in the string actually needs to be moved in the sentence? For example, highlighting verbs. It seems to me that translaters are simply gonna have to learn a little bit of Pango markup here and there to keep this sane.
I marked http://bugzilla.gnome.org/attachment.cgi?id=92241 as needs-work because it would be safer to test on values of priv->proxy, priv->delegator and so on, if not NULL, as is done before the usage now. Also you could create and use bolddelegator only when it is needed, in proper case. In the last definition of boldname you forget to g_free it. And also http://bugzilla.gnome.org/attachment.cgi?id=92243 is marked as needs-work: "FIXME: this is ugly" something like "%%s" didn't work? Maybe with a comment for translators what it means. All others marked committed are in trunk. Committed revision 33894.
Gabor, are you going to attach updated patches for 2.23.x, please? It will be nice to have this done. Thanks.
Created attachment 159399 [details] [review] evo patch for evolution; Evo is clean now. Let's see for how long.
Created commit 91020b0 in evo master (2.31.1+)