What I did:
- I created a new View.
- I added a 'Global: Text area' in header, with text content "Lorem Ipsum"
- I saved the View.
- I translated the View into another language and translated the text content of the 'Global: Text area', too
What I got:
The content gets translated but there is escaped markup visible (which I did not add). When I view source of the rendered View I see this:
<div class="view-header">
<p><p>Lorem Ipsum</p></p>
</div>
And this looks like: <p>Lorem Ipsum</p>
What I expected:
<div class="view-header">
<p>Lorem Ipsum</p>
</div>
What I tried:
- I tried to remove blank lines in the Views text area: nothing changed.
- I tried to translate these strings in 'Administration » Configuration » Regional and language » Translate interface': nothing changed.
By the way, this problem also exists with the default string for exposed Views: "Select any filter and click on Apply to see results"
On View visiting with English path prefix, the text gets displayed correctly. On View visiting with German path prefix, it (didn't tanslated it yet) gets displayed with escaped markup:
<p>Select any filter and click on Apply to see results</p>
Comment | File | Size | Author |
---|---|---|---|
#3 | views-translation_markup.png | 12.82 KB | no2e |
Comments
Comment #1
no2e CreditAttribution: no2e commentedWhen I create a new View and add an exposed filter, the textarea 'Text on demand' has this content:
(no empty lines / line breaks)
Underneath it says
Now, even when I only preview this View, this text renders (!, so the markup is visible) as
Same problem when I save this View and view its page: the users see these
<p>
around the content.When I translate this View, the translated text gets displayed correctly (→ without visible markup).
When I choose Views 'Translation method' different than 'Internationalization Views', it works (→ no visible markup).
Comment #2
no2e CreditAttribution: no2e commentedComment #3
no2e CreditAttribution: no2e commentedTo illustrate the problem, see screenshot:
Comment #4
no2e CreditAttribution: no2e commentedOkay, I think I identified the problem:
The strings for the default language are not allowed to use the "Plain text" text format. It seems you have to select a text format, which does not 'Convert line breaks into HTML' (although I did not add any line breaks!).
The problem for me was: I did only have the "Plain text" text format set up (I used the minimal installation of Drupal, so there are no additional text formats pre-installed).
I think it should be fixed, so that you can use Views Translation with the "Plain text" text format, too. Or at least give a warning, that you'd have to use a special text format.
Comment #5
Jose Reyero CreditAttribution: Jose Reyero commentedPlease see (and try), #1534454: Update text handling and filtering using latest i18n features (permissions, filter_xss_admin)
Comment #6
fengtanNot sure why, but:
It might be related to #21 from #1534454: Update text handling and filtering using latest i18n features (permissions, filter_xss_admin)