Skip to content

Commit

Permalink
fix(form): form title not translated in service catalog
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>

#fix 2277
  • Loading branch information
btry committed Jul 6, 2021
1 parent 2e1ae1a commit a61cbf6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ public function showWizard($service_catalog = false) : void {
* @return array
*/
public function showFormList(int $rootCategory = 0, string $keywords = '', bool $helpdeskHome = false) : array {
global $DB;
global $DB, $TRANSLATE;

$table_cat = getTableForItemType('PluginFormcreatorCategory');
$table_form = getTableForItemType('PluginFormcreatorForm');
Expand Down Expand Up @@ -963,9 +963,15 @@ public function showFormList(int $rootCategory = 0, string $keywords = '', bool
$formList = [];
if ($result_forms->count() > 0) {
foreach ($result_forms as $form) {
// load thanguage for the form, if any
$domain = self::getTranslationDomain($form['id']);
$phpfile = self::getTranslationFile($form['id'], $_SESSION['glpilanguage']);
if (file_exists($phpfile)) {
$TRANSLATE->addTranslationFile('phparray', $phpfile, $domain, $_SESSION['glpilanguage']);
}
$formList[] = [
'id' => $form['id'],
'name' => $form['name'],
'name' => __($form['name'], $domain),
'icon' => $form['icon'],
'icon_color' => $form['icon_color'],
'background_color' => $form['background_color'],
Expand Down

0 comments on commit a61cbf6

Please sign in to comment.