From 88fa042c3bcc3e7ea86da256e5802380d854f6f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 May 2021 12:39:33 +0200 Subject: [PATCH] Can edit language file for core modules --- htdocs/modulebuilder/index.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index c35aa1c3f87..35e5e5b81b0 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2159,21 +2159,22 @@ if ($module == 'initmodule') { // Dir for module $diroflang = dol_buildpath($modulelowercase, 0); + $diroflang .= '/langs'; + $langfiles = dol_dir_list($diroflang, 'files', 1, '\.lang$'); if (!preg_match('/custom/', $dirread)) { + // If this is not a module into custom $diroflang = $dirread; $diroflang .= '/langs'; - $langfiles = dol_dir_list($diroflang, 'files', 1, $modulelowercase.'\.lang$'); - } else { - $diroflang .= '/langs'; - - $langfiles = dol_dir_list($diroflang, 'files', 1, '\.lang$'); } print ''; foreach ($langfiles as $langfile) { $pathtofile = $modulelowercase.'/langs/'.$langfile['relativename']; + if (!preg_match('/custom/', $dirread)) { // If this is not a module into custom + $pathtofile = 'langs/'.$langfile['relativename']; + } print '
'.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''.img_picto($langs->trans("Delete"), 'delete').'';