Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#10069 closed defect (bug) (duplicate)

(2.8-RC1) HTML entities and variables won't always work in JavaScript messages

Reported by: xibe Owned by: nbachiyski
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.8
Component: I18N Keywords:
Focuses: Cc:


A bug has re-surfaced during a community test of the fr_FR translation for 2.8-RC1.

The fr_FR translation uses many HTML entites, and under certain conditions (have yet to determine them), they break the JS message.

Original string:

"You are about to delete the selected categories.\n"

" 'Cancel' to stop, 'OK' to delete."

fr_FR translation:

"Vous êtes sur le point de supprimer la catégorie sélectionnée.\n"

" « Annuler » pour abandonner, « OK » pour supprimer."

The reporter's proposed patch involves correcting the POT (by using UTF-8 characters directly instead of HTML entities) for these strings:

"Vous êtes sur le point de supprimer les catégories sélectionnées.\n"

" « Annuler » pour abandonner, « OK » pour supprimer."

While this is eaasily done, I wonder why it should boy under some conditions and not others - and thus, if it could not be corrected in order to work under all conditions.

This needs some testing (browsers, OS...), which I will report here when I have more time...

Change History (2)

comment:1 xibe5 years ago

  • Summary changed from HTML entities won't always work in JavaScript messages to (2.8-RC1) HTML entities and variables won't always work in JavaScript messages

Note that this does not "break" JS message per se (they still get displayed), but rather, sometimes, HTML entities and WP's variables seem to not work.

See the captures from some time ago: delete tag, delete link (reports: #1, #2).

The reporter at the time confirmed this behavior in both localhost (using WampServer) and the Free.fr hosting (very popular in France), on Firefox 3, IE 6 and Opera 9.

comment:2 nbachiyski5 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Until we resolve the issues in #10005 you can use UTF-8 characters, they will surely work.

If the characters are part of your alphabet or are traditional punctuation marks, it is preferable to use the UTF-8 character than the HTML entity. The entities are useful in a multi-language and multi-encoding culture (like development), actual characters are perfectly OK for mono-language, mono-encoding culture (like translation), where entering the character is one keypress away. If I had to enter « on my keyboard I would either have to copy/paste or use the Special characters pallete from my OS.

Note: See TracTickets for help on using tickets.