From 505268a227290a566b2eef062d76b4810cc52745 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 20 Mar 2009 10:42:45 +0000 Subject: [PATCH] =?UTF-8?q?-=20Correction=20de=20probl=C3=A8me=20de=20trad?= =?UTF-8?q?uction=20(Code/Messages)=20-=20Ajout=20du=20script=20generate?= =?UTF-8?q?=5Flang=5Ffile.php=20g=C3=A9rant=20un=20fichier=20de=20lang=20v?= =?UTF-8?q?ide=20=C3=A0=20partir=20=20=20de=20votre=20configuration.=20-?= =?UTF-8?q?=20Mise=20=C3=A0=20jour=20de=20la=20traduction=20fran=C3=A7aise?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LSobjects/config.LSobjects.LSeepeople.php | 2 +- trunk/conf/config.inc.php | 6 +- trunk/includes/class/class.LSsession.php | 6 +- trunk/lang/fr_FR.UTF8/lang.php | 214 +++++++++++------- trunk/lang/generate_lang_file.php | 108 +++++++++ 5 files changed, 242 insertions(+), 94 deletions(-) create mode 100755 trunk/lang/generate_lang_file.php diff --git a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php index 1f06de45..fa5504eb 100644 --- a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php +++ b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php @@ -468,7 +468,7 @@ $GLOBALS['LSobjects']['LSeepeople'] = array ( 'mail' => array( 'send' => 1, 'ask' => 1, - 'subject' => "LSexample : Your new credentials", + 'subject' => "LSexample : Your new credentials.", 'msg' => "Your password has been changed.\nNew password : %{mdp}", 'mail_attr' => 'mail' ) diff --git a/trunk/conf/config.inc.php b/trunk/conf/config.inc.php index 2482887c..729458c8 100644 --- a/trunk/conf/config.inc.php +++ b/trunk/conf/config.inc.php @@ -88,14 +88,14 @@ $GLOBALS['LSconfig'] = array( 'msg' => "To proceed password recovery procedure, please follow that link:\n%{url}" ), 'newPasswordMail' => array( - 'subject' => 'LSexample : Your new credentials', + 'subject' => 'LSexample : Your new credentials.', 'msg' => "Your new password : %{mdp}" ) ), 'emailSender' => 'noreply@ls.com' ), array ( - 'name' => 'LSexample - multi-sociétés', + 'name' => 'LSexample - multi-company', 'ldap_config'=> array( 'host' => '127.0.0.1', 'port' => 389, @@ -122,7 +122,7 @@ $GLOBALS['LSconfig'] = array( 'authObjectType' => 'LSeepeople', 'subDnLabel' => 'Company', 'subDn' => array( - '== Toutes ==' => array( + '== All ==' => array( 'dn' => 'o=ls', 'LSobjects' => array( 'LSeepeople', diff --git a/trunk/includes/class/class.LSsession.php b/trunk/includes/class/class.LSsession.php index e549650b..5f8af9a4 100644 --- a/trunk/includes/class/class.LSsession.php +++ b/trunk/includes/class/class.LSsession.php @@ -863,7 +863,7 @@ class LSsession { } else { if ((isCompatibleDNs($subDn_config['dn'],self :: $ldapServer['ldap_config']['basedn']))&&($subDn_config['dn']!="")) { - $return[$subDn_config['dn']] = $subDn_name; + $return[$subDn_config['dn']] = __($subDn_name); } } } @@ -972,7 +972,7 @@ class LSsession { $ldapservers_index=array(); foreach($GLOBALS['LSconfig']['ldap_servers'] as $id => $infos) { $ldapservers_index[]=$id; - $ldapservers_name[]=$infos['name']; + $ldapservers_name[]=__($infos['name']); } $GLOBALS['Smarty'] -> assign('loginform_ldapservers_name',$ldapservers_name); $GLOBALS['Smarty'] -> assign('loginform_ldapservers_index',$ldapservers_index); @@ -1807,7 +1807,7 @@ class LSsession { * @retval string Le label des niveaux pour le serveur ldap dourant */ public static function getSubDnLabel() { - return (self :: $ldapServer['subDnLabel']!='')?_(self :: $ldapServer['subDnLabel']):_('Level'); + return (self :: $ldapServer['subDnLabel']!='')?__(self :: $ldapServer['subDnLabel']):_('Level'); } /** diff --git a/trunk/lang/fr_FR.UTF8/lang.php b/trunk/lang/fr_FR.UTF8/lang.php index 32115d50..e4177488 100644 --- a/trunk/lang/fr_FR.UTF8/lang.php +++ b/trunk/lang/fr_FR.UTF8/lang.php @@ -2,121 +2,161 @@ $GLOBALS['LSlang'] = array ( -"Companies" => - "Sociétés", - -"Company" => - "Société", - -"Name" => - "Nom", - -"Description" => - "Description", +"== All ==" => + "== Toutes ==", "Accountable(s)" => "Responsable(s)", -"One or several of these users don't exist." => - "Un ou plusieurs utilisateurs n'existent pas.", - -"Groups" => - "Groupes", - -"Name must contain alphanumeric values only." => - "Le nom doit contenir uniquement des valeurs alpha-numériques.", - -"Members" => - "Membres", - -"Users" => - "Utilisateurs", +"Allow user to connect a POSIX system." => + "Autorisie l'utilisateur à se connecter aux systèmes POSIX.", "Belongs to groups ..." => "Appartient aux groupes ...", -"Doesn't belong to any group." => - "N'appartient à aucun groupe.", - "Civility" => "Civilité", -"Identifier must contain alphanumeric values, dots (.) and dashes (-) only." => - "L'identifiant doit contenir uniquement des valeurs alpha-numériques, avec eventuellement des points (.) et des tirets (-).", - -"This identifier is already used." => - "Cet identifiant est déjà utilisé.", - -"Numeric identifier" => - "Identifiant numérique", - -"The numeric identifier must be an integer." => - "L'identifiant numérique doit forcement être un entier.", - -"This uid is already used." => - "Cet uid est déjà utilisé.", - -"First Name" => - "Prénom", - -"The first name must contain alphanumeric values only." => - "Le prénom doit contenir uniquement des caractères alpha-numérique.", - -"Last Name" => - "Nom", - -"Full Name" => - "Nom complet", - -"Main group" => - "Groupe principal", - -"This group doesn't exist." => - "Ce groupe n'existe pas.", - "Command shell" => "Interpréteur de commande", -"Allow user to connect a POSIX system." => - "Autorisie l'utilisateur à se connecter aux systèmes POSIX.", +"Companies" => + "Sociétés", -"Samba Identifier" => - "Identifiant Samba", +"Company" => + "Société", -"Home Directory" => - "Dossier personnel", +"Description" => + "Description", + +"Doesn't belong to any group." => + "N'appartient à aucun groupe.", "E-mail address" => "Adresse e-mail", -"Given email address is invalid." => - "L'adresse mail saisie est invalide.", - -"Password recovery hash" => - "Hash de récupération de mot de passe", - -"Samba Password (LM)" => - "Mot de passe Samba (LM)", - -"Samba Password (NT)" => - "Mot de passe Samba (NT)", - -"Picture" => - "Image", - -"Picture size is not valid." => - "La taille de l'image est invalide.", - "File size is not valid." => "La taille du fichier est invalide.", "File type is not valid." => "Le type de fichier est invalide.", +"First Name" => + "Prénom", + +"Full Name" => + "Nom complet", + +"Given email address is invalid." => + "L'adresse mail saisie est invalide.", + +"Groups" => + "Groupes", + +"Home Directory" => + "Dossier personnel", + +"Identifier" => + "Identifiant", + +"Identifier must contain alphanumeric values, dots (.) and dashes (-) only." => + "L'identifiant doit contenir uniquement des valeurs alpha-numériques, avec eventuellement des points (.) et des tirets (-).", + +"LSexample" => + "LSexemple", + +"LSexample - multi-company" => + "LSexemple - multi-société", + +"LSexample : Recovering your password." => + "LSexemple : Récupération de votre mot de passe.", + +"LSexample : Your new credentials." => + "LSexemple : Votre nouveau mot de passe.", + +"Last Name" => + "Nom", + +"Main group" => + "Groupe principal", + +"Members" => + "Membres", + +"Name" => + "Nom", + +"Name must contain alphanumeric values only." => + "Le nom doit contenir uniquement des valeurs alpha-numériques.", + +"Numeric identifier" => + "Identifiant numérique", + +"One or several of these users don't exist." => + "Un ou plusieurs utilisateurs n'existent pas.", + "One or several users don't exist." => - "Un ou plusieurs utilisateurs n'existent pas." + "Un ou plusieurs utilisateurs n'existent pas.", + +"Password" => + "Mot de passe", + +"Password recovery hash" => + "Hash de récupération de mot de passe", + +"Picture" => + "Image", + +"Picture size is not valid." => + "La taille de l'image est invalide.", + +"Posix" => + "Posix", + +"Samba" => + "Samba", + +"Samba Identifier" => + "Identifiant Samba", + +"Samba Password (LM)" => + "Mot de passe Samba (LM)", + +"Samba Password (NT)" => + "Mot de passe Samba (NT)", + +"The first name must contain alphanumeric values only." => + "Le prénom doit contenir uniquement des caractères alpha-numérique.", + +"The numeric identifier must be an integer." => + "L'identifiant numérique doit forcement être un entier.", + +"This group doesn't exist." => + "Ce groupe n'existe pas.", + +"This identifier is already used." => + "Cet identifiant est déjà utilisé.", + +"This uid is already used." => + "Cet uid est déjà utilisé.", + +"To proceed password recovery procedure, please follow that link: +%{url}" => + "Pour poursuivre la procédure de récupération de mot de passe, merci de suivre ce lien :\n%{url}", + +"Users" => + "Utilisateurs", + +"Your new password : %{mdp}" => + "Votre nouveau mot de passe : %{mdp}", + +"Your password has been changed. +New password : %{mdp}" => + "Votre mot de passe a été modifié.\nNouveau mot de passe : %{mdp}", + +"Your password must contain from 8 to 10 characters." => + "Votre mot de passe doit contenir entre 8 et 10 caractères.", ); ?> - diff --git a/trunk/lang/generate_lang_file.php b/trunk/lang/generate_lang_file.php new file mode 100755 index 00000000..4e5d727b --- /dev/null +++ b/trunk/lang/generate_lang_file.php @@ -0,0 +1,108 @@ +#!/usr/bin/php + $cf) { + if ($name!='LSobject') { + add($name); + } + } + } +} + + +// LSobject +if (loadDir('../'.LS_OBJECTS_DIR)) { + foreach($GLOBALS['LSobjects'] as $name => $conf) { + add($conf['label']); + + // LSrelation + if (is_array($conf['LSrelation'])) { + foreach($conf['LSrelation'] as $rel) { + add($rel['label']); + add($rel['emptyText']); + } + } + // LSform + if (is_array($conf['LSform']['layout'])) { + foreach($conf['LSform']['layout'] as $lay) { + add($lay['label']); + } + } + + if(is_array($conf['attrs'])) { + foreach($conf['attrs'] as $attr) { + add($attr['label']); + add($attr['help_info']); + add($attr['html_options']['mail']['subject']); + add($attr['html_options']['mail']['msg']); + + // Check data + if (is_array($attr['check_data'])) { + foreach($attr['check_data'] as $check) { + add($check['msg']); + } + } + + // validation + if (is_array($attr['validation'])) { + foreach($attr['validation'] as $valid) { + add($valid['msg']); + } + } + } + } + } +} + +ksort($data); + +echo " $val) { + print "\n\"$key\" =>\n \"\",\n"; +} + +echo "\n);\n\n?>\n"; + +?>