From cf3fd7b8326717305bce1a7983c26fd50fef14d0 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sun, 12 Feb 2023 18:12:13 +0100 Subject: [PATCH] Rename module gr_GR to el_GR --- core/include/update.inc.php | 11 +++++++++-- core/module/translate/translate.php | 1 - module/blog/i18n/{gr_GR.json => el_GR.json} | 0 module/form/i18n/{gr_GR.json => el_GR.json} | 0 module/gallery/i18n/{gr_GR.json => el_GR.json} | 0 module/news/i18n/{gr_GR.json => el_GR.json} | 0 module/redirection/i18n/{gr_GR.json => el_GR.json} | 0 module/search/i18n/{gr_GR.json => el_GR.json} | 0 8 files changed, 9 insertions(+), 3 deletions(-) rename module/blog/i18n/{gr_GR.json => el_GR.json} (100%) rename module/form/i18n/{gr_GR.json => el_GR.json} (100%) rename module/gallery/i18n/{gr_GR.json => el_GR.json} (100%) rename module/news/i18n/{gr_GR.json => el_GR.json} (100%) rename module/redirection/i18n/{gr_GR.json => el_GR.json} (100%) rename module/search/i18n/{gr_GR.json => el_GR.json} (100%) diff --git a/core/include/update.inc.php b/core/include/update.inc.php index e853c39b..66339378 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -937,12 +937,19 @@ if ($this->getData(['core', 'dataVersion']) < 12204) { unlink('core\module\install\ressource\i18n\gr_GR.json'); } if (file_exists(self::I18N_DIR . 'gr_GR.json')) { - copy(self::I18N_DIR . 'gr_GR.json', self::I18N_DIR . 'el_GR.json'); - unlink(self::I18N_DIR . 'gr_GR.json'); + rename(self::I18N_DIR . 'gr_GR.json', self::I18N_DIR . 'el_GR.json'); } $d = $this->getData(['languages', 'gr_GR']); $this->setData(['languages', 'el_GR', $d]); $this->deleteData(['languages', 'gr_GR']); + // Idem pour les modules + $moduleIds = ['blog', 'news', 'gallery', 'search', 'redirection', 'form']; + foreach($moduleIds as $key => $value) { + if (file_exists('module/' . $value . '/i18n/gr_GR.json' )) + { + rename ('module/' . $value . '/i18n/gr_GR.json', 'module/' . $value . '/i18n/el_GR.json'); + } + } // Mise à jour $this->setData(['core', 'dataVersion', 12204]); } \ No newline at end of file diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 15e04283..9eee8c6a 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -181,7 +181,6 @@ class translate extends common foreach($installedUI as $key => $value) { if ($store[$key]['version'] > $value['version']) { - echo copy('core/module/install/ressource/i18n/' . $key . '.json', self::I18N_DIR . $key . '.json'); $this->setData(['languages', $key, $store[$key]]); } } diff --git a/module/blog/i18n/gr_GR.json b/module/blog/i18n/el_GR.json similarity index 100% rename from module/blog/i18n/gr_GR.json rename to module/blog/i18n/el_GR.json diff --git a/module/form/i18n/gr_GR.json b/module/form/i18n/el_GR.json similarity index 100% rename from module/form/i18n/gr_GR.json rename to module/form/i18n/el_GR.json diff --git a/module/gallery/i18n/gr_GR.json b/module/gallery/i18n/el_GR.json similarity index 100% rename from module/gallery/i18n/gr_GR.json rename to module/gallery/i18n/el_GR.json diff --git a/module/news/i18n/gr_GR.json b/module/news/i18n/el_GR.json similarity index 100% rename from module/news/i18n/gr_GR.json rename to module/news/i18n/el_GR.json diff --git a/module/redirection/i18n/gr_GR.json b/module/redirection/i18n/el_GR.json similarity index 100% rename from module/redirection/i18n/gr_GR.json rename to module/redirection/i18n/el_GR.json diff --git a/module/search/i18n/gr_GR.json b/module/search/i18n/el_GR.json similarity index 100% rename from module/search/i18n/gr_GR.json rename to module/search/i18n/el_GR.json