Make WordPress Core

Opened 16 years ago

Closed 10 years ago

Last modified 8 years ago

#10005 closed enhancement (duplicate)

Some strings need "no HTML entities" translator comments

Reported by: xibe's profile xibe Owned by: nbachiyski's profile nbachiyski
Milestone: Priority: normal
Severity: minor Version: 2.7.1
Component: I18N Keywords:
Focuses: Cc:

Description

I've been putting a specific set of custom comments in my PO for some time now, and since WP is now able to handle translator comments very graciously, I think it would be nice to switch them over there.

The following strings need to have an indication warning translators against the inclusion of HTML entities within their translation, because of where the strings are user (RSS feeds, e-mail...). For instance, "Protected Comments: " should be translated to "Commentaires protégés : ", but since it is used in feeds, it breaks them...

Suggestions comment: "Do not add HTML entities ( , etc): used in [context]".

Here they are (sorry, raw list out of my PO file).

Used in feeds:

  • "Comments on: %s", wp-includes/feed-atom-comments.php:19 and wp-includes/feed-rss2-comments.php:22
  • "By: %s", wp-includes/feed-atom-comments.php:56 and wp-includes/feed-rss2-comments.php:48
  • "Protected Comments: Please enter your password to view comments.", wp-includes/feed-rss2-comments.php:56

Used in e-mail:

  • "Your new WordPress blog has been successfully set up at: ...", wp-admin/includes/upgrade.php:229
  • "New comment on your post #%1$s \"%2$s\"", wp-includes/pluggable.php:968
  • "Author : %1$s (IP: %2$s , %3$s)", wp-includes/pluggable.php:970 and wp-includes/pluggable.php:1072
  • "E-mail : %s", wp-includes/pluggable.php:971 and wp-includes/pluggable.php:1073
  • "URL : %s", wp-includes/pluggable.php:972, wp-includes/pluggable.php:983, wp-includes/pluggable.php:993, wp-includes/pluggable.php:1059, wp-includes/pluggable.php:1066 and wp-includes/pluggable.php:1074
  • "Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s" and wp-includes/pluggable.php:973 and wp-includes/pluggable.php:1075
  • "Comment: ", wp-includes/pluggable.php:974 and wp-includes/pluggable.php:1076
  • "You can see all comments on this post here: ", wp-includes/pluggable.php:975
  • "[%1$s] Comment: \"%2$s\"", wp-includes/pluggable.php:977
  • "New trackback on your post #%1$s \"%2$s\"", wp-includes/pluggable.php:980
  • "Website: %1$s (IP: %2$s , %3$s)", wp-includes/pluggable.php:982 and wp-includes/pluggable.php:992
  • "Excerpt: ", wp-includes/pluggable.php:984 and wp-includes/pluggable.php:994
  • "You can see all trackbacks on this post here: ", wp-includes/pluggable.php:985
  • "[%1$s] Trackback: \"%2$s\"", wp-includes/pluggable.php:987
  • "New pingback on your post #%1$s \"%2$s\"", wp-includes/pluggable.php:990
  • "You can see all pingbacks on this post here: ", wp-includes/pluggable.php:995
  • "[%1$s] Pingback: \"%2$s\"", wp-includes/pluggable.php:997
  • "Delete it: %s", wp-includes/pluggable.php:1000 and wp-includes/pluggable.php:1081
  • "Spam it: %s", wp-includes/pluggable.php:1001 and wp-includes/pluggable.php:1082
  • "A new trackback on the post #%1$s \"%2$s\" is waiting for your approval", wp-includes/pluggable.php:1056
  • "Website : %1$s (IP: %2$s , %3$s)", wp-includes/pluggable.php:1058 and wp-includes/pluggable.php:1065
  • "Trackback excerpt: ", wp-includes/pluggable.php:1060
  • "A new pingback on the post #%1$s \"%2$s\" is waiting for your approval", wp-includes/pluggable.php:1063
  • "Pingback excerpt: ", wp-includes/pluggable.php:1067
  • "A new comment on the post #%1$s \"%2$s\" is waiting for your approval", wp-includes/pluggable.php:1070
  • "Approve it: %s", wp-includes/pluggable.php:1080
  • "Currently %s comment is waiting for approval. Please visit the moderation panel:", wp-includes/pluggable.php:1084
  • "[%1$s] Please moderate: \"%2$s\"", wp-includes/pluggable.php:1088
  • "Password Lost and Changed for user: %s", wp-includes/pluggable.php:1114
  • "[%s] Password Lost/Changed", wp-includes/pluggable.php:1115
  • "New user registration on your blog %s:", wp-includes/pluggable.php:1135
  • "Username: %s", wp-includes/pluggable.php:1136, wp-includes/pluggable.php:1144
  • "E-mail: %s", wp-includes/pluggable.php:1137
  • "[%s] New User Registration", wp-includes/pluggable.php:1139
  • "Password: %s", wp-includes/pluggable.php:1145
  • "[%s] Your username and password", wp-includes/pluggable.php:1148

Used in visual editor (entities break it):

  • "Edit Image", wp-includes/js/tinymce/langs/wp-langs.php:421
  • "Delete Image", wp-includes/js/tinymce/langs/wp-langs.php:422

Used in an alert() message:

  • "Enter a word to look up:", wp-includes/script-loader.php:76

Obviously these were marked for my locale's need, I think all the strings pertaining to these context should be properly commented about this.

Hopefully it is not too late (and is quick enough) for inclusion with 2.8.

Attachments (4)

