Skip to content

Commit

Permalink
fix(form): forms not translated on central tab
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry committed Aug 13, 2021
1 parent 623728a commit f7a6ec8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2158,7 +2158,7 @@ public function enableDocumentType() {
* show list of available forms
*/
public function showForCentral() {
global $DB, $CFG_GLPI;
global $DB, $CFG_GLPI, $TRANSLATE;

// Define tables
$form_table = PluginFormcreatorForm::getTable();
Expand Down Expand Up @@ -2214,7 +2214,11 @@ public function showForCentral() {

// Show a row for the form
$language = $_SESSION['glpilanguage'];
$domain = PluginFormcreatorForm::getTranslationDomain($language, $row['id']);
$domain = PluginFormcreatorForm::getTranslationDomain($row['id'], $language);
$phpfile = self::getTranslationFile($row['id'], $_SESSION['glpilanguage']);
if (file_exists($phpfile)) {
$TRANSLATE->addTranslationFile('phparray', $phpfile, $domain, $_SESSION['glpilanguage']);
}

echo '<tr class="tab_bg_' . ($i % 2 +1) . '" data-itemtype="PluginFormcreatorForm" data-id="' . $row['id'] . '">';
echo '<td>';
Expand Down

0 comments on commit f7a6ec8

Please sign in to comment.