From d513385e66f8c8df3e13c0cecb6cce0d1fe2bc34 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jul 2004 11:36:01 +0000 Subject: [PATCH] =?UTF-8?q?Norm:=20Suppression=20vieille=20fonction=20tran?= =?UTF-8?q?slate=20qui=20ne=20sert=20plus=20Trad:=20Traduction=20des=20cha?= =?UTF-8?q?ines=20Param=E8tre=20et=20Valeur=20dans=20tous=20le=20code.=20T?= =?UTF-8?q?rad:=20Ajout=20fichier=20lang=20pour=20le=20module=20commandes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/ihm.php | 17 +++++++---------- htdocs/admin/system/constall.php | 4 ++-- htdocs/admin/system/os.php | 3 ++- htdocs/admin/system/web.php | 2 +- htdocs/admin/webcalendar.php | 14 +++++++------- htdocs/comm/fiche.php | 11 ++--------- htdocs/comm/index.php | 3 ++- htdocs/commande/index.php | 17 ++++++++++------- htdocs/compta/fiche.php | 5 +++-- htdocs/compta/index.php | 8 ++++++-- htdocs/compta/propal.php | 2 +- htdocs/expedition/index.php | 14 +++++++++----- htdocs/fourn/fiche.php | 14 +++++++------- htdocs/langs/en_US/bills.lang | 1 + htdocs/langs/en_US/main.lang | 16 +++++++++++++++- htdocs/langs/fr_FR/bills.lang | 1 + htdocs/langs/fr_FR/main.lang | 16 +++++++++++++++- htdocs/lib/functions.inc.php | 2 +- htdocs/translate.class.php | 18 +++++++++--------- 19 files changed, 101 insertions(+), 67 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 656896911b6..f08d2c07d75 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -55,7 +55,7 @@ if ($_GET["action"] == 'edit') print '
'; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -128,7 +125,7 @@ if ($_GET["action"] == 'edit') print '
NomValeur
'.$langs->trans("Parameter").''.$langs->trans("Value").'
Thème
Langue par défaut à utiliser (code langue)'; + $langs_available=$langs->get_available_languages(); print ''; print '

