From b0272b4761cc97ea0e83df64e8a56aba934d4528 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 25 Nov 2020 14:04:04 +0100 Subject: [PATCH] =?UTF-8?q?D=C3=A9sactivation=20temporaire=20des=20langues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 15 +- core/core.php | 19 ++- core/module/translate/view/index/index.php | 188 ++++++++++----------- 3 files changed, 107 insertions(+), 115 deletions(-) diff --git a/.gitignore b/.gitignore index 8a247dc6..61c677d4 100755 --- a/.gitignore +++ b/.gitignore @@ -36,9 +36,12 @@ site/data/journal.log .DS_Store site/.DS_Store site/file/.DS_Store -site/tmp/5f7f5e998762c.png -site/tmp/5f7f5e9987628.png -site/tmp/5f7f5ea3e983b.png -site/tmp/5f7f5ea3e9837.png -site/tmp/5f7f5ea20d5eb.png -site/tmp/5f7f5ea20d5ee.png +site/data/es/locale.json +site/data/es/module.json +site/data/es/page.json +site/data/en/locale.json +site/data/en/module.json +site/data/en/page.json +site/data/de/locale.json +site/data/de/module.json +site/data/de/page.json \ No newline at end of file diff --git a/core/core.php b/core/core.php index 9e3889bc..b55c6117 100755 --- a/core/core.php +++ b/core/core.php @@ -44,7 +44,7 @@ class common { const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '10.4.00.007'; + const ZWII_VERSION = '10.4.00.008'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -151,6 +151,8 @@ class common { 'nl' => 'Néerlandais (nl)', 'pt' => 'Portugais (pt)', ]; + // Langue courante + public static $i18nCurrent = 'fr'; public static $timezone; private $url = ''; // Données de site @@ -189,13 +191,18 @@ class common { $this->input['_COOKIE'] = $_COOKIE; } + // Déterminer le dossier de langues + if (isset($_POST['ZWII_USER_I18N'])) { + self::$i18nCurrent = $_POST['ZWII_USER_I18N']; + } + // Instanciation de la classe des entrées / sorties // Récupére les descripteurs foreach ($this->dataFiles as $keys => $value) { // Constructeur JsonDB $this->dataFiles[$keys] = new \Prowebcraft\JsonDb([ 'name' => $keys . '.json', - 'dir' => $this->dirData ($keys,'fr') + 'dir' => $this->dirData ($keys,self::$i18nCurrent) ]);; } @@ -215,9 +222,9 @@ class common { // Installation fraîche, initialisation des modules manquants // La langue d'installation par défaut est fr foreach ($this->dataFiles as $stageId => $item) { - $folder = $this->dirData ($stageId, 'fr'); + $folder = $this->dirData ($stageId, self::$i18nCurrent); if (file_exists($folder . $stageId .'.json') === false) { - $this->initData($stageId,'fr'); + $this->initData($stageId,self::$i18nCurrent); common::$coreNotices [] = $stageId ; } } @@ -2176,7 +2183,7 @@ class core extends common { } } - // Chargement de la librairie ggogtrans + // Chargement de la librairie googtrans // Le multi langue est actif if ($this->getData(['config','translate','scriptGoogle']) === true ) { // la traduction auto est active @@ -2932,7 +2939,7 @@ class layout extends common { if($this->getUser('group') >= self::GROUP_ADMIN) { $rightItems .= '
  • ' . template::ico('users') . '
  • '; $rightItems .= '
  • ' . template::ico('brush') . '
  • '; - $rightItems .= '
  • ' . template::ico('flag') . '
  • '; + //$rightItems .= '
  • ' . template::ico('flag') . '
  • '; $rightItems .= '
  • ' . template::ico('cog-alt') . '
  • '; // Mise à jour automatique $today = mktime(0, 0, 0); diff --git a/core/module/translate/view/index/index.php b/core/module/translate/view/index/index.php index 5cd45996..1dd188b6 100755 --- a/core/module/translate/view/index/index.php +++ b/core/module/translate/view/index/index.php @@ -15,125 +15,107 @@
    -

    Traduction automatique (Google Translate)

    +

    Langues supportées

    - $this->getData(['config','translate', 'scriptGoogle']) - ]); ?> -
    -
    -
    -
    - $this->getData(['config','translate', 'autoDetect']), - 'help' => 'Détecte la langue du navigateur.' - ]); ?> -
    -
    - $this->getData(['config','translate', 'scriptFR']) - ]); ?> -
    -
    + Traduction automatique : +
    $this->getData(['config','translate', 'scriptDE']) ]); ?> -
    -
    - $this->getData(['config','translate', 'scriptEN']) - ]); ?> -
    -
    -
    -
    - $this->getData(['config','translate', 'scriptES']) +
    +
    + $this->getData(['config','translate', 'scriptEN']) ]); ?> -
    -
    - $this->getData(['config','translate', 'scriptIT']) - ]); ?> -
    -
    - $this->getData(['config','translate', 'scriptNL']) - ]); ?> -
    -
    - $this->getData(['config','translate', 'scriptPT']) - ]); ?> -
    -
    -
    -
    - $this->getData(['config','translate', 'admin']), - 'help' => 'Traduction automatique du site et de l\'interface du CMS' +
    +
    + $this->getData(['config','translate', 'scriptES']) + ]); ?> +
    +
    + $this->getData(['config','translate', 'scriptIT']) ]); ?> +
    +
    + $this->getData(['config','translate', 'scriptNL']) + ]); ?> +
    +
    + $this->getData(['config','translate', 'scriptPT']) + ]); ?> +
    +
    + $this->getData(['config','translate', 'autoDetect']), + 'help' => 'Détecte la langue du navigateur.' + ]); ?> + +
    - $this->getData(['config','translate', 'showCredits']), - 'help' => 'Option vivement recommandée pour le respect du droit d\'auteur' - ]); ?> + Traduction rédigée : +
    + $this->getData(['config', 'translate', 'siteEN']) + ]); ?> +
    +
    + $this->getData(['config', 'translate', 'siteDE']) + ]); ?> +
    +
    + $this->getData(['config', 'translate', 'siteES']) + ]); ?> +
    +
    + $this->getData(['config', 'translate', 'siteIT']) + ]); ?> +
    +
    + $this->getData(['config', 'translate', 'siteNL']) + ]); ?> +
    +
    + $this->getData(['config', 'translate', 'sitePT']) + ]); ?> +
    -
    -
    -

    Traduction rédigée

    -
    -
    - $this->getData(['config','translate', 'site']) +
    +
    +

    Paramètres de traduction automatique

    +
    +
    + $this->getData(['config','translate', 'scriptGoogle']) + ]); ?> +
    +
    + $this->getData(['config','translate', 'admin']), + 'help' => 'Traduction automatique du site et de l\'interface du CMS' + ]); ?> +
    +
    + $this->getData(['config','translate', 'showCredits']), + 'help' => 'Option vivement recommandée pour le respect du droit d\'auteur' ]); ?> -
    -
    - Sélectionnez les langues à activer : -
    -
    - $this->getData(['config', 'translate', 'siteFR']) - ]); ?> -
    -
    - $this->getData(['config', 'translate', 'siteDE']) - ]); ?> -
    -
    - $this->getData(['config', 'translate', 'siteEN']) - ]); ?> -
    -
    - $this->getData(['config', 'translate', 'siteES']) - ]); ?> -
    -
    -
    -
    - $this->getData(['config', 'translate', 'siteIT']) - ]); ?> -
    -
    - $this->getData(['config', 'translate', 'siteNL']) - ]); ?> -
    -
    - $this->getData(['config', 'translate', 'sitePT']) - ]); ?> +