diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index e4d1f834b4afb512ad197d058cc0a3859086c15f..b19557f25ff681b75e2ddb21d76f758b20b54d1c 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -344,7 +344,8 @@ abstract class DolibarrModules /** - * Gives the translated module name if translation exists in admin.lang or the default module name. + * Gives the translated module name if translation exists in admin.lang or into language files of module. + * Otherwise return the module key name. * * @return string Translated module name */ @@ -359,9 +360,16 @@ abstract class DolibarrModules return $langs->trans("Module".$this->numero."Name"); } else - { - // If module name translation using it's unique id does not exists, we take its name - return $this->name; + { + // If module name translation using it's unique id does not exists, we take use its name to find translation + if (is_array($this->langfiles)) + { + foreach($this->langfiles as $val) + { + if ($val) $langs->load($val); + } + } + return $langs->trans($this->name); } } @@ -382,9 +390,16 @@ abstract class DolibarrModules return $langs->trans("Module".$this->numero."Desc"); } else - { - // If module description translation using it's unique id does not exists, we take its description - return $this->description; + { + // If module description translation using it's unique id does not exists, we take use its name to find translation + if (is_array($this->langfiles)) + { + foreach($this->langfiles as $val) + { + if ($val) $langs->load($val); + } + } + return $langs->trans($this->description); } }