Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The locale modules does not send string through htmlentities() before outputting them, this causes strings like <none> appearing as blank in the listings.
Comment | File | Size | Author |
---|---|---|---|
#5 | drupal_5 | 1.09 KB | killes@www.drop.org |
Comments
Comment #1
Gábor HojtsyMany of the locale strings have HTML in them (most of the admin help screens for example). Why would it be good to htmlspecialchars() them?
Comment #2
(not verified) CreditAttribution: commentedI would say that entities should be filtered, but not tags.
So replace è by è but not by <b>
Is this what you meant?
Bèr
Comment #3
(not verified) CreditAttribution: commentedDoh. Of course the filters are enabled on drupal.org. :) Again:
I would say that entities should be filtered, but not tags.
So replace è by è but not <b> by <b>
Is this what you meant?
Comment #4
Kjartan CreditAttribution: Kjartan commentedI 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.
Comment #5
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedI remove the last occurrence of t('<none>') in this patch and believe that this bug should be closed after applying.
Comment #6
Dries CreditAttribution: Dries commentedCommitted to the HEAD and the DRUPAL-4-4 branch. Thanks.
Comment #7
(not verified) CreditAttribution: commented