From 0bd45dc64bf93312a4ca19e468442393fd0d07ae Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 10 Jan 2018 20:34:32 +0100 Subject: [PATCH] fix: search translation into external module files also --- htdocs/admin/translation.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 651335d0a6d..0c4df916943 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -367,6 +367,14 @@ if ($mode == 'searchkey') foreach($filearray as $file) { $tmpfile=preg_replace('/.lang/i', '', basename($file['name'])); + //Detect if trans coming from extranl module + foreach ($conf->file->dol_document_root as $keyconf=>$dirconfalt) { + if (($keyconf!='main') && (preg_match('$'.preg_quote($dirconfalt).'$i', $file['fullname']))) { + //In this case load modulename@nmodulename + $tmpfile=$tmpfile.'@'.$tmpfile; + break; + } + } $newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite $newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only //print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records
'."\n";