After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 162807 - Please don't include markup in yelp message
Please don't include markup in yelp message
Status: RESOLVED FIXED
Product: yelp
Classification: Applications
Component: General
2.13.x
Other All
: Low enhancement
: ---
Assigned To: Shaun McCance
Yelp maintainers
Depends on:
Blocks:
 
 
Reported: 2005-01-03 12:45 UTC by Christian Rose
Modified: 2006-01-07 22:38 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Proposed (untested) patch (1.17 KB, patch)
2006-01-07 11:12 UTC, Christian Neumair
committed Details | Review

Description Christian Rose 2005-01-03 12:45:51 UTC
#: src/yelp-bookmarks.c:248 src/yelp-bookmarks.c:319
#, c-format
msgid "A bookmark titled <b>%s</b> already exists for this page."

Please move the markup outside of the gettext call and into the %s; there's no
reason that translators should have to translate the markup.
Comment 1 Shaun McCance 2005-01-09 21:32:47 UTC
That would be really annoying to have to do.  gtk_message_dialog_new_with_markup
takes a format string and arguments, and it conveniently escapes brackets and
stuff in the arguments.  If I took the markup out of the string, I would have to
do take the title, escape the markup characters, put it in a format string like
"<b>%s</b>", put that in a translated format string, escape any extra %
characters, and pass that off to gtk_message_dialog_new_with_markup with no
extra arguments.  That's an incredible pain in the ass.

If we can't put markup in translatable strings, then
gtk_message_dialog_new_with_markup is effectively useless for any i18n-ized program.
Comment 2 Christian Rose 2005-01-10 23:03:54 UTC
CC:ing danilo and cneumair to get their opinions on this.
Comment 3 Kjartan Maraas 2005-01-11 16:59:20 UTC
I don't think having to translate stuff like <b>This is a label</b> is a
problem. The ones I have problems with are strings like <span size=\"larger\"
weight=\"bold\">This is a string</span> and more complicated stuff like this.
Comment 4 Brent Smith (smitten) 2006-01-07 02:33:04 UTC
I am closing this.  If someone feels strongly about this, please re-open.
Comment 5 Christian Rose 2006-01-07 10:37:16 UTC
I do. If the markup shouldn't be translated, it shouldn't be marked for translation.
Comment 6 Christian Neumair 2006-01-07 11:11:32 UTC
Confirming, updating version.
Comment 7 Christian Neumair 2006-01-07 11:12:59 UTC
Created attachment 56912 [details] [review]
Proposed (untested) patch

My toolchain is currently broken, so I can't test this patch.
Comment 8 Christian Persch 2006-01-07 14:58:54 UTC
Err that patch isn't equivalent to the current code, you put <b> around everything while we just want it on the bmk title. Maybe you could do what epiphany does in these cases and just quote (curly quotes) the bmk title instead of making it bold? I.e. just change the string to
("A bookmark titled “%s” already exists for this page") [no period!] and use gtk_message_dialog_new, not _with_markup.
Comment 9 Brent Smith (smitten) 2006-01-07 22:09:54 UTC
smitten chpe: I don't understand your response on 162807
chpe and the gnome web browser has no quit too :)
smitten I don't see how it's not equivalent
chpe hmm
chpe you're right I'm wrong 
chpe (I still like the quotes better though)
chpe (than bold)
smitten I like bold.
smitten shaunm: what's your opinion ? hehe
smitten "but if you have an existing Pango markup string that you want to use literally as the label, then you need to use gtk_message_dialog_set_markup() instead, since you can't pass the markup string either as the format (it might contain '%' characters) or as a string argument."
shaunm right
smitten so Manny's patch is right.
shaunm see, when I was looking at it before, I was thinking of constructing the string and passing it to new_with_markup
shaunm which, of course, presented exactly that problem
smitten yep
smitten i'll apply the patch, make sure it works, and commit
shaunm yeah, fine, commit it

Committed, string change announcement made to gnome-doc-list@gnome.org
Comment 10 Christian Rose 2006-01-07 22:38:53 UTC
Thanks everyone.