FIX Search into language is ok for file into external modules two.
This commit is contained in:
parent
a98452ae36
commit
e184cac2c5
@ -403,6 +403,9 @@ if ($mode == 'searchkey')
|
|||||||
|
|
||||||
$recordtoshow=array();
|
$recordtoshow=array();
|
||||||
|
|
||||||
|
// Search modules dirs
|
||||||
|
$modulesdir = dolGetModulesDirs();
|
||||||
|
|
||||||
$nbempty=0;
|
$nbempty=0;
|
||||||
/*var_dump($langcode);
|
/*var_dump($langcode);
|
||||||
var_dump($transkey);
|
var_dump($transkey);
|
||||||
@ -416,22 +419,23 @@ if ($mode == 'searchkey')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Load all translations keys
|
// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
|
||||||
foreach($conf->file->dol_document_root as $keydir => $searchdir)
|
foreach($modulesdir as $keydir => $tmpsearchdir)
|
||||||
{
|
{
|
||||||
// Directory of translation files
|
$searchdir = $tmpsearchdir; // $searchdir can be '.../htdocs/core/modules/' or '.../htdocs/custom/mymodule/core/modules/'
|
||||||
$dir_lang = $searchdir."/langs/".$langcode;
|
|
||||||
$dir_lang_osencoded=dol_osencode($dir_lang);
|
|
||||||
|
|
||||||
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
// Directory of translation files
|
||||||
|
$dir_lang = dirname(dirname($searchdir))."/langs/".$langcode; // The 2 dirname is to go up in dir for 2 levels
|
||||||
|
$dir_lang_osencoded=dol_osencode($dir_lang);
|
||||||
|
|
||||||
foreach($filearray as $file)
|
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
||||||
{
|
foreach($filearray as $file)
|
||||||
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
|
{
|
||||||
$newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
|
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
|
||||||
$newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
|
$newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
|
||||||
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
|
$newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
|
||||||
}
|
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now search into translation array
|
// Now search into translation array
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user