'; print '
'; - print ''; + print ''; print '
'; print '
'; @@ -137,7 +134,7 @@ else { print ''; - print ''; + print ''; print ''; print ''; print '
NomValeur
'.$langs->trans("Parameter").''.$langs->trans("Value").'
Thème' . MAIN_THEME . '
Longueur maximum des listes' . SIZE_LISTE_LIMIT . '
Gestionnaire du menu du haut'; @@ -157,7 +154,7 @@ else print '
'; - print 'Editer'; + print ''.$langs->trans("Edit").''; print '
'; } diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 0061f3872f0..68621dbd6cd 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -32,8 +32,8 @@ print_titre("Liste de tous les param print '
'; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print "\n"; $sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const ORDER BY name ASC"; diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php index 484de7cc28b..a8ba4617abd 100644 --- a/htdocs/admin/system/os.php +++ b/htdocs/admin/system/os.php @@ -31,7 +31,8 @@ print_titre("OS"); print "
\n"; print '
ParamètreValeur'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; -print "\n"; +print ''; +print "\n"; // Récupère la version de l'OS ob_start(); phpinfo(); diff --git a/htdocs/admin/system/web.php b/htdocs/admin/system/web.php index 2b4cdcba40a..25f12f9b6f0 100644 --- a/htdocs/admin/system/web.php +++ b/htdocs/admin/system/web.php @@ -31,7 +31,7 @@ print_titre("Serveur Web"); print "
\n"; print '
ParamètreValeur
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; -print "\n"; +print "\n"; print "\n"; print "\n"; print "\n"; diff --git a/htdocs/admin/webcalendar.php b/htdocs/admin/webcalendar.php index ddb9bd34d52..19f028a0c9f 100644 --- a/htdocs/admin/webcalendar.php +++ b/htdocs/admin/webcalendar.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2003 Éric Seigne * Copyright (C) 2004 Laurent Destailleur - * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Benoit Mortier * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,8 +81,8 @@ if ($actionsave) print '
'; print "
ParamètreValeur
".$langs->trans("Parameter")."".$langs->trans("Value")."
Version".$_SERVER["SERVER_SOFTWARE"]."
Nom du serveur virtuel" . $_SERVER["SERVER_NAME"] . "
IP".$_SERVER["SERVER_ADDR"]."
- - + + @@ -101,17 +101,17 @@ print "
ParamètreValeur".$langs->trans("Parameter")."".$langs->trans("Value")."
Adresse URL d'accès au calendrier
- + - +\n"; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 29a8e6ce57f..46d78d6d2e8 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -374,14 +374,7 @@ if ($_socid > 0) print 'Intervention'; } -// if ($user->societe_id == 0) -// { -// if ($user->rights->facture->creer) { -// print "idp\">".translate("Créer Facture").""; -// } -// } - - + print ''; print '
'; @@ -400,7 +393,7 @@ if ($_socid > 0) print "
Mot de passe d'accès à la base".$langs->trans("Password")."
Mot de passe (vérification)".$langs->trans("PasswordRetype")."
- - +trans("TestConnection")."\"> +trans("Save")."\">
'; print ''; - print ''; + print ''; $i = 0; $var = False; while ($i < $num) diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 5b76df983cc..9a70cd72557 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -22,12 +22,14 @@ */ require("./pre.inc.php"); +$langs->load("orders"); -llxHeader("", 'Commandes','Commande'); -print_titre("Commandes"); +llxHeader("",$langs->trans("Orders"),"Commande"); -print '
'.translate("Commandes à valider").'
'.$langs->trans("OrdersToValid").'
'; +print_titre($langs->trans("OrdersArea")); + +print '
'; print '
'; /* @@ -35,9 +37,9 @@ print '
'; */ print '
'; print ''; -print ''; +print ''; print "'; +print 'Num. : '; print "
Rechercher une commande
'.$langs->trans("SearchOrder").'
"; -print 'Num. :
\n"; @@ -53,13 +55,14 @@ if ($socidp) if ( $db->query($sql) ) { + $langs->load("orders"); $num = $db->num_rows(); if ($num) { $i = 0; print ''; print ''; - print ''; + print ''; $var = True; while ($i < $num) { @@ -93,7 +96,7 @@ if ( $db->query($sql) ) $i = 0; print '
'.translate("Commandes à valider").'
'.$langs->trans("OrdersToValid").'
'; print ''; - print ''; + print ''; $var = True; while ($i < $num) { diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index f8c405166c7..e14300da6c8 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -330,8 +330,9 @@ if ($socid > 0) if ($user->societe_id == 0) { - if ($user->rights->facture->creer) { - print "id\">".translate("Créer Facture").""; + if ($user->rights->facture->creer) { + $langs->load("bills"); + print "id\">".$langs->trans("CreateBill").""; } print "id&action=create\">Créer Déplacement"; } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index dc753baa5b9..ae706c25574 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -24,6 +24,8 @@ require("./pre.inc.php"); $user->getrights('banque'); +$langs->load("compta"); + /* * Sécurité accés client */ @@ -63,7 +65,7 @@ if ($action == 'del_bookmark') * * */ -print_titre(translate("Espace comptabilité")); +print_titre("Espace comptabilité"); print '
Commandes à traiter
'.$langs->trans("OrdersToProcess").'
'; @@ -213,6 +215,8 @@ print '
'; */ if ($user->comm > 0 && $conf->commercial->enabled ) { + $langs->load("orders"); + $sql = "SELECT p.rowid, p.ref, s.nom, s.idp FROM ".MAIN_DB_PREFIX."commande as p, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut >= 1 AND p.facture = 0"; if ($socidp) @@ -228,7 +232,7 @@ if ($user->comm > 0 && $conf->commercial->enabled ) $i = 0; print ''; print ""; - print ''; + print ''; $var = True; while ($i < $num) { diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 7a816814367..f517092cbb2 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -126,7 +126,7 @@ if ($_GET["propalid"]) print ""; // - print ''; + print ''; if ($obj->fk_projet) { diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 0e1e39b2a6a..0623aa91fb9 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -35,7 +35,7 @@ print ''; print '
'.translate("Commandes à facturer").'
'.$langs->trans("OrdersToBill").'
Note :
". nl2br($obj->note)."
'.translate("Date").''.strftime("%A %d %B %Y",$obj->dp).'
'.$langs->trans("Date").''.dolibarr_print_date($obj->dp).'
'; print ''; print "'; +print 'Num. : '; print "
Rechercher une expédition
"; -print 'Num. :
\n"; /* @@ -55,7 +55,7 @@ if ( $db->query($sql) ) { print ''; print ''; - print ''; + print ''; $i = 0; $var = True; while ($i < $num) @@ -87,10 +87,12 @@ if ( $db->query($sql) ) $num = $db->num_rows(); if ($num) { + $langs->load("orders"); + $i = 0; print '
'.translate("Expeditions à valider").'
Expeditions à valider
'; print ''; - print ''; + print ''; $var = True; while ($i < $num) { @@ -124,13 +126,15 @@ if ($socidp) if ( $db->query($sql) ) { + $langs->load("orders"); + $num = $db->num_rows(); if ($num) { $i = 0; print '
'.translate("Commandes à traiter").'
'.$langs->trans("OrdersToProcess").'
'; print ''; - print ''; + print ''; $var = True; while ($i < $num) { @@ -166,7 +170,7 @@ if ( $db->query($sql) ) $i = 0; print '
'.translate("Commandes en traitement").'
'.$langs->trans("OrdersInProcess").'
'; print ''; - print ''; + print ''; $var = True; while ($i < $num) { diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 2c89f0a81b6..2f49b85a025 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -150,13 +150,11 @@ if ( $societe->fetch($socid) ) /* * Boutons Actions */ + $langs->load("bills"); + print ''; @@ -165,11 +163,13 @@ if ( $societe->fetch($socid) ) * Liste des contacts * */ + $langs->load("companies"); + print '
'.translate("5 dernières expéditions").'
5 dernières expéditions
'; print ""; - print ''; - print ""; + print ''; + print ""; print ""; $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 934f7f0fe54..fd15bdb9cb9 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -3,6 +3,7 @@ Bill=Bill Bills=Bills ClassifyPayed=Classify 'Payed' ClassifyCanceled=Classify 'Abandonned' +CreateBill=Create Bill Send=Send SendRemind=Send reminder DoPaiement=Do paiement diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 19ec2a8097c..23f00b8995c 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -12,14 +12,21 @@ Resiliate=Resiliate Cancel=Cancel Modify=Modify Edit=Edit +Save=Save +SaveAs=Save As Show=Show Search=Search +TestConnection=Test connection ChooseLangage=Please choose your language User=User Users=Users Group=Group Groups=Groups +Password=Password +PasswordRetype=Retype your password Name=Name +Parameter=Parameter +Parameters=Parameters Value=Value Type=Type Note=Note @@ -34,4 +41,11 @@ Alert=Alert Previous=Previous Next=Next ErrorForbidden=Access is forbidden -Cards=Cards \ No newline at end of file +Cards=Cards +Date=Date +Year=Year +Month=Month +Day=Day +Hour=Hour +Minute=Minute +Second=Second diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 5e3d3f9f6b3..95e179317b9 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -3,6 +3,7 @@ Bill=Facture Bills=Factures ClassifyPayed=Classer 'Payée' ClassifyCanceled=Classer 'Abandonnée' +CreateBill=Créer Facture Send=Envoyer SendRemind=Envoyer rappel DoPaiement=Emettre paiement diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index bfa5b962cab..dace55c8f27 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -12,6 +12,9 @@ Resiliate=R Cancel=Annuler Modify=Modifier Edit=Editer +Save=Enregistrer +SaveAs=Enregistrer sous +TestConnection=Tester connexion Show=Voir Search=Rechercher ChooseLangage=Choisissez votre langue @@ -19,7 +22,11 @@ User=Utilisateur Users=Utilisateurs Group=Groupe Groups=Groupes +Password=Mot de passe +PasswordRetype=Retaper le mot de passe Name=Nom +Parameter=Paramètre +Parameters=Paramètres Value=Valeur Type=Type Note=Note @@ -34,4 +41,11 @@ Alert=Alerte Previous=Précédent Next=Suivant ErrorForbidden=Accès non autorisé -Cards=Fiches \ No newline at end of file +Cards=Fiches +Date=Date +Year=Année +Month=Mois +Day=Jour +Hour=Heure +Minute=Minute +Second=Seconde \ No newline at end of file diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 2fa4c6c77c9..0e767137829 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -474,7 +474,7 @@ function dolibarr_print_error($db='',$msg='') print "Serveur:".$_SERVER["SERVER_SOFTWARE"]."
\n";; print "URL sollicitée: ".$_SERVER["REQUEST_URI"]."
\n";; - print "Paramètres: ".$_SERVER["QUERY_STRING"]."
\n";; + print "".$langs->trans("Parameters").": ".$_SERVER["QUERY_STRING"]."
\n";; print "URL d'origine: ".$_SERVER["HTTP_REFERER"]."
\n";; if ($db) { diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index 15153b0d524..ae1774a918b 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -93,14 +93,21 @@ Class Translate { /** * Return the list of available languages - * [fr] Retourne la liste des langues disponibles * * @access public * @return array: list of languages */ function get_available_languages() { - + // On parcour le répertoire langs pour détecter les langues dispo + $handle=opendir(DOL_DOCUMENT_ROOT ."/langs"); + $langs_available=array(); + while ($file = trim(readdir($handle))){ + if($file != "." && $file != ".." && $file != "CVS") { + array_push($langs_available,$file); + } + } + return $langs_available; } /** @@ -124,11 +131,4 @@ Class Translate { } -// Pour compatibilité avec l'existant. Il existe quelques appels a une fonction -// tranlsate. On l'implémente donc ici mais il vaut mieux utiliser $langs->trans -function translate($str) { - - return $str; -} - ?>
Prénom NomPosteTélFaxEmailPoste'.$langs->trans("Tel").'".$langs->trans("Fax")."".$langs->trans("EMail")."Ajouter