Skip to content

Commit 16a1379

Browse files
stonebuzzbtry
authored andcommitted
feat(DropdownField): Load translation for plugin too
1 parent fa142e2 commit 16a1379

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

inc/field/dropdownfield.class.php

+3
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ public function parseObjectProperties(
715715
// We need english locale to search searchOptions by name
716716
$oldLocale = $TRANSLATE->getLocale();
717717
$TRANSLATE->setLocale("en_GB");
718+
$_SESSION['glpilanguage'] = "en_GB";
718719
if ($plug = isPluginItemType($itemtype)) {
719720
Plugin::loadLang(strtolower($plug['plugin']), "en_GB");
720721
}
@@ -736,6 +737,7 @@ public function parseObjectProperties(
736737
if (count($searchOption) == 0) {
737738
trigger_error("No search option found for $property", E_USER_WARNING);
738739
$TRANSLATE->setLocale($oldLocale);
740+
$_SESSION['glpilanguage'] = $oldLocale;
739741
return $content;
740742
}
741743

@@ -779,6 +781,7 @@ public function parseObjectProperties(
779781
}
780782
// Put the old locales on succes or if an expection was thrown
781783
$TRANSLATE->setLocale($oldLocale);
784+
$_SESSION['glpilanguage'] = $oldLocale;
782785
if ($plug = isPluginItemType($itemtype)) {
783786
Plugin::loadLang(strtolower($plug['plugin']), $oldLocale);
784787
}

0 commit comments

Comments
 (0)