Problem/Motivation
Translated strings behave differently from their untranslated versions. For example translated component title is being check plained twice on webform analysis page and characters like " are not displayed correctly.
Proposed resolution
Go trough all i18n_string() calls in includes/webform_localization.i18n.inc and add missing formats.
Remaining tasks
Fix it and test it.
User interface changes
none.
API changes
none.
Original report by @Mschudders
Hello
When I create a webform, make it translatable via this module and then in email settings of the webform have a "custom template" with html like:
thank you for this ...
I can find it in the translate interface.
When i translate it to:
Merci de ...
I get ==> <p>L'équipe recrutement Ausy</p>
On the /fr/webform/NID/emails custom template.
To make things clear, I only have one webform in english.
and when I check the mails that are send from the french version of the webform(/fr/webform) I see html tags in the email.
Can someone help me out ?
The issue Q was no good.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | webform_localization-i18n_string_formats_added-2356791-11.patch | 3.75 KB | joseph.olstad |
Comments
Comment #1
mschudders commentedComment #2
MarlonvanHaren commentedI have the same problem, also I get %value[Firstname] as output in the translated version, In the orginal version i just get the value.
Did you already come up with a solution?
Comment #3
mschudders commentedYes, I created a template for this (copied it from the module) and then inside of that template i just did "html_escape" on the corresponding variable.
Comment #4
mschudders commentedTemplate: mimemail-message.tpl.php
Code:
print html_entity_decode($body);Comment #5
mikran commentedIssue summary added
Comment #6
mikran commentedThere really isn't configurable format in webform elements so attached patch addss
I18N_STRING_FILTER_XSSspecial format to most strings. I didn't touch email subject, to or from fields. This same fix was done to component description earlier (#2223335: Translation of component description: HTML escaped).Webform isn't really consistent how things are formatted in different places but as there is no format in components itself the templates, forms and so on apply their own display options. For example component name can include HTML but only in form context and the analysis page is check_plained and HTML is not displayed there. But that could be a webform bug, need to check it out.
Comment #8
mikran commentedI've opened a new issue of failing tests as those fails are not related to this patch: #2394027: HEAD tests won't pass.
Comment #9
dan3h commentedI was having this issue with the label for a select option group, where it was coming out (after translation) looking like:
Please select <em>one</em> from below:Patch to fix it attached.
Comment #11
joseph.olstadrefactored a patch based on patch by mikran
Comment #12
joseph.olstadComment #13
joseph.olstadComment #15
joseph.olstadregression on this issue
see this comment: https://www.drupal.org/node/2633966#comment-10685218
Comment #16
joseph.olstadlooking for a solution
They key to this issue is revealed by comment #4
https://www.drupal.org/node/2356791#comment-9415815
Comment #17
joseph.olstadsee #2633966: Translated e-mail body sent as plain text
Comment #18
joseph.olstadduplicate of #2633966: Translated e-mail body sent as plain text