Skip to content
Snippets Groups Projects
Commit 41890d0a authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fixed: Translation of module name and desc was not used for external

modules.
parent e20c1dec
No related branches found
No related tags found
No related merge requests found
...@@ -344,7 +344,8 @@ abstract class DolibarrModules ...@@ -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 * @return string Translated module name
*/ */
...@@ -359,9 +360,16 @@ abstract class DolibarrModules ...@@ -359,9 +360,16 @@ abstract class DolibarrModules
return $langs->trans("Module".$this->numero."Name"); return $langs->trans("Module".$this->numero."Name");
} }
else else
{ {
// If module name translation using it's unique id does not exists, we take its name // If module name translation using it's unique id does not exists, we take use its name to find translation
return $this->name; 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 ...@@ -382,9 +390,16 @@ abstract class DolibarrModules
return $langs->trans("Module".$this->numero."Desc"); return $langs->trans("Module".$this->numero."Desc");
} }
else else
{ {
// If module description translation using it's unique id does not exists, we take its description // If module description translation using it's unique id does not exists, we take use its name to find translation
return $this->description; if (is_array($this->langfiles))
{
foreach($this->langfiles as $val)
{
if ($val) $langs->load($val);
}
}
return $langs->trans($this->description);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment