From 7f9f97c6a229ddc7eb8a384da348e126cc0a0653 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Wed, 28 Sep 2022 14:58:21 +0200 Subject: [PATCH] =?UTF-8?q?fr=5FFR=20template=20Flag=20langue=20s=C3=A9lec?= =?UTF-8?q?tionn=C3=A9e=20selected?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/template.class.php | 10 +++++----- core/module/config/config.php | 12 +----------- core/module/plugin/view/dataImport/dataImport.php | 2 +- core/module/theme/view/footer/footer.php | 4 ++-- core/module/translate/translate.php | 2 +- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/core/class/template.class.php b/core/class/template.class.php index 2fba2c1b..8da55f2c 100644 --- a/core/class/template.class.php +++ b/core/class/template.class.php @@ -471,21 +471,21 @@ class template { return $item; } - /** + /** * Crée un drapeau du site courante - * @param string $langId Id de la langue à affiche ou site pour la langue traduite courante + * @param string $langId Id de la langue à affiche ou selected pour la langue courante * @param string $margin Ajoute un margin autour de l'icône (choix : left, right, all) * @return string */ public static function flag($langId, $size = 'auto') { switch ($langId) { case '': - $lang = 'fr'; + $lang = 'fr_FR'; break; - case in_array($langId,['fr_FR', 'de', 'en', 'es', 'it', 'nl', 'pt']): + case in_array($langId,core::$languages): $lang = $langId; break; - case 'site': + case 'selected': if ( isset($_COOKIE['ZWII_I18N_SITE']) ) { $lang = $_COOKIE['ZWII_I18N_SITE']; diff --git a/core/module/config/config.php b/core/module/config/config.php index 17d3783c..be68a087 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -190,7 +190,7 @@ class config extends common { ]; // Langue traduite courante - public static $i18nSite = 'fr'; + public static $i18nSite = 'fr_FR'; // Variable pour construire la liste des pages du site public static $onlineVersion = ''; @@ -493,16 +493,6 @@ 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', 'default']), - 'fr' => $this->getData(['config', 'i18n', 'fr']), - 'de' => $this->getData(['config', 'i18n', 'de']), - 'en' => $this->getData(['config', 'i18n', 'en']), - 'es' => $this->getData(['config', 'i18n', 'es']), - 'it' => $this->getData(['config', 'i18n', 'it']), - 'nl' => $this->getData(['config', 'i18n', 'nl']), - 'pt' => $this->getData(['config', 'i18n', 'pt']) ] ] ]); diff --git a/core/module/plugin/view/dataImport/dataImport.php b/core/module/plugin/view/dataImport/dataImport.php index a7081040..3dc1f998 100644 --- a/core/module/plugin/view/dataImport/dataImport.php +++ b/core/module/plugin/view/dataImport/dataImport.php @@ -28,7 +28,7 @@
'Importer le module dans la page ' . template::flag('site', '20px') + 'label' => 'Importer le module dans la page ' . template::flag('selected', '20px') ]); ?>
diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 8b7c6ec0..821ee177 100644 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -134,7 +134,7 @@
'Aucune'] , helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ - 'label' => 'Page "Mentions légales" ' . template::flag('site', '20px'), + 'label' => 'Page "Mentions légales" ' . template::flag('selected', '20px'), 'selected' => $this->getData(['locale', 'legalPageId']) ]); ?>
@@ -148,7 +148,7 @@
'Aucune'] , helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC') ) , [ - 'label' => 'Page "Rechercher" ' . template::flag('site', '20px'), + 'label' => 'Page "Rechercher" ' . template::flag('selected', '20px'), 'selected' => $this->getData(['locale', 'searchPageId']) ]); ?>
diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 67ff1833..5f2c9106 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -92,7 +92,7 @@ class translate extends common { } } // Langues cibles fr en plus - self::$languagesInstalled = array_merge(['fr' => 'Français (fr)'],self::$languagesTarget); + self::$languagesInstalled = array_merge(['fr_FR' => 'Français (fr_FR)'], self::$languagesTarget); // Valeurs en sortie $this->addOutput([