From 2abcc365ae1fd24cf44362527681cc9d6b87f194 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 26 Nov 2020 12:42:47 +0100 Subject: [PATCH] =?UTF-8?q?Bug=20autoDetect=20+=20Drapeau=20s=C3=A9lection?= =?UTF-8?q?n=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 22 ++++++++++++++++++---- core/layout/common.css | 8 ++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/core/core.php b/core/core.php index ee17187d..4c130d8a 100755 --- a/core/core.php +++ b/core/core.php @@ -239,10 +239,11 @@ class common { } // Traduction du site avec le script Google - // Lire la langue du navigateur - if ( $this->getData(['config','translate','scriptGoogle']) === true - AND $this->getData(['config','translate','autoDetect']) === true) { + // Lire la langue du navigateur si non positionnée + if ( $this->getData(['config','translate','scriptGoogle']) === true + AND $this->getData(['config','translate','autoDetect']) === true + AND !isset($_COOKIE['googtrans'])) { // Langue du navigateur if(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { setrawcookie("googtrans", '/fr/'. $_SERVER['HTTP_ACCEPT_LANGUAGE'], time() + 3600, helper::baseUrl()); @@ -3038,8 +3039,21 @@ class layout extends common { AND $this->getData(['config','translate',$key]) === 'script' ) ) { + if ( + (isset($_COOKIE['googtrans'] ) + AND substr($_COOKIE['googtrans'],4,2) === $key + ) + OR + ( isset($_COOKIE['ZWII_I18N_SITE']) + AND $_COOKIE['ZWII_I18N_SITE'] === $key + ) ) { + $select = ' id="i18nFlagSelected" '; + } else { + $select = ' id="i18nFlag" '; + } + echo '
  • '; - echo ''; + echo ''; echo '
  • '; } } diff --git a/core/layout/common.css b/core/layout/common.css index c4fbd252..91da0a5e 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -727,8 +727,12 @@ li .menuSideChild { } -#i18nContainer img { - width: 80%; +#i18nFlag { + width: 70%; +} + +#i18nFlagSelected { + width: 90%; }