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.

Comments

mschudders’s picture

Issue summary: View changes
MarlonvanHaren’s picture

I 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?

mschudders’s picture

Yes, 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.

mschudders’s picture

Template: mimemail-message.tpl.php

Code: print html_entity_decode($body);

mikran’s picture

Title: Html escaped » Wrong or missing 'format' parameters in most i18n_string() calls
Issue summary: View changes

Issue summary added

mikran’s picture

Status: Active » Needs review
Related issues: +#2223335: Translation of component description: HTML escaped
StatusFileSize
new5.59 KB

There really isn't configurable format in webform elements so attached patch addss I18N_STRING_FILTER_XSS special 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.

Status: Needs review » Needs work

The last submitted patch, 6: i18n_string_formats_added-2356791-6.patch, failed testing.

mikran’s picture

I've opened a new issue of failing tests as those fails are not related to this patch: #2394027: HEAD tests won't pass.

dan3h’s picture

StatusFileSize
new802 bytes

I 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.

joseph.olstad’s picture

StatusFileSize
new3.75 KB

refactored a patch based on patch by mikran

joseph.olstad’s picture

Status: Needs work » Needs review
joseph.olstad’s picture

Status: Needs review » Fixed

  • joseph.olstad committed 8058b74 on 7.x-4.x
    Issue #2356791 by mikran, joseph.olstad, dan3h: Wrong or missing 'format...
joseph.olstad’s picture

Status: Fixed » Needs work
Parent issue: » #2633966: Translated e-mail body sent as plain text

regression on this issue

see this comment: https://www.drupal.org/node/2633966#comment-10685218

joseph.olstad’s picture

looking for a solution

They key to this issue is revealed by comment #4

https://www.drupal.org/node/2356791#comment-9415815

joseph.olstad’s picture

joseph.olstad’s picture

Status: Needs work » Closed (duplicate)