From a13bc2ed6d3f1f6fe6b9a78ca490b651a10d914f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Fri, 7 Oct 2022 18:47:30 +0200 Subject: [PATCH] =?UTF-8?q?buh=20s=C3=A9lection=20langue=20de=20l'UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 8 +++++++- core/module/config/config.php | 3 +++ core/module/translate/translate.php | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/core/core.php b/core/core.php index 0834aeae..b576456d 100644 --- a/core/core.php +++ b/core/core.php @@ -1253,7 +1253,13 @@ class common $item .= '

' . $this->getData(['locale', 'cookies', 'titleLabel']) . '

'; $item .= '

' . $this->getData(['locale', 'cookies', 'mainLabel']) . '

'; // Formulaire de réponse - $item .= '
'; + if ( + $this->getData(['locale', 'homePageId']) === $this->getUrl(0) + ) { + $item .= ''; + } else { + $item .= ''; + } $item .= '

'; $item .= ''; $item .= '
'; diff --git a/core/module/config/config.php b/core/module/config/config.php index d01db473..983be0dc 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -505,6 +505,9 @@ class config extends common 'captchaType' => $this->getInput('connectCaptchaType'), 'showPassword' => $this->getInput('connectShowPassword', helper::FILTER_BOOLEAN), 'redirectLogin' => $this->getInput('connectRedirectLogin', helper::FILTER_BOOLEAN) + ], + 'i18n' => [ + 'interface' => $this->getData(['config', 'i18n', 'interface']) ] ] ]); diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 3febb635..2768c149 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -293,6 +293,9 @@ class translate extends common file_put_contents(self::DATA_DIR . $this->getUrl(2) . '/locale.json', json_encode($data, JSON_UNESCAPED_UNICODE), LOCK_EX); } + // Sauvegarde la langue de l'UI + $this->setData(['config', 'i18n', 'interface', $this->getInput('translateUI', null)]); + // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl(),