buh sélection langue de l'UI

This commit is contained in:
Fred Tempez 2022-10-07 18:47:30 +02:00
parent 72be48405c
commit a13bc2ed6d
3 changed files with 13 additions and 1 deletions

View File

@ -1253,7 +1253,13 @@ class common
$item .= '<h3>' . $this->getData(['locale', 'cookies', 'titleLabel']) . '</h3>';
$item .= '<p>' . $this->getData(['locale', 'cookies', 'mainLabel']) . '</p>';
// Formulaire de réponse
$item .= '<form method="POST" action="' . helper::baseUrl() . $this->getUrl() . '" id="cookieForm">';
if (
$this->getData(['locale', 'homePageId']) === $this->getUrl(0)
) {
$item .= '<form method="POST" action="' . helper::baseUrl(false) . '" id="cookieForm">';
} else {
$item .= '<form method="POST" action="' . helper::baseUrl(true) . $this->getUrl(). '" id="cookieForm">';
}
$item .= '<br><br>';
$item .= '<input type="submit" id="cookieConsentConfirm" value="' . $this->getData(['locale', 'cookies', 'buttonValidLabel']) . '">';
$item .= '</form>';

View File

@ -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'])
]
]
]);

View File

@ -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(),