From 49e0379cfd06b32d14b95fa2f58b45f4b8d508a7 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 27 Aug 2023 22:51:44 +0200 Subject: [PATCH] test update language on update --- core/module/install/install.php | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/core/module/install/install.php b/core/module/install/install.php index 7c4eeadd..1f4dcdee 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -380,22 +380,6 @@ class install extends common $message = ''; $rewrite = $this->getInput('data'); - /** - * Met à jour les dictionnaires des langues depuis les nouveaux modèles installés - */ - require_once('core/module/install/ressource/defaultdata.php'); - $installedLanguages = $this->getData(['language']); - $defaultLanguages = init::$defaultData['language']; - foreach ($installedLanguages as $key => $value) { - if ( - isset($defaultLanguages[$key]['version']) && - $defaultLanguages[$key]['version'] > $value['version'] - ) { - copy('core/module/install/ressource/i18n/' . $key . '.json', self::I18N_DIR . $key . '.json'); - $this->setData(['language', $key, $defaultLanguages[$key]]); - } - } - /** * Restaure le fichier htaccess */ @@ -435,6 +419,23 @@ class install extends common } } + /** + * Met à jour les dictionnaires des langues depuis les nouveaux modèles installés + */ + require_once('core/module/install/ressource/defaultdata.php'); + $installedLanguages = $this->getData(['language']); + $defaultLanguages = init::$defaultData['language']; + foreach ($installedLanguages as $key => $value) { + if ( + isset($defaultLanguages[$key]['version']) && + $defaultLanguages[$key]['version'] > $value['version'] + ) { + copy('core/module/install/ressource/i18n/' . $key . '.json', self::I18N_DIR . $key . '.json'); + $this->setData(['language', $key, $defaultLanguages[$key]]); + } + } + die(); + // Valeurs en sortie $this->addOutput([ 'display' => self::DISPLAY_JSON,