Skip to content

Commit 6e15211

Browse files
author
Walid
committed
closes #4 load loading itemtype locale
1 parent ba45ecd commit 6e15211

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

inc/type.class.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -1339,13 +1339,15 @@ static function registerOneType($itemtype) {
13391339
* @return nothing
13401340
*/
13411341
static function includeLocales($name) {
1342-
global $CFG_GLPI;
1342+
global $CFG_GLPI,$LANG;
13431343

13441344
$prefix = GENERICOBJECT_LOCALES_PATH . "/$name/$name";
1345+
//Dirty hack because the plugin doesn't support gettext...
1346+
$language= str_replace('.mo', '', $CFG_GLPI["languages"][$_SESSION["glpilanguage"]][1]);
13451347
if (isset ($_SESSION["glpilanguage"])
1346-
&& file_exists($prefix . "." . $CFG_GLPI["languages"][$_SESSION["glpilanguage"]][1])) {
1347-
include_once ($prefix . "." . $CFG_GLPI["languages"][$_SESSION["glpilanguage"]][1]);
1348-
1348+
&& file_exists("$prefix.$language.php")) {
1349+
include_once ("$prefix.$language.php");
1350+
13491351
} else {
13501352
if (file_exists($prefix . ".en_GB.php")) {
13511353
include_once ($prefix . ".en_GB.php");
@@ -1660,4 +1662,4 @@ static function uninstall() {
16601662
$query = "DROP TABLE IF EXISTS `glpi_plugin_genericobject_types`";
16611663
$DB->query($query) or die($DB->error());
16621664
}
1663-
}
1665+
}

0 commit comments

Comments
 (0)