I get a "The submitted string contains disallowed HTML" when I try to translate strings with html code in it. This shouldn't happen should it? Obviously I am turning on specific input formats so that they can be translated, so they will of course have code in them.

I found this post regarding the issue and it resolved the issue, but I don't know why I have to edit Drupal's core code to get this to work. http://drupalist.net/40-internationalization-blocks-cannot-be-translated...

In my case my code had a tag in it and this was causing the issue. I had to hack Drupal's locale.inc file to add the 'center' tag to the safe list.

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')));

Why is this necessary? Shouldn't the translation module take care of this?

Comments

joseph.olstad’s picture

Issue summary: View changes
Status: Active » Closed (outdated)