Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | screenshot.gif | 45.3 KB | Peter Majmesku |
#1 | Translate to English.png | 41.95 KB | Peter Majmesku |
Comments
Comment #1
Peter MajmeskuI'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..
Comment #2
Jose Reyero CreditAttribution: Jose Reyero commentedCheck i18n settings, 'allowed formats for translation'.
Comment #3
wheelercreek CreditAttribution: wheelercreek commentedIn case anyone else has trouble finding this setting, it's at
Configuration > Regional & Language > Multilingual Settings > Strings
(admin/config/regional/i18n/strings)
Comment #4
Peter MajmeskuThank'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.
Comment #6
gge CreditAttribution: gge commentedI'm having the same issue. Is there any way to fix this?
Comment #7
scitoI'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.
Comment #8
kristofferwiklund CreditAttribution: kristofferwiklund commentedYes. I got this problem after updating Internationalization.
Running with Drupal 7.12
Comment #9
kristofferwiklund CreditAttribution: kristofferwiklund commentedWorkaround 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.
Comment #10
Jose Reyero CreditAttribution: Jose Reyero commentedI think this is the same as #1437146: Rework string translation access. (After 1.4 update, block translation disallowed HTML error)
Comment #11
jorisx CreditAttribution: jorisx commentedHmm 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)
:-)
Comment #12
drupalfan81 CreditAttribution: drupalfan81 commentedHaving 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?
Comment #13
Jose Reyero CreditAttribution: Jose Reyero commentedThen tagging for the right version. Possibly won't fix, read notes on the project page about that version.
Comment #14
drupalfan81 CreditAttribution: drupalfan81 commentedThanks 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!
Comment #15
Jose Reyero CreditAttribution: Jose Reyero commentedThis should be fixed in D7 version.
This won't be fixed for D6.
Comment #16
c0der87 CreditAttribution: c0der87 commentedAny 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?