What is the correct way to translate variable_get string values entered in admin input fields? I'm developing a simple module with and admin page, where admin can fill some textfields with custom strings that will generates a piece of html to be used later.

So for example I have fields like this in admin page:

function MYMODULE_admin_page_arguments() {
  $form = array();

  $form['MYMODULE_link'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Conditions link path'),
    '#default_value' =&gt; variable_get('MYMODULE_link', 'conditions'),
  );
  $form['MYMODULE_link_text'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Conditions link text'),
    '#default_value' =&gt; variable_get('MYMODULE_link_text', 'conditions'),
  );
  $form['MYMODULE_link_target'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Conditions link target'),
    '#default_value' =&gt; variable_get('MYMODULE_link_target', '_blank'),
  );
  $form['MYMODULE_prefix'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Conditions link prefix text'),
    '#default_value' =&gt; variable_get('MYMODULE_prefix', 'I agree to the '),
  );
  $form['MYMODULE_suffix'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Conditions link suffix text'),
    '#default_value' =&gt; variable_get('MYMODULE_suffix', '.'),
  );

  return system_settings_form($form);
}


Then the above values are managed after by my module to compose an output like:

// Create label
$prefix = variable_get('MYMODULE_prefix', 'I agree to the ');
$suffix = variable_get('MYMODULE_suffix', '.');
$path = variable_get('MYMODULE_link', 'conditions');
$text = variable_get('MYMODULE_link_text', 'conditions');
$target = variable_get('MYMODULE_link_target', '_blank');

$label = $prefix . l($text, $path, array('attributes' =&gt; array('target' =&gt; $target))) . $suffix;


Now I need that all these values are available for string translation, so the first think I thought was to pass all of them through t(), for example:

$label = t($prefix) . l(t($text), $path, array('attributes' =&gt; array('target' =&gt; $target))) . t($suffix);


but I read here https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7 that I should never pass variables directly to t(), so for e.g t($prefix) is a bad stuff.

So, what is the correct Drupal way to accomplish this?
You should use the Variable translation module, part of Internationalization.


Enable the Variable translation module included with the Internationalization package
Go to Administration > Configuration > Regional and language > Multilingual settings
Click on the Variables tab
Select the variables that will be multilingual
Click Save configuration button


Then, you'll be able to select language for which you are configuring your variable:



Advice taken from this community documentation.