Hi,

has anyone an idea, how to translate a block with full html input type? I want to use images and formatting in my translateable block.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Peter Majmesku’s picture

FileSize
41.95 KB

I've attached an image, where you can see, that I have no permission to edit the block with this full html input format. But I'm admin. So that's wired..

Jose Reyero’s picture

Status: Active » Fixed

Check i18n settings, 'allowed formats for translation'.

wheelercreek’s picture

In case anyone else has trouble finding this setting, it's at
Configuration > Regional & Language > Multilingual Settings > Strings

(admin/config/regional/i18n/strings)

Peter Majmesku’s picture

FileSize
45.3 KB

Thank's for the link to the configuration page!

After the setting I can translate the block. But if I click on save, I get the message

The submitted string contains disallowed HTML: <img src="/sites/all/themes/unitebusiness/images/icons/monitor-skins.png" width="85" height="75" alt="computer monitor" style="float:left; margin: -2px 30px 0 15px;" /> <h1 class="title">Lovely Frontend<span>We care about your experience.</span></h1>

The input format is full html. I don't have any html filters configured. Please see my attached screenshot.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

gge’s picture

I'm having the same issue. Is there any way to fix this?‎

scito’s picture

I've opened #1437146: Rework string translation access. (After 1.4 update, block translation disallowed HTML error). It seems to be a problem of the new version 1.4 of i18n.

kristofferwiklund’s picture

Version: 7.x-1.0 » 7.x-1.4
Status: Closed (fixed) » Active

Yes. I got this problem after updating Internationalization.

Running with Drupal 7.12

kristofferwiklund’s picture

Workaround was to go to Administration » Configuration » Regional and language » Translate interface. Search for the block and save. If I went to the block and translate it I got the error above.

Jose Reyero’s picture

jorisx’s picture

Hmm annoying issue..
but translating those blocks via the translate interface is rather convenient
(Administration » Configuration » Regional and language » Translate interface and then just selecting the blocks)
:-)

drupalfan81’s picture

Status: Closed (duplicate) » Active

Having the same issue with 6.x-1.10. I had to actually hack /include/locale.inc and added my center and div tag as it was blocking me otherwise.

function locale_string_is_safe($string) {
return decode_entities($string) == decode_entities(filter_xss($string, array('a', 'abbr', 'acronym', 'address', 'b', 'bdo', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'ins', 'kbd', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var', 'center', 'div')));

shouldn't this work without hacking drupal core?

Jose Reyero’s picture

Version: 7.x-1.4 » 6.x-1.x-dev

Then tagging for the right version. Possibly won't fix, read notes on the project page about that version.

drupalfan81’s picture

Title: Translate block with full html input type » Translate block with full html input type ERROR (The submitted string contains disallowed HTML)
Version: 6.x-1.x-dev » 6.x-1.10
Category: support » bug
Priority: Normal » Critical

Thanks Jose! It seems the issue is across both the 7.x version and 6.x version. Is there a solution to this issue of disallowing basic HTML tags like center, div, and others? It seems this should be allowed when translators are adding translated strings. If there needs to be an extra layer of security, then could we add a permission to allow specific roles to have access to add any tags?

It seems that this module blocks adding this stuff by using the Drupal's safe string check. I assume the right way to do this is to have the translated string checked against the text input format used for that field. Obviously if that tag is allowed in the input format, then it should be allowed in the string translation field, why are we comparing to a different set of rules?

Thanks!

Jose Reyero’s picture

Status: Active » Closed (won't fix)

This should be fixed in D7 version.
This won't be fixed for D6.

c0der87’s picture

Any reason why D6 won't get a fix?

Rather than not offer to fix it, wouldn't it be better to ask for more people to assist with this project and become one of the maintainers. I have seen your comments on other threads and you seem pretty rude and unhelpful. Maybe you are getting burnt out by having too take too much on by yourself. Are you allowing new people to help maintain this module? There are still a lot of sites using D6, so could we have the reason as to why this wont be fixed?