How to make a custom translatable string? For example, i've a array contains string for each elements

$description[] = $discount->short_description;

foreach ($description as $value) {
$line.= $value."
";
}

the $line will be used in

  $output[$field_name] = array(
    '#theme' =&gt; 'field',
    '#title' =&gt; $instance['label'],
    '#label_display' =&gt; 'hidden',
    '#field_type' =&gt; $field['type'],
    '#field_name' =&gt; $field_name,
    '#bundle' =&gt; $node-&gt;type,
    '#object' =&gt; $node,
    '#items' =&gt; array(1),
    '#entity_type' =&gt; 'node',
    '#weight' =&gt; $display['weight'],
    0 =&gt; array('#markup' =&gt; t($line)),
  );


how can i make this $line will appear in admin/config/regional/translate/translate, so i can translate it?
Clear caches. Then, go to http://example.com/admin/config/regional/translate/i18n_string and hit "Refresh strings" button. This should do it.

Also, t() is known to cause problems if used on variables, not strings directly. But most of these problems affect tools that tries to extract strings into .po files, so there is a fair chance it will work for you. But think twice if you really need a variable there.

If it happens to you that your string aren't recognized by panel, you can use one more method. Write your own .po file. Structure is as follows:

white-space
#  translator-comments
#. extracted-comments
#: reference...
#, flag...
#| msgid previous-untranslated-string
msgid untranslated_string
msgstr translated_string


Repeat this (in one file) for all strings. Create one file per language you want to translate to. Then go to http://example.com/admin/config/regional/translate/import and import your files. From now on, strings will be available for translation in interface.