entities-in-feeds.diff (3.5 KB) - added by xibe 16 years ago.
Translator comments; warning about use of HTML entities in feeds
entities-in-visualEditor.diff (784 bytes) - added by xibe 16 years ago.
Translator comments; warning about use of HTML entities in Visual Editor
entities-in-jsAlert.diff (749 bytes) - added by xibe 16 years ago.
Translator comments; warning about use of HTML entities in JS alert() message
translators-entities-warning.diff (18.4 KB) - added by xibe 16 years ago.
Patch for all related files.

Download all attachments as: .zip

Change History (24)

#1 @Denis-de-Bernardy
16 years ago

  • Keywords needs-patch added

Hopefully it is not too late (and is quick enough) for inclusion with 2.8.

This kind of stuff usually depends on whether a patch is around on the spot...

#2 @Denis-de-Bernardy
16 years ago

  • Milestone changed from 2.8 to 2.9

Punting per discussion during the WP meet-up...

@xibe
16 years ago

Translator comments; warning about use of HTML entities in feeds

@xibe
16 years ago

Translator comments; warning about use of HTML entities in Visual Editor

@xibe
16 years ago

Translator comments; warning about use of HTML entities in JS alert() message

#3 follow-up: @xibe
16 years ago

  • Keywords has-patch needs-testing dev-feedback added; needs-patch removed
  • Milestone changed from 2.9 to 2.8

Hello there. Long time commenter, first time patcher. Trying to get this into 2.8 if I can. Patches are all against latest trunk.

I tried my hand at make patches for 3 of the 4 contexts I wrote about. Since I'm not sure I'm doing anything well, I'd like to submit those for consideration by the core-devs, before digging into the 4th, much longer one.

As far as I can tell, I've followed the "translators comments" way to the letter, but if Nikolay has advices about it, or if the warning message itself is not too great, I'm willing to amend the patches as needed.

#4 in reply to: ↑ 3 @Denis-de-Bernardy
16 years ago

Replying to xibe:

Hello there. Long time commenter, first time patcher. Trying to get this into 2.8 if I can. Patches are all against latest trunk.

You're doing great imo. :-)

#5 follow-up: @azaozz
16 years ago

Looks good to me too. There are several files where all strings are used either in a feed or in js (feed-atom-comments.php, feed-rss2-comments.php, wp-langs.php, script-loader.php, ...), perhaps we need to add the warning once at the top in them.

@xibe
16 years ago

Patch for all related files.

#6 in reply to: ↑ 5 @xibe
16 years ago

Replying to azaozz:

...perhaps we need to add the warning once at the top in them.

Well, that might take some thinking, hence time, hence miss the 2.8 release.

Until then, here goes the full patch for all the strings of all noted files. Please make sure I didn't make any glaring mistake in pluggable.php, such as adding a second semi-colon to already-existing translators comments.

I have slightly amended the text, going from "do not use HTML entities ( , etc.): string is used in[context]" to "Note: do not use ...".

Apart from that, the other files haven't seen much change since their first pages.

Note that I can't proclaim to have touched upon all need strings, only as many as I thought were necessary.

Discuss :)

#7 @xibe
16 years ago

  • Owner changed from nbachiyski to azaozz
  • Status changed from new to reviewing

#8 @azaozz
16 years ago

  • Owner changed from azaozz to nbachiyski

All strings in script-loader.php and wp-langs.php are used in js (they are inside <script> tags). Don't think adding a comment to each string there is a good idea, may need a better way to mark them.

#9 @nbachiyski
16 years ago

  • Milestone changed from 2.8 to 2.9

We have computers on our side and we can do better than telling the translators not to use entities. In all cases we can properly escape entities if they aren't allowed. It can wait until next version, though.

#10 @Denis-de-Bernardy
16 years ago

  • Keywords needs-patch added; has-patch needs-testing dev-feedback removed

#11 @ryan
15 years ago

  • Milestone changed from 2.9 to Future Release

#12 @chriscct7
10 years ago

  • Keywords close added; needs-patch removed
  • Resolution set to duplicate
  • Status changed from reviewing to closed

Email ones fixed in #13488, visual editor in #18311, feeds in #8464, and the "Enter a word to look up" no longer exists.

#13 @DrewAPicture
10 years ago

  • Keywords close removed
  • Milestone changed from Future Release to 3.4
  • Resolution changed from duplicate to fixed

#14 @xibe
9 years ago

Hello! It's been a long time :)

So, I didn't take a close at the email-fix ticket (#13488) listed by @chriscct7, but as it turns out now, that ticket only removed the HTML entities from the English email strings, whereas I requested a context so that translators wouldn't add their own entities (namely, in French, we'd have a &nbsp; before any double sign: ? ; ! :).

Should I open another ticket about this?

Last edited 9 years ago by xibe (previous) (diff)

#15 @fxbenard
9 years ago

+1 Definitely a great improvements for translations quality.

#16 @chriscct7
9 years ago

@xibe Whoops, sorry about that. I'd recommend opening a new ticket and link it back to this one. That way we can keep it focused

#17 @SergeyBiryukov
9 years ago

  • Resolution changed from fixed to duplicate

Marking as a duplicate of newly opened #33073, since this was never fixed.

#18 @xibe
9 years ago

Thank you Sergey, was about to do that :)

#19 @SergeyBiryukov
9 years ago

  • Milestone 3.4 deleted

This ticket was mentioned in Slack in #core-i18n by xavier. View the logs.


8 years ago

Note: See TracTickets for help on using tickets.