From cb9ce0fb66117f4a1e7e8d350145428c352d45fc Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Thu, 22 Feb 2024 15:16:16 +0100 Subject: [PATCH] fix(formanswer): translate section name for targets --- inc/formanswer.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/formanswer.class.php b/inc/formanswer.class.php index 9fcde93f4..e3c398c7f 100644 --- a/inc/formanswer.class.php +++ b/inc/formanswer.class.php @@ -1116,6 +1116,8 @@ public function getFullForm($richText = false): string { $formFk = PluginFormcreatorForm::getForeignKeyField(); $fields = $this->getQuestionFields($this->fields[$formFk]); + $domain = PluginFormcreatorForm::getTranslationDomain($this->fields[$formFk]); + $this->deserializeAnswers(); // TODO: code very close to PluginFormcreatorAbstractTarget::parseTags() (factorizable ?) @@ -1168,9 +1170,9 @@ public function getFullForm($richText = false): string { $output .= ($richText ? '

 

' : $eol); } if ($richText) { - $output .= '

' . $question_line['section_name'] . '

'; + $output .= '

' . __($question_line['section_name'], $domain) . '

'; } else { - $output .= $eol . $question_line['section_name'] . $eol; + $output .= $eol . __($question_line['section_name'], $domain) . $eol; $output .= '---------------------------------' . $eol; } $last_section = $question_line[$sectionFk];