What I did:

  1. I created a new View.
  2. I added a 'Global: Text area' in header, with text content "Lorem Ipsum"
  3. I saved the View.
  4. 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>&lt;p&gt;Lorem Ipsum&lt;/p&gt;</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>

CommentFileSizeAuthor
#3 views-translation_markup.png12.82 KBno2e
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

no2e’s picture

When I create a new View and add an exposed filter, the textarea 'Text on demand' has this content:

Select any filter and click on Apply to see results

(no empty lines / line breaks)

Underneath it says

More information about text formats
Plain text [[hidden with 'display: none;']]

* No HTML tags allowed.
* Web page addresses and e-mail addresses turn into links automatically.
* Lines and paragraphs break automatically.

Now, even when I only preview this View, this text renders (!, so the markup is visible) as

<p>Select any filter and click on Apply to see results</p>

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

no2e’s picture

Title: Text content got visible escaped markup (filter problem?) » HTML (<p>…</p>) visible to users
Component: User interface » Code
Priority: Normal » Major
no2e’s picture

FileSize
12.82 KB

To illustrate the problem, see screenshot:

no2e’s picture

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

Jose Reyero’s picture

fengtan’s picture

Not sure why, but:

  • I could reproduce this issue with PHP 5.3.10
  • I could not with PHP 5.4.15

It might be related to #21 from #1534454: Update text handling and filtering using latest i18n features (permissions, filter_xss_admin)