From 271beb06e987c8871e10a3bbba8d2728fc3a3829 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 18 Jan 2021 19:18:13 +0100 Subject: [PATCH] Trad auto langue du navigateur --- core/core.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/core.php b/core/core.php index eca2c0a7..b4197b7f 100755 --- a/core/core.php +++ b/core/core.php @@ -253,17 +253,14 @@ class common { if ( $this->getData(['config','translate','scriptGoogle']) === true AND $this->getData(['config','translate','autoDetect']) === true - AND $this->getInput('ZWII_I18N_SITE') === '' + AND $this->getInput('ZWII_I18N_SITE') !== '' AND !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ) - { + { /** * Le cookie est prioritaire sur le navigateur * la traduction est celle de la langue du drapeau * */ - if ($this->getInput('ZWII_I18N_SCRIPT') - AND $this->getInput('ZWII_I18N_SCRIPT') !== substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2 ) ) { - setrawcookie('googtrans', '/fr/'.$this->getInput('ZWII_I18N_SCRIPT'), time() + 3600, helper::baseUrl()); - } else { + if ( $this->getInput('ZWII_I18N_SCRIPT') !== substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2 ) ) { setrawcookie('googtrans', '/fr/'.substr( $_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2 ), time() + 3600, helper::baseUrl()); } }