Skip to content

Commit a61cbf6

Browse files
committed
fix(form): form title not translated in service catalog
Signed-off-by: Thierry Bugier <[email protected]> #fix 2277
1 parent 2e1ae1a commit a61cbf6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

inc/form.class.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ public function showWizard($service_catalog = false) : void {
852852
* @return array
853853
*/
854854
public function showFormList(int $rootCategory = 0, string $keywords = '', bool $helpdeskHome = false) : array {
855-
global $DB;
855+
global $DB, $TRANSLATE;
856856

857857
$table_cat = getTableForItemType('PluginFormcreatorCategory');
858858
$table_form = getTableForItemType('PluginFormcreatorForm');
@@ -963,9 +963,15 @@ public function showFormList(int $rootCategory = 0, string $keywords = '', bool
963963
$formList = [];
964964
if ($result_forms->count() > 0) {
965965
foreach ($result_forms as $form) {
966+
// load thanguage for the form, if any
967+
$domain = self::getTranslationDomain($form['id']);
968+
$phpfile = self::getTranslationFile($form['id'], $_SESSION['glpilanguage']);
969+
if (file_exists($phpfile)) {
970+
$TRANSLATE->addTranslationFile('phparray', $phpfile, $domain, $_SESSION['glpilanguage']);
971+
}
966972
$formList[] = [
967973
'id' => $form['id'],
968-
'name' => $form['name'],
974+
'name' => __($form['name'], $domain),
969975
'icon' => $form['icon'],
970976
'icon_color' => $form['icon_color'],
971977
'background_color' => $form['background_color'],

0 commit comments

Comments
 (0)