How to translate variable containing html with the i18n_variable module? I am trying to translate a variable with i18n_variable module. I am using the following code:

/**
 * Implements hook_variable_info().
 */
function MY_MODULE_variable_info($options) {
  $variables['pm_email_notify_subject'] = array(
    'title' =&gt; t('My variable title'),
    'description' =&gt; t('The description', array(), $options),
    'default' =&gt; t('A good default value', array(), $options),
    'type' =&gt; 'string',
    'localize' =&gt; TRUE,
    'access' =&gt; 'administer checkout',    
    'group' =&gt; 'my_variable_group',
  );
  return $variables;
}


This works as expected: I can choose the variable to be translated at /admin/config/regional/i18n/variable and when I do so, I can find its value via /admin/config/regional/translate.

But the problem is, that the variable contains HTML markup and although this works with the original content, the markup in the translated string gets converted to HTML entities. what am I missing?
A solution I used when I faced a similar problem in a different context is to preventively replace tag-markers by the corresponding entity in the content before it is processed.

Adapated to your case, it might look like this:

/**
 * Implements hook_variable_info().
 */
function MY_MODULE_variable_info($options) {
  $my_variable_content = preg_replace_all(
    '/&lt;([^&gt;]*)&gt;/', '&amp;lt;$1&amp;gt;',
    'A good default value with some &lt;tags&gt; inside'
  );
  $variables['pm_email_notify_subject'] = array(
    'title' =&gt; t('My variable title'),
    'description' =&gt; t('The description', array(), $options),
    'default' =&gt; t($my_variable_content, array(), $options),
    'type' =&gt; 'string',
    'localize' =&gt; TRUE,
    'access' =&gt; 'administer checkout',    
    'group' =&gt; 'my_variable_group',
  );
  return $variables;
}


This way, the finally rendered text keeps its "&lt;" and ">" intacts.

But caution: it might be not appropriate to your case, so try it carefully.