I am using t()
with context to translate strings for a multilingual site. I would need a user to translate all language strings, but she/he does not need to know Drupal, just will feel an Excel. The problem is that I must provide the original string, the context, and the URL where it appears, and I do not know how to extract them from the database, as the string is stored as a BLOB. I am using this trick of function but still do not get the URL. Any help will be appreciated.
In the function I am copying and pasting all t() ocurrences that I have added in modules, template.php, etc.
function My_Module_list_translations(){
$translation[] = t2('All', array(), array('context' => 'listado_sabias'));
$translation[] = t2('Write one or more words', array(), array('context' => 'formulario_noticias'));
$translation[] = t2('CATALOGUE', array(), array('context' => 'menu-personalizado'));
echo "<table border='1'>";
foreach($traduccion as $value){
echo '<tr><td>' . $value["contexto"] . '</td><td>' . $value["es"] . '</td><td>' . $value["en"] . '</td></tr>';
} // foreach
echo "</table>";
} // function
function t2($string, $empty, $context){
$array_dev["contexto"] = $context["context"];
$array_dev["es"] = t($string, array(), array('context' => $context["context"] , 'langcode' => 'es' ));
$array_dev["en"] = t($string, array(), array('context' => $context["context"] , 'langcode' => 'en'
));
return $array_dev;
} // function