From 6feda013563b0ce3d765894b75bc6a8d967a9990 Mon Sep 17 00:00:00 2001 From: "tristan.champomier" Date: Tue, 8 Jun 2021 19:07:48 +0200 Subject: [PATCH] Added fr_FR.utf8 language code support and defined it as default --- .gitignore | 2 ++ config/config.system.php.install | 2 +- install/check_lang.php | 7 ++-- install/db_scripts/mysql/7_insert_datas.sql | 36 ++++++++++----------- lib/object_coordination/addcom/addcom.php | 4 +-- lib/system/system_utils/xlanguechaine.php | 6 ++-- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index f74a97d..8290eb9 100644 --- a/.gitignore +++ b/.gitignore @@ -101,6 +101,7 @@ data/image/icons/language/ !data/image/icons/language/fo.png !data/image/icons/language/fr_gb.png !data/image/icons/language/fr.png +!data/image/icons/language/fr_FR.utf8.png !data/image/icons/language/ga.png !data/image/icons/language/gb_fr.png !data/image/icons/language/gb.png @@ -1440,6 +1441,7 @@ install/ !install/check_lang.php !install/do_install.php !install/fr_readme_install.txt +!install/fr-FR.utf8_readme_install.txt !install/gb_readme_install.txt !install/index.php !install/lib_install.php diff --git a/config/config.system.php.install b/config/config.system.php.install index 662de86..d3e43c1 100755 --- a/config/config.system.php.install +++ b/config/config.system.php.install @@ -70,7 +70,7 @@ $GLOBALS['SYSTEM_DEFAULT_USER_ADMIN']=2; /* compte par défaut d'administration $GLOBALS['SYSTEM_DEFAULT_USER_GUEST']=1; /* utilisateur anonyme par défaut (1 seul) */ /* Langue par defaut utilisée */ $GLOBALS['SYSTEM_DEFAULT_LANGUAGE']=1; /* identifiant de la langue par défaut */ -$GLOBALS['SYSTEM_DEFAULT_LANGUAGE_CODE']="fr"; /* identifiant de la langue par défaut */ +$GLOBALS['SYSTEM_DEFAULT_LANGUAGE_CODE']="fr_FR.utf8"; /* identifiant de la langue par défaut */ $GLOBALS['SYSTEM_DEFAULT_NODE']=1; /* utilisateur anonyme par défaut (1 seul) */ /* clé system de cryptage */ diff --git a/install/check_lang.php b/install/check_lang.php index 2f8391e..52088ca 100755 --- a/install/check_lang.php +++ b/install/check_lang.php @@ -45,7 +45,8 @@ function check_lang($filetest="") 'de' => 'de([_-][a-z]+)?', 'gb' => 'en([_-][a-z]+)?', 'et' => 'et', - 'fi' => 'fi', + 'fi' => 'fi', + 'fr_FR.utf8' => 'fr_FR.utf8', 'fr' => 'fr([_-][a-z]+)?', 'el' => 'el', 'es-ar' => 'es[_-]ar', @@ -98,9 +99,9 @@ function check_lang($filetest="") { if (preg_match('#' . $match . '#i', trim($accept_lang_array[$i]))) { - if (file_exists(($QWARE_ROOT_PATH . 'data/message/' . strtolower($lang)."/".$filetest))) + if (file_exists(($QWARE_ROOT_PATH . 'data/message/' . $lang."/".$filetest))) { - return strtolower($lang)."/"; + return $lang."/"; } } } diff --git a/install/db_scripts/mysql/7_insert_datas.sql b/install/db_scripts/mysql/7_insert_datas.sql index 5c9b0ab..265e88b 100755 --- a/install/db_scripts/mysql/7_insert_datas.sql +++ b/install/db_scripts/mysql/7_insert_datas.sql @@ -94,22 +94,22 @@ INSERT INTO `{_PREFIX_}package_user_space` VALUES (1, 1, 0, 2147483647); #-- #-- Contenu de la table `coordination_object` #-- -INSERT INTO `{_PREFIX_}coordination_object` VALUES (1, '0000-00-00 00:00:00', 2, 3, 'defaultobject.png', 'AdminObject', '\n\r\n\r\r\n c. Gérer les outils\r\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a333a7b733a31323a22746162466f7262696464656e223b613a303a7b7d733a373a2267726f75704964223b733a313a2231223b733a363a226e6f64654964223b733a313a2231223b7d); -INSERT INTO `{_PREFIX_}coordination_object` VALUES (3, '0000-00-00 00:00:00', 2, 100, 'defaultobject.png', 'Home', '\r\n\r\n\r\n Accueil\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a303a7b7d); -INSERT INTO `{_PREFIX_}coordination_object` VALUES (4, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AdminNode', '\r\n\r\n\r\n b. Gérer les espaces\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a333a7b733a373a2267726f75704964223b693a313b733a363a226e6f64654964223b733a313a2231223b733a383a2274656d706c617465223b613a313a7b693a303b733a373a2264656661756c74223b7d7d); -INSERT INTO `{_PREFIX_}coordination_object` VALUES (5, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AddCom', '\r\n\r\n\r\n a. Créer une communauté\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a303a7b7d); -INSERT INTO `{_PREFIX_}coordination_object` VALUES (6, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AdminGroup', '\r\n\r\n\r\n d. Gérer les groupes\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a313a7b733a373a2267726f75704964223b733a313a2231223b7d); -INSERT INTO `{_PREFIX_}coordination_object` VALUES (7, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AdminEntryNode', '\r\n\r\n\r\n e. Gérer les accès\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a323a7b733a373a2267726f75704964223b733a313a2231223b733a363a226e6f64654964223b733a313a2231223b7d); -INSERT INTO `{_PREFIX_}coordination_object` VALUES (8, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AdminUser', '\r\n\r\n\r\n f. Gérer les comptes\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a313a7b733a373a2267726f75704964223b733a313a2231223b7d); -INSERT INTO `{_PREFIX_}coordination_object` VALUES (35, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'InstallManager', '\r\n\r\n\r\n g. Gérer les mises à jour\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a333a7b733a333a22667470223b733a31373a226d616a2e6772616e69776172652e6e6574223b733a353a226c6f67696e223b733a363a22737461626c65223b733a363a22706173737764223b733a363a22737461626c65223b7d); -INSERT INTO `{_PREFIX_}coordination_object` VALUES (2, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'Community', '\r\n\r\n\r\n Les communautés\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a303a7b7d); +INSERT INTO `{_PREFIX_}coordination_object` VALUES (1, '0000-00-00 00:00:00', 2, 3, 'defaultobject.png', 'AdminObject', '\n\r\n\r\r\n c. Gérer les outils\r\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a333a7b733a31323a22746162466f7262696464656e223b613a303a7b7d733a373a2267726f75704964223b733a313a2231223b733a363a226e6f64654964223b733a313a2231223b7d); +INSERT INTO `{_PREFIX_}coordination_object` VALUES (3, '0000-00-00 00:00:00', 2, 100, 'defaultobject.png', 'Home', '\r\n\r\n\r\n Accueil\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a303a7b7d); +INSERT INTO `{_PREFIX_}coordination_object` VALUES (4, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AdminNode', '\r\n\r\n\r\n b. Gérer les espaces\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a333a7b733a373a2267726f75704964223b693a313b733a363a226e6f64654964223b733a313a2231223b733a383a2274656d706c617465223b613a313a7b693a303b733a373a2264656661756c74223b7d7d); +INSERT INTO `{_PREFIX_}coordination_object` VALUES (5, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AddCom', '\r\n\r\n\r\n a. Créer une communauté\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a303a7b7d); +INSERT INTO `{_PREFIX_}coordination_object` VALUES (6, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AdminGroup', '\r\n\r\n\r\n d. Gérer les groupes\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a313a7b733a373a2267726f75704964223b733a313a2231223b7d); +INSERT INTO `{_PREFIX_}coordination_object` VALUES (7, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AdminEntryNode', '\r\n\r\n\r\n e. Gérer les accès\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a323a7b733a373a2267726f75704964223b733a313a2231223b733a363a226e6f64654964223b733a313a2231223b7d); +INSERT INTO `{_PREFIX_}coordination_object` VALUES (8, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'AdminUser', '\r\n\r\n\r\n f. Gérer les comptes\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a313a7b733a373a2267726f75704964223b733a313a2231223b7d); +INSERT INTO `{_PREFIX_}coordination_object` VALUES (35, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'InstallManager', '\r\n\r\n\r\n g. Gérer les mises à jour\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a333a7b733a333a22667470223b733a31373a226d616a2e6772616e69776172652e6e6574223b733a353a226c6f67696e223b733a363a22737461626c65223b733a363a22706173737764223b733a363a22737461626c65223b7d); +INSERT INTO `{_PREFIX_}coordination_object` VALUES (2, '0000-00-00 00:00:00', 2, 99, 'defaultobject.png', 'Community', '\r\n\r\n\r\n Les communautés\r\n\r\n\r\n', '', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0x613a303a7b7d); #----------------------------------------------------------- #-- #-- Contenu de la table `group` #-- -INSERT INTO `{_PREFIX_}group` VALUES (1, 0, '\r\n\r\n\r\nTous les utilisateurs\r\n\r\n\r\n', ''); -INSERT INTO `{_PREFIX_}group` VALUES (2, 1, '\r\n\r\n\r\nAnonyme\r\n\r\n\r\n', ''); -INSERT INTO `{_PREFIX_}group` VALUES (3, 1, '\r\n\r\n\r\nAdministrateur\r\n\r\n\r\n', 'defaultnode.png'); +INSERT INTO `{_PREFIX_}group` VALUES (1, 0, '\r\n\r\n\r\nTous les utilisateurs\r\n\r\n\r\n', ''); +INSERT INTO `{_PREFIX_}group` VALUES (2, 1, '\r\n\r\n\r\nAnonyme\r\n\r\n\r\n', ''); +INSERT INTO `{_PREFIX_}group` VALUES (3, 1, '\r\n\r\n\r\nAdministrateur\r\n\r\n\r\n', 'defaultnode.png'); #----------------------------------------------------------- #-- #-- Contenu de la table `group_user` @@ -120,16 +120,16 @@ INSERT INTO `{_PREFIX_}group_user` VALUES (2, 2, 3); #-- #-- Contenu de la table `langue` #-- -INSERT INTO `{_PREFIX_}langue` VALUES (1, '\r\n\r\n\r\nFrançais\r\n\r\n\r\n', 'fr', 1); +INSERT INTO `{_PREFIX_}langue` VALUES (1, '\r\n\r\n\r\nFrançais\r\n\r\n\r\n', 'fr', 1); #----------------------------------------------------------- #-- #-- Contenu de la table `node` #-- -INSERT INTO `{_PREFIX_}node` VALUES (1, 0, '\r\n\r\n\r\nRacine\r\n\r\n\r\n', 'orange08.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); -INSERT INTO `{_PREFIX_}node` VALUES (2, 1, '\r\n\r\n\r\nAnonyme\r\n\r\n\r\n', 'blockdevice.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); -INSERT INTO `{_PREFIX_}node` VALUES (3, 1, '\r\n\r\n\r\nAdministration\r\n\r\n\r\n', 'orange15.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); -INSERT INTO `{_PREFIX_}node` VALUES (99, 3, '\r\n\r\n\r\nConfiguration\r\n\r\n\r\n', 'defaultnode.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); -INSERT INTO `{_PREFIX_}node` VALUES (100, 3, '\r\n\r\n\r\nSite public\r\n\r\n\r\n', 'defaultnode.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); +INSERT INTO `{_PREFIX_}node` VALUES (1, 0, '\r\n\r\n\r\nRacine\r\n\r\n\r\n', 'orange08.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); +INSERT INTO `{_PREFIX_}node` VALUES (2, 1, '\r\n\r\n\r\nAnonyme\r\n\r\n\r\n', 'blockdevice.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); +INSERT INTO `{_PREFIX_}node` VALUES (3, 1, '\r\n\r\n\r\nAdministration\r\n\r\n\r\n', 'orange15.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); +INSERT INTO `{_PREFIX_}node` VALUES (99, 3, '\r\n\r\n\r\nConfiguration\r\n\r\n\r\n', 'defaultnode.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); +INSERT INTO `{_PREFIX_}node` VALUES (100, 3, '\r\n\r\n\r\nSite public\r\n\r\n\r\n', 'defaultnode.png', 'lcube6', 'www.qware.fr', 'off', 'default', '', 0, 0, 0, ''); #----------------------------------------------------------- #-- #-- Contenu de la table `node_group_user` diff --git a/lib/object_coordination/addcom/addcom.php b/lib/object_coordination/addcom/addcom.php index a4fc036..c4d4707 100755 --- a/lib/object_coordination/addcom/addcom.php +++ b/lib/object_coordination/addcom/addcom.php @@ -195,9 +195,9 @@ var $tabForbidden=array("adminentrynode", "admingroup", "adminnode", "home", "ad for ($i=0; $igetCode()).".png")) + if (file_exists($GLOBALS['CONF_DATA_PATH']."data/image/icons/language/".$tab[$i]->getCode().".png")) { - $img=$GLOBALS['CONF_DATA_PATH']."data/image/icons/language/".strtolower($tab[$i]->getCode()).".png"; + $img=$GLOBALS['CONF_DATA_PATH']."data/image/icons/language/".$tab[$i]->getCode().".png"; }else{ $img=$GLOBALS['CONF_DATA_PATH']."data/image/icons/language/default.png"; } diff --git a/lib/system/system_utils/xlanguechaine.php b/lib/system/system_utils/xlanguechaine.php index 9757b70..dd157ff 100755 --- a/lib/system/system_utils/xlanguechaine.php +++ b/lib/system/system_utils/xlanguechaine.php @@ -134,8 +134,8 @@ var $tab = null; */ function getLanguage($langue) { - if(isset($this->tab[strtoupper($langue)])){ - return $this->tab[strtoupper($langue)]; + if(isset($this->tab[$langue])){ + return $this->tab[$langue]; }else{ return ""; } @@ -151,7 +151,7 @@ var $tab = null; */ function setLanguage($langue,$value) { - $this->tab[strtoupper($langue)]=$value; + $this->tab[$langue]=$value; } /**