From a08c5fc66111091324aff469da4f9cb9c86c9e3b Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Mon, 18 Nov 2019 09:47:39 +0100 Subject: [PATCH] =?UTF-8?q?[10.0.110.dev]=20persistance=20de=20la=20sessio?= =?UTF-8?q?n=20en=20langue=20=C3=A9trang=C3=A8re=20en=20cas=20de=20reset?= =?UTF-8?q?=20du=20dossier=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/core.php b/core/core.php index b5c2cb00..af448c1a 100644 --- a/core/core.php +++ b/core/core.php @@ -32,7 +32,7 @@ class common { const I18N_DIR = 'site/i18n/'; // Numéro de version - const ZWII_VERSION = '10.0.109.dev'; + const ZWII_VERSION = '10.0.110.dev'; public static $actions = []; public static $coreModuleIds = [ @@ -169,7 +169,6 @@ class common { common::$importNotices [] = "Importation réalisée avec succès" ; //echo ''; } - // Installation fraîche, initialisation des modules manquants // La langue d'installation par défaut est fr foreach (self::$dataStage as $stageId) { @@ -197,6 +196,13 @@ class common { // Détermine la langue selon la priorité $i18nFrontEnd = $i18nPOST === '' ? $i18nHTTP : $i18nPOST; + // Vérifier la validité de la langue sélectionnée sinon fr + if ( !file_exists(self::DATA_DIR . $i18nFrontEnd . 'page.json') && + !file_exists(self::DATA_DIR . $i18nFrontEnd . 'module.json') ) { + $i18nFrontEnd = 'fr'; + $_SESSION['ZWII_USER_I18N'] = 'fr'; + } + // Sauvegarder la sélection $this->seti18N($i18nFrontEnd); @@ -2212,7 +2218,7 @@ class layout extends common { } echo '
' . $this->core->output['content'] . '
'; if ($this->getData(['config','i18n',$this->geti18n(),'autoTranslate']) === true) { - echo '
'; + echo '
'; } }