Closed (fixed)
Project:
Facet API Translation
Version:
7.x-1.0-beta2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2012 at 19:26 UTC
Updated:
7 Sep 2012 at 19:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
daniel kulbeAdditional html-tags get converted into normal text. Totally unwanted!
Comment #2
cpliakas commentedHi Daniel.
Thanks for posting. These are actually two separate issues and should be their own posts, but I believe they are duplicates so I am closing as such. In addition, they are actually both more relevant to the Facet API project then this one. Please refer to the following issues:
#1728496: Plural text translatable, but no longer shown
#1734730: Taxonomy terms with apostrophe are encoded with "'"
Chris
Comment #3
daniel kulbeThe use of plural text works fine now using the dev version of facet api + current search. Only at the German version (in my case) of the text converts tags like
<em>and<strong>to characters.Comment #4
cpliakas commentedCould you please post a screenshot of the offending tags being converted to characters? I think I understand what you are saying, but I want to make sure we are on the same page before moving forward.
Also, "needs work" status is intended to be used for patches. Please see the Status settings for an issue for more details. Not a big deal, but it helps bm keeps things organized and allows me to respond more efficiently if things are tagged according to these standards.
Thanks in advance,
Chris
Comment #5
daniel kulbeSorry for the wrong status! I'm new at Drupal.org ...
So I capured some screenshots:
I use commerce_kickstart_search module that provides current search blocks by code and changed the vocabulary a little bit. I noticed, when I create a current search block by UI the tags also get converted to readable text. But I hoped it would be possible to translate it with the same html tags as the original text.
Comment #6
cpliakas commentedHi Daniel,
Re: the status, not a problem at all, and welcome to Drupal! Glad to have you aboard. We were all new to Drupal.org at one time as well, so I want to help you get the most out of the issue queue as you post against other projects in the future.
Also, thank you so much for the screenshots, I see exactly the problem you are trying to solve now. Let me try to replicate and see if thee is some way to accomplish your goals. The tough part with escaping markup is that if you are too permissive then it becomes an XXS security issue, so let's see if we can get this working in a way that is both secure and configurable.
Much appreciated,
Chris
Comment #7
daniel kulbeThanks for the warm welcome. I think it would be enough to enable just a few highlighting tags like
<em>,<strong>,<b>and<i>.Comment #8
cpliakas commentedOK, I see the issue here. Not only is this value being double encoded by Facet API anyways, but it is being tripple encoded when translated via this module. So that's awesome :-(.
To highlight the issue, the first escaping for translated strings will happen in the i18n module on line 643 in the i18n_string_format() function. The second escaping happens on line 45 of the CurrentSearchItemText::execute() method. The third round of escaping happens on line 28 of the theme_current_search_text() function.
Let me think about how to attach this, but there will have to be some fixes in Facet API as well.
Thanks,
Chris
Comment #9
cpliakas commentedPosted issue against Facet API at #1751514: Current search text items are double encoded to track the patches against the core module.
Comment #10
cpliakas commentedThe attached patch fixes the extra encoding applied during translation.
Comment #11
daniel kulbeThis patch solved my problem. Everything is displayed correctly.
Comment #12
cpliakas commentedIf you apply the patch above to the Facet API Translate module and the one at #1751514-2: Current search text items are double encoded the the Facet API module, it should solve your use case. If the patches work as expected, feel free to change the status in both issues to "reviewed & tested by the community".
Thanks!
Chris
Comment #13
cpliakas commentedI didn't refresh before posting :-) Marking as RTBC based on comments in #1741444-11: Current Search text items are double escaped when translated.
Comment #14
cpliakas commentedCommitted at http://drupalcode.org/project/facetapi_i18n.git/commit/57ba40a.