Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
41890d0a
Commit
41890d0a
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fixed: Translation of module name and desc was not used for external
modules.
parent
e20c1dec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/core/modules/DolibarrModules.class.php
+22
-7
22 additions, 7 deletions
htdocs/core/modules/DolibarrModules.class.php
with
22 additions
and
7 deletions
htdocs/core/modules/DolibarrModules.class.php
+
22
−
7
View file @
41890d0a
...
@@ -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
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment