Indefero

Issue 766: HTML entities displayed literally

Reported by Jean-Philippe Fleury, Nov 23, 2011

Some HTML entities added to French translation are displayed 
literally.

Example 1: go to:

http://projects.ceondo.com/p/indefero/issues/watchlist/open

"h1" title will be displayed as the following:

<h1 class="title" id="title">Liste de 
surveillance&amp;nbsp;: Tickets ouverts pour Indefero</h1>

It seems that special characters are converted before displaying.

Example 2: another example is the content of the "title" 
tag:

<title>Ticket 736&amp;nbsp;: Possibility to edit existing 
issue comments - Issue tracking, code review, source browser for 
git, mercurial, subversion and monotone.</title>

In example 2, it's normal because HTML is not interpreted in 
"title" tag, but as translators, we don't know context of 
strings we're translating.

Possibilities to solve the problem:

* Identify where HTML entities should be displayed (example 1) but 
are not, and fixes the bug. Then, identify where HTML entities are 
used but should not (example 2, plain text e-mails...) and fixes the 
translation.

* Just remove all HTML entities from translation.

Comment 1 by Thomas Keller, Nov 29, 2011

Ah, there it bites us! Well, I still don't know exactly who did 
these changes, but I remember the mail from you from November 1st 
very well where you told me that its quite common to do these kind 
of things.

Problem is now that IDF escapes template contents everywhere (which 
is a good thing), so to "unescape" these things I'd have 
to modify the code to actually put unsafe contents into the 
templates. I'd really rather go on and remove all the &nbsp;s 
again from the code, but then the colon line breaking will be as bad 
as it was before...

Comment 2 by Jean-Philippe Fleury, Nov 29, 2011

I removed all HTML entities in the French translation on Transifex. 
There will be no line breaking problem anymore because I replaced 
for example "&nbsp;:" with ":".

Also, I attach a patch that removes HTML entities present in 
original English strings.

Comment 3 by Thomas Keller, Nov 30, 2011

Applied in revision bfc5689. Thanks!
Labels: Milestone:Release1.2.1
Status: Fixed

Created: 1 year 6 months ago by Jean-Philippe Fleury

Updated: 1 year 5 months ago

Status: Fixed

Followed by: 2 persons

Labels:
Type:Defect
Priority:Medium
Milestone:Release1.2.1