Skip to content

Commit

Permalink
closes #4 load loading itemtype locale
Browse files Browse the repository at this point in the history
  • Loading branch information
Walid committed Aug 18, 2014
1 parent ba45ecd commit 6e15211
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions inc/type.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1339,13 +1339,15 @@ static function registerOneType($itemtype) {
* @return nothing
*/
static function includeLocales($name) {
global $CFG_GLPI;
global $CFG_GLPI,$LANG;

$prefix = GENERICOBJECT_LOCALES_PATH . "/$name/$name";
//Dirty hack because the plugin doesn't support gettext...
$language= str_replace('.mo', '', $CFG_GLPI["languages"][$_SESSION["glpilanguage"]][1]);
if (isset ($_SESSION["glpilanguage"])
&& file_exists($prefix . "." . $CFG_GLPI["languages"][$_SESSION["glpilanguage"]][1])) {
include_once ($prefix . "." . $CFG_GLPI["languages"][$_SESSION["glpilanguage"]][1]);
&& file_exists("$prefix.$language.php")) {
include_once ("$prefix.$language.php");

} else {
if (file_exists($prefix . ".en_GB.php")) {
include_once ($prefix . ".en_GB.php");
Expand Down Expand Up @@ -1660,4 +1662,4 @@ static function uninstall() {
$query = "DROP TABLE IF EXISTS `glpi_plugin_genericobject_types`";
$DB->query($query) or die($DB->error());
}
}
}

0 comments on commit 6e15211

Please sign in to comment.