diff --git a/core/core.php b/core/core.php index cb489a8c..9f452b68 100644 --- a/core/core.php +++ b/core/core.php @@ -154,37 +154,46 @@ class common { // Langue de l'interface sélectionnée public static $i18nUI = 'fr_FR'; public static $languagesUI = [ - 'ca' => 'Català, valencià', - 'da' => 'Dansk', + 'az_AZ' => 'Azərbaycan dili', + 'bg_BG' => 'български език', + //'ca' => 'Català, valencià', + //'cs' => 'čeština, český jazyk', + //'da' => 'Dansk', 'de' => 'Deutsch', 'en_EN' => 'English', 'es' => 'Español', + //'fa' => 'فارسی', 'fr_FR' => 'Français', + //'he_IL' => 'Hebrew (Israel)', + 'hr' => 'Hrvatski jezik', + 'hu_HU' => 'Magyar', + 'id' => 'Bahasa Indonesia', 'it' => 'Italiano', + 'ja' => '日本', + 'lt' => 'Lietuvių kalba', + //'mn_MN' => 'монгол', + 'nb_NO' => 'Norsk bokmål', + 'nn_NO' => 'Norsk nynorsk', 'nl' => 'Nederlands, Vlaams', 'pl' => 'Język polski, polszczyzna', + 'pt_BR' => 'Português(Brazil)', 'pt_PT' => 'Português', 'ro' => 'Română', + 'ru' => 'Pусский язык', + 'sk' => 'Slovenčina', + 'sl' => 'Slovenski jezik', 'sv_SE' => 'Svenska', - 'tr_TR' => 'Türkçe' - + 'th_TH' => 'ไทย', + 'tr_TR' => 'Türkçe', + 'uk_UA' => 'Yкраїнська мова', + 'vi' => 'Tiếng Việt', + 'zh_CN' => '中文 (Zhōngwén), 汉语, 漢語', + // source: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ]; // Langues de contenu - // Sélection de langue de l'interface - public static $i18nContent = 'fr'; - public static $languagesContent = [ - 'fr' => 'Français (fr)', - 'de' => 'Deutsch (de)', - 'en' => 'English (en)', - 'es' => 'Español (es)', - 'it' => 'Italiano (it)', - 'nl' => 'Nederlands, Vlaams (nl)', - 'pt' => 'Português (pt)', - 'tr' => 'Türkçe' - ]; - + public static $i18nContent = 'fr_FR'; // Zone de temps public static $timezone; @@ -303,7 +312,7 @@ class common { setlocale (LC_TIME, self::$i18nContent . '_' . strtoupper (self::$i18nContent) ); } else { // Absence du cookie, la langue par défaut est celle de l'interface. - self::$i18nContent = (isset(self::$i18nUI)) ? substr(self::$i18nUI, 0, 2) : 'fr'; + self::$i18nContent = (isset(self::$i18nUI)) ? self::$i18nUI : 'fr_FR'; } // Instanciation de la classe des entrées / sorties @@ -334,7 +343,7 @@ class common { self::$i18nUI = $this->getData(['config', 'i18n', 'interface']); // La langue par défaut du contenu est celle du site si le cookie est absent. self::$i18nUI = (empty(self::$i18nUI) || is_null(self::$i18nUI)) ? self::$i18nUI = 'fr_FR' : self::$i18nUI ; - + // Le fichier existe-t-il ? if (!file_exists(self::I18N_DIR . self::$i18nUI . '.json')) { @@ -2186,7 +2195,7 @@ class common { * Affiche le cadre avec les drapeaux sélectionnés */ public function showi18n() { - foreach (self::$languagesContent as $key => $value) { + foreach (self::$languagesUI as $key => $value) { if ($this->getData(['config', 'i18n', $key]) === 'site' ) { if ( diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 8e0aaf44..938b8060 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -853,6 +853,20 @@ if ($this->getData(['core', 'dataVersion']) < 11506) { // Version 11.6.00 if ($this->getData(['core', 'dataVersion']) < 11600) { + // Correspondance pour les dossiers de langue à convertir + $languages = [ + 'fr' => 'fr_FR', + 'en' => 'en_EN', + 'pt' => 'pt_PT' + ]; + // COnvertit les dossiers vers la nouvelle structure + foreach($languages as $key => $value) { + if (is_dir(self::DATA_DIR . $key)) { + $this->copyDir(self::DATA_DIR . $key, self::DATA_DIR . $value); + $this->removeDir(self::DATA_DIR . $key); + } + } + // Supprime un cookie non nécessaire helper::deleteCookie('ZWII_USER_LONGTIME'); diff --git a/core/module/plugin/plugin.php b/core/module/plugin/plugin.php index 9c433413..7ac3b1c1 100644 --- a/core/module/plugin/plugin.php +++ b/core/module/plugin/plugin.php @@ -408,7 +408,7 @@ class plugin extends common { public function index() { // Tableau des langues rédigées - foreach (self::$languagesContent as $key => $value) { + foreach (self::$languagesUI as $key => $value) { if ($this->getData(['config','i18n', $key]) === 'site' || $key === 'fr') { $i18nSites[$key] = $value; diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 86bb1aa8..c65d4176 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -24,7 +24,7 @@ class translate extends common { // Language content public static $translateOptions = []; - // Page pour la configuration dans la langue + // Page pour la configuration dans la langue public static $pagesList = []; public static $orphansList = []; // Liste des langues installées @@ -34,7 +34,7 @@ class translate extends common { // Activation du bouton de copie public static $siteTranslate = true; - //UI + //UI // Fichiers des langues de l'interface public static $i18nFiles = []; @@ -65,7 +65,7 @@ class translate extends common { // Enregistrer la langue if ($success) { $this->setData(['config', 'i18n', $toCreate, 'site' ]); - $notification = 'Données ' . self::$languagesContent[$copyFrom] . ' copiées vers ' . self::$languagesContent[$toCreate]; + $notification = 'Données ' . self::$languagesUI[$copyFrom] . ' copiées vers ' . self::$languagesUI[$toCreate]; } else { $notification = "Quelque chose n\'a pas fonctionné, vérifiez les permissions."; } @@ -82,7 +82,7 @@ class translate extends common { ]); } // Tableau des langues installées - foreach (self::$languagesContent as $key => $value) { + foreach (self::$languagesUI as $key => $value) { if ($this->getData(['config','i18n', $key]) === 'site') { self::$languagesTarget[$key] = $value; } @@ -105,7 +105,7 @@ class translate extends common { // Soumission du formulaire if($this->isPost()) { // Edition des langues - foreach (self::$languagesContent as $keyi18n => $value) { + foreach (self::$languagesUI as $keyi18n => $value) { if ($keyi18n === 'fr') continue; // Effacement d'une langue installée @@ -198,7 +198,7 @@ class translate extends common { 'state' => true ]); } - + // Préparation de l'affichage du formulaire // Liste des langues disponibles @@ -217,7 +217,7 @@ class translate extends common { } // Modification des options de suppression de la langue installée. - foreach (self::$languagesContent as $key => $value) { + foreach (self::$languagesUI as $key => $value) { if ($this->getData(['config','i18n',$key]) === 'site') { self::$translateOptions [$key] = [ 'none' => 'Drapeau masqué', diff --git a/core/module/translate/view/index/index.php b/core/module/translate/view/index/index.php index 97f6b6b4..2792cc07 100644 --- a/core/module/translate/view/index/index.php +++ b/core/module/translate/view/index/index.php @@ -60,7 +60,7 @@ - +
@@ -318,4 +318,5 @@
+ **/ ?> diff --git a/core/vendor/i18n/png/az_AZ.png b/core/vendor/i18n/png/az_AZ.png new file mode 100644 index 00000000..6a942fc8 Binary files /dev/null and b/core/vendor/i18n/png/az_AZ.png differ diff --git a/core/vendor/i18n/png/bg_BG.png b/core/vendor/i18n/png/bg_BG.png new file mode 100644 index 00000000..ca0cba6d Binary files /dev/null and b/core/vendor/i18n/png/bg_BG.png differ diff --git a/core/vendor/i18n/png/de.png b/core/vendor/i18n/png/de.png index cf8cf158..64f97773 100644 Binary files a/core/vendor/i18n/png/de.png and b/core/vendor/i18n/png/de.png differ diff --git a/core/vendor/i18n/png/en.png b/core/vendor/i18n/png/en.png deleted file mode 100644 index a11a31db..00000000 Binary files a/core/vendor/i18n/png/en.png and /dev/null differ diff --git a/core/vendor/i18n/png/es.png b/core/vendor/i18n/png/es.png index a8ad334c..4438d6a1 100644 Binary files a/core/vendor/i18n/png/es.png and b/core/vendor/i18n/png/es.png differ diff --git a/core/vendor/i18n/png/fr.png b/core/vendor/i18n/png/fr.png deleted file mode 100644 index a7684766..00000000 Binary files a/core/vendor/i18n/png/fr.png and /dev/null differ diff --git a/core/vendor/i18n/png/fr_FR.png b/core/vendor/i18n/png/fr_FR.png new file mode 100644 index 00000000..fd06f848 Binary files /dev/null and b/core/vendor/i18n/png/fr_FR.png differ diff --git a/core/vendor/i18n/png/he_IL.png b/core/vendor/i18n/png/he_IL.png new file mode 100644 index 00000000..871a9db9 Binary files /dev/null and b/core/vendor/i18n/png/he_IL.png differ diff --git a/core/vendor/i18n/png/hr.png b/core/vendor/i18n/png/hr.png new file mode 100644 index 00000000..1dc15e24 Binary files /dev/null and b/core/vendor/i18n/png/hr.png differ diff --git a/core/vendor/i18n/png/hu_HU.png b/core/vendor/i18n/png/hu_HU.png new file mode 100644 index 00000000..d82edfcd Binary files /dev/null and b/core/vendor/i18n/png/hu_HU.png differ diff --git a/core/vendor/i18n/png/id.png b/core/vendor/i18n/png/id.png new file mode 100644 index 00000000..d1374bf6 Binary files /dev/null and b/core/vendor/i18n/png/id.png differ diff --git a/core/vendor/i18n/png/it.png b/core/vendor/i18n/png/it.png index d62e50b2..bb394d9f 100644 Binary files a/core/vendor/i18n/png/it.png and b/core/vendor/i18n/png/it.png differ diff --git a/core/vendor/i18n/png/ja.png b/core/vendor/i18n/png/ja.png new file mode 100644 index 00000000..d2517a39 Binary files /dev/null and b/core/vendor/i18n/png/ja.png differ diff --git a/core/vendor/i18n/png/lt.png b/core/vendor/i18n/png/lt.png new file mode 100644 index 00000000..6b60fd17 Binary files /dev/null and b/core/vendor/i18n/png/lt.png differ diff --git a/core/vendor/i18n/png/nb_NO.png b/core/vendor/i18n/png/nb_NO.png new file mode 100644 index 00000000..ab5146e4 Binary files /dev/null and b/core/vendor/i18n/png/nb_NO.png differ diff --git a/core/vendor/i18n/png/nl.png b/core/vendor/i18n/png/nl.png index aeb72b66..794e27f5 100644 Binary files a/core/vendor/i18n/png/nl.png and b/core/vendor/i18n/png/nl.png differ diff --git a/core/vendor/i18n/png/nn_NO.png b/core/vendor/i18n/png/nn_NO.png new file mode 100644 index 00000000..ab5146e4 Binary files /dev/null and b/core/vendor/i18n/png/nn_NO.png differ diff --git a/core/vendor/i18n/png/pl.png b/core/vendor/i18n/png/pl.png new file mode 100644 index 00000000..644b20e9 Binary files /dev/null and b/core/vendor/i18n/png/pl.png differ diff --git a/core/vendor/i18n/png/pt.png b/core/vendor/i18n/png/pt.png deleted file mode 100644 index e0619bc9..00000000 Binary files a/core/vendor/i18n/png/pt.png and /dev/null differ diff --git a/core/vendor/i18n/png/pt_BR.png b/core/vendor/i18n/png/pt_BR.png new file mode 100644 index 00000000..41b82bcc Binary files /dev/null and b/core/vendor/i18n/png/pt_BR.png differ diff --git a/core/vendor/i18n/png/pt_PT.png b/core/vendor/i18n/png/pt_PT.png new file mode 100644 index 00000000..6c2af784 Binary files /dev/null and b/core/vendor/i18n/png/pt_PT.png differ diff --git a/core/vendor/i18n/png/ro.png b/core/vendor/i18n/png/ro.png new file mode 100644 index 00000000..6357b2b2 Binary files /dev/null and b/core/vendor/i18n/png/ro.png differ diff --git a/core/vendor/i18n/png/ru.png b/core/vendor/i18n/png/ru.png new file mode 100644 index 00000000..2412cede Binary files /dev/null and b/core/vendor/i18n/png/ru.png differ diff --git a/core/vendor/i18n/png/sk.png b/core/vendor/i18n/png/sk.png new file mode 100644 index 00000000..393bf0a3 Binary files /dev/null and b/core/vendor/i18n/png/sk.png differ diff --git a/core/vendor/i18n/png/sl.png b/core/vendor/i18n/png/sl.png new file mode 100644 index 00000000..8bb19960 Binary files /dev/null and b/core/vendor/i18n/png/sl.png differ diff --git a/core/vendor/i18n/png/sv_SE.png b/core/vendor/i18n/png/sv_SE.png new file mode 100644 index 00000000..7b62bc6a Binary files /dev/null and b/core/vendor/i18n/png/sv_SE.png differ diff --git a/core/vendor/i18n/png/th_TH.png b/core/vendor/i18n/png/th_TH.png new file mode 100644 index 00000000..a49ac81e Binary files /dev/null and b/core/vendor/i18n/png/th_TH.png differ diff --git a/core/vendor/i18n/png/tr_TR.png b/core/vendor/i18n/png/tr_TR.png new file mode 100644 index 00000000..6c6b1b3f Binary files /dev/null and b/core/vendor/i18n/png/tr_TR.png differ diff --git a/core/vendor/i18n/png/uk_UA.png b/core/vendor/i18n/png/uk_UA.png new file mode 100644 index 00000000..3e71d69a Binary files /dev/null and b/core/vendor/i18n/png/uk_UA.png differ diff --git a/core/vendor/i18n/png/vi.png b/core/vendor/i18n/png/vi.png new file mode 100644 index 00000000..700880a7 Binary files /dev/null and b/core/vendor/i18n/png/vi.png differ diff --git a/core/vendor/i18n/png/zh_CN.png b/core/vendor/i18n/png/zh_CN.png new file mode 100644 index 00000000..e653394b Binary files /dev/null and b/core/vendor/i18n/png/zh_CN.png differ