The locale modules does not send string through htmlentities() before outputting them, this causes strings like <none> appearing as blank in the listings.

CommentFileSizeAuthor
#5 drupal_51.09 KBkilles@www.drop.org
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Many of the locale strings have HTML in them (most of the admin help screens for example). Why would it be good to htmlspecialchars() them?

Anonymous’s picture

I would say that entities should be filtered, but not tags.
So replace è by è but not by <b>
Is this what you meant?

Bèr

Anonymous’s picture

Doh. Of course the filters are enabled on drupal.org. :) Again:

I would say that entities should be filtered, but not tags.
So replace è by &egrave; but not <b> by &lt;b&gt;
Is this what you meant?

Kjartan’s picture

I feel the whole string should be converted, including all tags. The tags are a part of what needs to be translated so they are important information to get to the user. In any case there should be no markup in translated strings IMO, in most cases there are better solutions.

You also have cases like none enclosed as a tag, which is a value and not a html tag, its very hard to ensure that in this case the none is visible and valid tags are not. It also cleares up why the same string shows up twice in the translation listing, ive had cases where some modules have wrapped a span in a t(), but with the same text that is being used else where. Until I figured out there was a span there it was confusing as to why the same string shows up twice.

killes@www.drop.org’s picture

Version: 4.3.0-rc »
Assigned: Unassigned » killes@www.drop.org
FileSize
1.09 KB

I remove the last occurrence of t('<none>') in this patch and believe that this bug should be closed after applying.

Dries’s picture

Committed to the HEAD and the DRUPAL-4-4 branch. Thanks.

Anonymous’s picture