There are some strings in AT theme settings which can not be translated ("HTML tags are not allowed"). For example:

<div class="description">Files will be saved to: <code>@public_files


<div class="description">Files will be saved to: <code>@theme_directory


<div class="description">In this layout <em>Second sidebar</em> wraps below.</div>

Steps to reproduce

  1. Install and activate any language different from English
  2. Install and activate Adaptive Theme
  3. Go to admin->Regional and Language->Interface Translation and try to manually translate AT or import an AT .po file
    1. Proposed solution

      Move div tags anywhere outside t function in order to be able to translate those strings.

Comments

Jeff Burnz’s picture

Are some tags allowed or no tags at all, this has never been really clear to me. Easy to fix either way.

Pablo Romero’s picture

Extracted from includes/locale.inc (Drupal 7.35):

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

}

Any other tags are filtered as "not safe" for Locale module.

NSp’s picture

Why do you think the "table" tag is allowed and the "div" is not?

  • Jeff Burnz committed 54b97f6 on 7.x-3.x
    Issue #2456959: Remove div tags from translatable strings
    
Jeff Burnz’s picture

Status: Active » Fixed

Better late than never, fixed it.

@NSp, div is not allowed because it's not in the locale_string_is_safe() list of allowable tags.

Status: Fixed » Closed (fixed)

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

VVS’s picture

Bad commit...
And how to translate these strings? :(