[PC-BSD Commits] r1568 - in websites/pbidir.com/bibivu: etc/lang/fr slib tpl/pbidir

svn at pcbsd.org svn at pcbsd.org
Sun Mar 9 12:53:18 PST 2008


Author: fabry
Date: 2008-03-09 13:53:17 -0700 (Sun, 09 Mar 2008)
New Revision: 1568

Modified:
   websites/pbidir.com/bibivu/etc/lang/fr/admin.lang.php
   websites/pbidir.com/bibivu/etc/lang/fr/common.lang.php
   websites/pbidir.com/bibivu/etc/lang/fr/contactus.lang.php
   websites/pbidir.com/bibivu/etc/lang/fr/download.lang.php
   websites/pbidir.com/bibivu/etc/lang/fr/home.lang.php
   websites/pbidir.com/bibivu/etc/lang/fr/login.lang.php
   websites/pbidir.com/bibivu/etc/lang/fr/pbi.lang.php
   websites/pbidir.com/bibivu/etc/lang/fr/redirect.lang.php
   websites/pbidir.com/bibivu/etc/lang/fr/registration.lang.php
   websites/pbidir.com/bibivu/etc/lang/fr/search.lang.php
   websites/pbidir.com/bibivu/slib/lang.php
   websites/pbidir.com/bibivu/tpl/pbidir/header.php
Log:
part of the French language uploaded

Modified: websites/pbidir.com/bibivu/etc/lang/fr/admin.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/admin.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/admin.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,4 +1,4 @@
 <?php
 //administration strings
-$lang[''] = '';
+$lang['french'] = 'français';
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/etc/lang/fr/common.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/common.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/common.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -3,8 +3,8 @@
 $lang['pbidir'] = 'pbiDIR';
 $lang['pcbsd'] = 'PC-BSD';
 $lang['title'] = 'pbiDIR';
-$lang['username'] = 'Username';
-$lang['password'] = 'Password';
+$lang['username'] = 'Utilisateur';
+$lang['password'] = 'Mot de Passe';
 $lang['email'] = 'Email';
-$lang['search'] = 'Search';
+$lang['search'] = 'Rechercher';
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/etc/lang/fr/contactus.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/contactus.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/contactus.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,5 +1,5 @@
 <?php
 //contact_us messages strings
-$lang['body'] = 'You can get in touch with us on <a href="http://www.pcbsd.org/content/view/18/32/">the PC-BSD web site</a>.';
-$lang['signature'] = 'The PC-BSD Team.';
+$lang['body'] = 'Vous pouvez nous contacter sur <a href="http://www.pcbsd.org/content/view/18/32/">le site  PC-BSD</a>.';
+$lang['signature'] = 'L\'équipe PC-BSD';
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/etc/lang/fr/download.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/download.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/download.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,10 +1,10 @@
 <?php
 //download messages strings
-$lang['downloading'] = 'Downloading';
-$lang['using'] = 'using';
-$lang['choose_mirror'] = 'Please select your download location:';
-$lang['nostart'] = 'If the download doesn\'t start automatically';
-$lang['clickhere'] = 'Click Here';
-$lang['mirror_home'] = 'Visit Mirror Home Page';
-$lang['return_pbi'] = 'Return to the pbi';
+$lang['downloading'] = 'En cours de téléchargement';
+$lang['using'] = 'utilisant';
+$lang['choose_mirror'] = 'Merci de sélectionner l\'emplacement du téléchargement:';
+$lang['nostart'] = 'Si le téléchargement ne démarre pas automatiquement';
+$lang['clickhere'] = 'Cliquez ici';
+$lang['mirror_home'] = 'Voir la page d\'accueil du mirroir';
+$lang['return_pbi'] = 'Retour au pbi';
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/etc/lang/fr/home.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/home.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/home.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,10 +1,10 @@
 <?php
 //home page strings
-$lang['pbi_directory']		= 'pbi Directory';
-$lang['welcome']			= 'Welcome to the pbi Directory! Feel free to browse through our web site to download software for your <a href="http://www.pcbsd.org/">PC-BSD operating system</a>. Some of the advantages of the pbi system is the ease of use, you can install applications in a few clicks, and best of all, dependency issues are now gone with the self-containing pbi system. Learn more on the <a href="http://www.pcbsd.org/?p=pmscreens">pbi technology</a> on the official <a href="http://www.pcbsd.org/">PC-BSD web site</a>. The pbi directory is in no way associated with PC-BSD Software LLC.';
-$lang['latest_releases']	= 'Latest releases';
-$lang['latest_software']	= 'Latest software';
-$lang['most_downloaded_software']	= 'Most downloaded software';
-$lang['footer_note']		= 'Registered trade marks belong to their respective authors';
-$lang['contact_us']			= 'Contact us';
+$lang['pbi_directory']		= 'Répertoire pbi';
+$lang['welcome']			= 'Bienvenue dans le répertoire pbi! Parcourez notre site pour télécharger librement des logiciels pour votre <a href="http://www.pcbsd.org/">Système d\'exploitation PC-BSD </a>. Parmi les avantages du système de pbi: une utilisation simple. Tous vos logiciels s\'installent en quelques clics et surtout, plus de problèmes de dépendances, le système de pbi les gère tout seul. Plus d\'informations sur <a href="http://www.pcbsd.org/?p=pmscreens">technologie pbi</a> sur le <a href="http://www.pcbsd.org/">site web officiel PC-BSD</a>. Le répertoire pbi n\'est en aucune façon associé avec  PC-BSD Software LLC.';
+$lang['latest_releases']	= 'Dernières versions';
+$lang['latest_software']	= 'Derniers logiciels';
+$lang['most_downloaded_software']	= 'Logiciels les plus téléchargés';
+$lang['footer_note']		= 'Les marques déposées sont la propiété de leurs auteurs respectifs';
+$lang['contact_us']			= 'Contactez nous';
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/etc/lang/fr/login.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/login.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/login.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,16 +1,16 @@
 <?php
 //login page strings
-$lang['breadcrumb'] = 'Login';
-$lang['page_title'] = 'Your PC-BSD software - Login';
-$lang['pbidir_login'] = 'pbiDIR Login';
-$lang['create_account'] = 'Create a new Account';
+$lang['breadcrumb'] = 'Identification';
+$lang['page_title'] = 'Vos logiciels PC-BSD - Identification';
+$lang['pbidir_login'] = 'pbiDIR Identification';
+$lang['create_account'] = 'Créez un nouveau compte';
 $lang['button'] = 'LOGIN';
 
-$lang['error_cookies'] = 'You must have Your Cookies Enabled to be able to Login!!';
-$lang['failed'] = 'Login Failed! Please Try Again!!';
-$lang['success'] = 'Login Succesfully!';
+$lang['error_cookies'] = 'Vous devez accepter les cookies pour vous connecter!!';
+$lang['failed'] = 'Echec d\'identification! Merci de réessayer!!';
+$lang['success'] = 'Identification réussie!';
 
-$lang['logout_success'] = 'Logout Succesfully!';
+$lang['logout_success'] = 'Déconnexion réussie!';
 
 
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/etc/lang/fr/pbi.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/pbi.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/pbi.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,40 +1,40 @@
-<?php
-//pbi strings
-$lang['description'] = 'Description';
-$lang['vendor'] = 'Vendor';
-$lang['avg_rate'] = 'Average Rate';
-$lang['your_rate'] = 'Your Rate';
-$lang['downloads'] = 'Downloads';
-$lang['licence'] = 'Licence';
-$lang['maintainer'] = 'Maintainer';
-
-$lang['version'] = 'Version';
-$lang['summary'] = 'Summary';
-$lang['size'] = 'Size';
-$lang['added'] = 'Added';
-
-$lang['login_to_vote'] = 'Please <a href="%s">Login</a> To be able to Vote';
-$lang['cannot_vote'] = 'Sorry, You cannot Vote at this time!';
-
-$lang['login_to_comment'] = 'Please <a href="%s">Login</a> To be able to Add a Comment to this pbi';
-$lang['cannot_comment'] = 'Sorry, You cannot Comment at this time!';
-$lang['leave_comment'] = 'Click Here To Add a Comment To This pbi';
-
-$lang['subscribe'] = 'Subscribe to receive updates';
-$lang['unsubscribe'] = 'Unsubscribe from receiving updates';
-
-$lang['succesfully_subscribed'] = 'Succesfully subscribed to receive updates';
-$lang['succesfully_unsubscribed'] = 'Succesfully unsubscribed from receiving updates';
-
-$lang['alternative'] = 'Alternative for';
-
-$lang['alternative_for_windows_package'] = 'Alternative for a windows package';
-$lang['use_wine']  = 'Uses Wine';
-$lang['interface'] = 'Interface';
-$lang['graphical'] = 'Graphical';
-$lang['web'] = 'Web';
-$lang['command_line'] = 'Command Line';
-$lang['graphical_interface'] = 'Graphical Interface';
-$lang['web_interface'] = 'Web Interface';
-$lang['command_line_interface'] = 'Command Line';
+<?php
+//pbi strings
+$lang['description'] = 'Description';
+$lang['vendor'] = 'Fournisseur';
+$lang['avg_rate'] = 'Moyenne des évaluations';
+$lang['your_rate'] = 'Votre évaluation';
+$lang['downloads'] = 'Téléchargements';
+$lang['licence'] = 'Licence';
+$lang['maintainer'] = 'Maintenu par';
+
+$lang['version'] = 'Version';
+$lang['summary'] = 'Sommaire';
+$lang['size'] = 'Taille';
+$lang['added'] = 'Ajouté';
+
+$lang['login_to_vote'] = 'Merci de vous <a href="%s">identifier</a> pour voter';
+$lang['cannot_vote'] = 'Désolé, vous ne pouvez votre pour l\'instant!';
+
+$lang['login_to_comment'] = 'Merci de vous <a href="%s">identifier</a> pour pouvoir ajouter un commentaire à ce pbi';
+$lang['cannot_comment'] = 'Désolé, vous ne pouvez pas commenter pour l\'instant!';
+$lang['leave_comment'] = 'Cliquez ici pour ajouter un commentaire à ce pbi';
+
+$lang['subscribe'] = 'S\'inscrire pour recevoir les mises à jour';
+$lang['unsubscribe'] = 'Se désinscrire des mises à jour';
+
+$lang['succesfully_subscribed'] = 'Inscription aux mises à jour réussie';
+$lang['succesfully_unsubscribed'] = 'Désinscription réussi';
+
+$lang['alternative'] = 'Alternative pour';
+
+$lang['alternative_for_windows_package'] = 'Alternative pour les paquets windows';
+$lang['use_wine']  = 'Utilisez Wine';
+$lang['interface'] = 'Interface';
+$lang['graphical'] = 'Graphique';
+$lang['web'] = 'Web';
+$lang['command_line'] = 'Ligne de commande';
+$lang['graphical_interface'] = 'Interface Graphique';
+$lang['web_interface'] = 'Interface Web';
+$lang['command_line_interface'] = 'Ligne de commande';
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/etc/lang/fr/redirect.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/redirect.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/redirect.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,7 +1,7 @@
 <?php
 //redirect messages strings
-$lang['home'] = 'You will be redirect to the home page !!<br />'.
-				'Click <a href="%s">Here</a> if not redirected Automatically !!';
-$lang['previous'] = 'You will be redirect to the previous page !!<br />'.
-					'Click <a href="%s">Here</a> if not redirected Automatically !!'
+$lang['home'] = 'Vous allez être redirigé vers la page d\'accueil !!<br />'.
+				'Cliquez <a href="%s">ici</a> si vous n\'êtes pas redirigé automatiquement !!';
+$lang['previous'] = 'Vous allez être redirigé vers la page précédente !!<br />'.
+					'Cliquez <a href="%s">ici</a> si vous n\'êtes pas redirigé automatiquement !!'
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/etc/lang/fr/registration.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/registration.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/registration.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,23 +1,23 @@
-<?php
-//registration strings
-$lang['breadcrumb'] = 'Registration';
-$lang['page_title'] = 'Your PC-BSD software - Registration';
-$lang['verify_email'] = 'Verify Email';
-$lang['complete_fields'] = 'Please complete the following fields to register';
-
-$lang['error_email_verification'] = 'Email Verification Failed!! Please Try Again';
-$lang['error_email_not_valid'] = 'The email address is not Valid! Please Try Again';
-$lang['error_user_alphanum'] = 'Only Alphanumeric characters are allowed in the username! Please Choose a different one';
-$lang['error_user_exists'] = 'This Username is already used! Please Choose a different one';
-$lang['error_generic'] = 'Problem registering!! Please try again Later!';
-
-$lang['success'] = 'You are Succesfully register!<br />You will receive an email with the password that you can use to Login!';
-
-$lang['email_subject'] = '[pbiDir] Registration';
-$lang['email_body'] = '%s, welcome in pbiDir, your PC-BSD software'."\n\n".
-					  'This is the password that you need to login into the pbidir website:'."\n".
-					  '   %s'."\n\n".
-					  'Please Remember that the password is case sensitive!!'."\n\n".
-					  'pbiDIR Staff';	//first %s = username.  second %s = password
-
+<?php
+//registration strings
+$lang['breadcrumb'] = 'Enregistrement';
+$lang['page_title'] = 'Votre logiciel PC-BSD - Enregistrement';
+$lang['verify_email'] = 'Vérification email';
+$lang['complete_fields'] = 'Merci de remplir les champs suivants pour vous enregistrer';
+
+$lang['error_email_verification'] = 'Echec de la vérification de l\'adresse mail ! Merci de réessayer';
+$lang['error_email_not_valid'] = 'L\'adresse mail n\'existe pas! Merci de réessayer';
+$lang['error_user_alphanum'] = 'Le nom d\'utilisateur ne doit comporter que des caractères alphanumériques! Merci de faire un autre choix';
+$lang['error_user_exists'] = 'Le nom d\'utilisateur existe déjà! Merci de faire un autre choix';
+$lang['error_generic'] = 'Problème d\'enregistrement!! Merci de réessayer!';
+
+$lang['success'] = 'Vous êtes bien enregistré!<br />Vous allez recevoir un mail avec votre mot de passe!';
+
+$lang['email_subject'] = 'Enregistrement sur [pbiDir]';
+$lang['email_body'] = '%s, bienvenue dans pbiDir, vos logiciels PC-BSD'."\n\n".
+					  'Voici le mot de passe pour vous enregistrer sur le site pbidir:'."\n".
+					  '   %s'."\n\n".
+					  'Respectez la casse!!'."\n\n".
+					  'l\'équipe pbiDIR';	//first %s = username.  second %s = password
+
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/etc/lang/fr/search.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/fr/search.lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/etc/lang/fr/search.lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,12 +1,12 @@
 <?php
 //search messages strings
-$lang['name'] = 'Name';
-$lang['added'] = 'Added';
-$lang['rating'] = 'Rating';
-$lang['downloads'] = 'Downloads';
+$lang['name'] = 'Nom';
+$lang['added'] = 'Ajouté';
+$lang['rating'] = 'Evaluation';
+$lang['downloads'] = 'Téléchargement';
 
 $lang['licence'] = 'Licence';
-$lang['summary'] = 'Summary';
+$lang['summary'] = 'Sommaire';
 
-$lang['page_title'] = 'Search results';
+$lang['page_title'] = 'Résultat de la recherche';
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/slib/lang.php
===================================================================
--- websites/pbidir.com/bibivu/slib/lang.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/slib/lang.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,176 +1,181 @@
-<?php
-//this class is intended to help with the handling of the languages
-
-class lang{
-	private $config = array();
-	private $words = array();
-	private $loaded = array();
-	public function __construct(){
-		$this->config['lang'] = 'en';
-		$cfg = load_class('config')->load_config('lang')->get('lang');
-		if(is_array($cfg)){
-			foreach($cfg as $key=>$value){
-				$this->config[$key]=$value;
-			}
-		}
-		$this->set_lang(load_library('cookies')->get('lang'));
-	}
-
-	public function set_lang($lang='en'){
-		if($lang!=''){
-			$this->config['detected'] = $lang;
-		}
-	}
-	public function get($word, $default='', $lang=''){
-		if($lang=='')	$lang = $this->_detect_lang();
-		if(!(isset($this->words[$lang][$word]) && $this->words[$lang][$word]!='')){
-			//this language is not loaded
-			$file = '';
-			if(strpos($word,'_')>0){
-				list($file, $word1) = explode('_', $word, 2);
-			}
-			$this->load_lang($lang, $file);
-		}
-		if(!(isset($this->words[$lang][$word]) && $this->words[$lang][$word]!='')){
-			//nothing .. returning the default
-			//to avoid to load the file over and over
-			//I set the current key as the default
-			$this->words[$lang][$word] = $default!=''?$default:$word;
-		}
-		return $this->words[$lang][$word];
-	}
-	
-	public function load_lang($language, $file = ''){
-		//reset language
-		if($file=='') $file = 'common';
-		$folder = ETCPATH.'lang/'.$language.'/';
-		$lang_file = $folder.$file.'.lang'.EXT;
-		if(file_exists($lang_file)){
-			$lang = array();
-			include_once($lang_file);
-			foreach($lang as $key=>$value){
-				$this->words[$language][($file!='common'?$file.'_':'').$key] = $value;
-			}
-		}
-		//maybe later on add it to the cache
-	}
-	
-	//PART OF THIS FUNCTION HAS BEEN GRABBED FROM PHPMYADMIN
-	//and changed by fabrizio parrella
-		/**
-		 * All the supported languages have to be listed in the array below.
-		 * 1. The key must be the "official" ISO 639 language code and, if required,
-		 *    the dialect code. It can also contain some informations about the
-		 *    charset (see the Russian case).
-		 * 2. The first of the values associated to the key is used in a regular
-		 *    expression to find some keywords corresponding to the language inside two
-		 *    environment variables.
-		 *    These values contains:
-		 *    - the "official" ISO language code and, if required, the dialect code
-		 *      also ('bu' for Bulgarian, 'fr([-_][[:alpha:]]{2})?' for all French
-		 *      dialects, 'zh[-_]tw' for Chinese traditional...);
-		 *    - the '|' character (it means 'OR');
-		 *    - the full language name.
-		 * 3. The last values associated to the key is the language code as defined by
-		 *    the RFC1766.  This will be used for the name of the folder for the language
-		 *
-		 * Beware that the sorting order (first values associated to keys by
-		 * alphabetical reverse order in the array) is important: 'zh-tw' (chinese
-		 * traditional) must be detected before 'zh' (chinese simplified) for
-		 * example.
-		 *
-		 * When there are more than one charset for a language, we put the 
-		 * first.
-		 *
-		 * For Russian, we put 1251 first, because MSIE does not accept 866
-		 * and users would not see anything.
-		 */
-	private function _detect_lang(){
-		$lang = '';
-		if($this->config['detect']){
-			if(isset($this->config['detected']) && $this->config['detected']!=''){
-				$lang = $this->config['detected'];
-			} else {
-				$array_languages = array(
-					'af'     => 'af|afrikaans', 
-					'ar'     => 'ar([-_][[:alpha:]]{2})?|arabic', 
-					'az'     => 'az|azerbaijani', 
-					'bg'     => 'bg|bulgarian', 
-					'bs'     => 'bs|bosnian', 
-					'ca'     => 'ca|catalan', 
-					'cs'     => 'cs|czech',
-					'da'     => 'da|danish', 
-					'de'     => 'de([-_][[:alpha:]]{2})?|german', 
-					'el'     => 'el|greek', 
-					'en'     => 'en([-_][[:alpha:]]{2})?|english', 
-					'es'     => 'es([-_][[:alpha:]]{2})?|spanish', 
-					'et'     => 'et|estonian',
-					'eu'     => 'eu|basque', 
-					'fa'     => 'fa|persian', 
-					'fi'     => 'fi|finnish', 
-					'fr'     => 'fr([-_][[:alpha:]]{2})?|french',
-					'gl'     => 'gl|galician', 
-					'he'     => 'he|hebrew', 
-					'hi'     => 'hi|hindi', 
-					'hr'     => 'hr|croatian', 
-					'hu'     => 'hu|hungarian', 
-					'id'     => 'id|indonesian', 
-					'it'     => 'it([-_][[:alpha:]]{2})?|italian',
-					'ja'     => 'ja|japanese', 
-					'ko'     => 'ko|korean', 
-					'ka'     => 'ka|georgian', 
-					'lt'     => 'lt|lithuanian', 
-					'lv'     => 'lv|latvian', 
-					'ms'     => 'ms|malay', 
-					'nl'     => 'nl([-_][[:alpha:]]{2})?|dutch',
-					'no'     => 'no|norwegian',
-					'pl'     => 'pl|polish',
-					'pt-br'  => 'pt[-_]br|brazilian portuguese',
-					'pt'     => 'pt([-_][[:alpha:]]{2})?|portuguese',
-					'ro'     => 'ro|romanian',
-					'ru'     => 'ru|russian',
-					'sk'     => 'sk|slovak',
-					'sl'     => 'sl|slovenian',
-					'sq'     => 'sq|albanian',
-					'sr'     => 'sr|serbian',
-					'sr-lat' => 'sr[-_]lat|serbian latin',
-					'sv'     => 'sv|swedish', 
-					'th'     => 'th|thai', 
-					'tr'     => 'tr|turkish', 
-					'uk'     => 'uk|ukrainian', 
-					'zh-tw'  => 'zh[-_]tw|chinese traditional',
-					'zh'     => 'zh|chinese simplified',
-				);
-				// Language is not defined yet :
-				// 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE
-				//    variable
-				if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
-					$accepted    = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
-					$acceptedCnt = count($accepted);
-					for ($i = 0; $i < $acceptedCnt && $lang==''; $i++) {
-						foreach($array_languages as $key => $value) {
-							if (eregi('^('.$value.')(;q=[0-9]\\.[0-9])?$', $accepted[$i])) {
-								$lang = $key;
-								break;
-							}
-						}
-					}
-				}
-				// 2. try to findout user's language by checking its HTTP_USER_AGENT variable
-				if ($lang == '' && !empty($_SERVER['HTTP_USER_AGENT'])) {
-					foreach($array_languages as $key => $value) {
-						if (eregi('(\(|\[|;[[:space:]])('.$value.')(;|\]|\))', $_SERVER['HTTP_USER_AGENT'])) {
-							$lang = $key;
-							break;
-						}
-					}
-				}
-			}
-		}
-		if(!in_array($lang, $this->config['supported']))	$lang = $this->config['lang'];
-		$this->config['detected'] = $lang;
-		load_library('cookies')->set('lang', $lang);
-		return $lang;
-	}
-}
+<?php
+//this class is intended to help with the handling of the languages
+
+class lang{
+	private $config = array();
+	private $words = array();
+	private $loaded = array();
+	public function __construct(){
+		$this->config['lang'] = 'en';
+		$cfg = load_class('config')->load_config('lang')->get('lang');
+		if(is_array($cfg)){
+			foreach($cfg as $key=>$value){
+				$this->config[$key]=$value;
+			}
+		}
+		$this->set_lang(load_library('cookies')->get('lang'));
+	}
+
+	public function set_lang($lang='en'){
+		if($lang!=''){
+			$this->config['detected'] = $lang;
+		}
+	}
+
+	public function get_lang(){
+		return $this->config['detected'];
+	}
+
+	public function get($word, $default='', $lang=''){
+		if($lang=='')	$lang = $this->_detect_lang();
+		if(!(isset($this->words[$lang][$word]) && $this->words[$lang][$word]!='')){
+			//this language is not loaded
+			$file = '';
+			if(strpos($word,'_')>0){
+				list($file, $word1) = explode('_', $word, 2);
+			}
+			$this->load_lang($lang, $file);
+		}
+		if(!(isset($this->words[$lang][$word]) && $this->words[$lang][$word]!='')){
+			//nothing .. returning the default
+			//to avoid to load the file over and over
+			//I set the current key as the default
+			$this->words[$lang][$word] = $default!=''?$default:$word;
+		}
+		return $this->words[$lang][$word];
+	}
+	
+	public function load_lang($language, $file = ''){
+		//reset language
+		if($file=='') $file = 'common';
+		$folder = ETCPATH.'lang/'.$language.'/';
+		$lang_file = $folder.$file.'.lang'.EXT;
+		if(file_exists($lang_file)){
+			$lang = array();
+			include_once($lang_file);
+			foreach($lang as $key=>$value){
+				$this->words[$language][($file!='common'?$file.'_':'').$key] = $value;
+			}
+		}
+		//maybe later on add it to the cache
+	}
+	
+	//PART OF THIS FUNCTION HAS BEEN GRABBED FROM PHPMYADMIN
+	//and changed by fabrizio parrella
+		/**
+		 * All the supported languages have to be listed in the array below.
+		 * 1. The key must be the "official" ISO 639 language code and, if required,
+		 *    the dialect code. It can also contain some informations about the
+		 *    charset (see the Russian case).
+		 * 2. The first of the values associated to the key is used in a regular
+		 *    expression to find some keywords corresponding to the language inside two
+		 *    environment variables.
+		 *    These values contains:
+		 *    - the "official" ISO language code and, if required, the dialect code
+		 *      also ('bu' for Bulgarian, 'fr([-_][[:alpha:]]{2})?' for all French
+		 *      dialects, 'zh[-_]tw' for Chinese traditional...);
+		 *    - the '|' character (it means 'OR');
+		 *    - the full language name.
+		 * 3. The last values associated to the key is the language code as defined by
+		 *    the RFC1766.  This will be used for the name of the folder for the language
+		 *
+		 * Beware that the sorting order (first values associated to keys by
+		 * alphabetical reverse order in the array) is important: 'zh-tw' (chinese
+		 * traditional) must be detected before 'zh' (chinese simplified) for
+		 * example.
+		 *
+		 * When there are more than one charset for a language, we put the 
+		 * first.
+		 *
+		 * For Russian, we put 1251 first, because MSIE does not accept 866
+		 * and users would not see anything.
+		 */
+	private function _detect_lang(){
+		$lang = '';
+		if($this->config['detect']){
+			if(isset($this->config['detected']) && $this->config['detected']!=''){
+				$lang = $this->config['detected'];
+			} else {
+				$array_languages = array(
+					'af'     => 'af|afrikaans', 
+					'ar'     => 'ar([-_][[:alpha:]]{2})?|arabic', 
+					'az'     => 'az|azerbaijani', 
+					'bg'     => 'bg|bulgarian', 
+					'bs'     => 'bs|bosnian', 
+					'ca'     => 'ca|catalan', 
+					'cs'     => 'cs|czech',
+					'da'     => 'da|danish', 
+					'de'     => 'de([-_][[:alpha:]]{2})?|german', 
+					'el'     => 'el|greek', 
+					'en'     => 'en([-_][[:alpha:]]{2})?|english', 
+					'es'     => 'es([-_][[:alpha:]]{2})?|spanish', 
+					'et'     => 'et|estonian',
+					'eu'     => 'eu|basque', 
+					'fa'     => 'fa|persian', 
+					'fi'     => 'fi|finnish', 
+					'fr'     => 'fr([-_][[:alpha:]]{2})?|french',
+					'gl'     => 'gl|galician', 
+					'he'     => 'he|hebrew', 
+					'hi'     => 'hi|hindi', 
+					'hr'     => 'hr|croatian', 
+					'hu'     => 'hu|hungarian', 
+					'id'     => 'id|indonesian', 
+					'it'     => 'it([-_][[:alpha:]]{2})?|italian',
+					'ja'     => 'ja|japanese', 
+					'ko'     => 'ko|korean', 
+					'ka'     => 'ka|georgian', 
+					'lt'     => 'lt|lithuanian', 
+					'lv'     => 'lv|latvian', 
+					'ms'     => 'ms|malay', 
+					'nl'     => 'nl([-_][[:alpha:]]{2})?|dutch',
+					'no'     => 'no|norwegian',
+					'pl'     => 'pl|polish',
+					'pt-br'  => 'pt[-_]br|brazilian portuguese',
+					'pt'     => 'pt([-_][[:alpha:]]{2})?|portuguese',
+					'ro'     => 'ro|romanian',
+					'ru'     => 'ru|russian',
+					'sk'     => 'sk|slovak',
+					'sl'     => 'sl|slovenian',
+					'sq'     => 'sq|albanian',
+					'sr'     => 'sr|serbian',
+					'sr-lat' => 'sr[-_]lat|serbian latin',
+					'sv'     => 'sv|swedish', 
+					'th'     => 'th|thai', 
+					'tr'     => 'tr|turkish', 
+					'uk'     => 'uk|ukrainian', 
+					'zh-tw'  => 'zh[-_]tw|chinese traditional',
+					'zh'     => 'zh|chinese simplified',
+				);
+				// Language is not defined yet :
+				// 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE
+				//    variable
+				if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+					$accepted    = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+					$acceptedCnt = count($accepted);
+					for ($i = 0; $i < $acceptedCnt && $lang==''; $i++) {
+						foreach($array_languages as $key => $value) {
+							if (eregi('^('.$value.')(;q=[0-9]\\.[0-9])?$', $accepted[$i])) {
+								$lang = $key;
+								break;
+							}
+						}
+					}
+				}
+				// 2. try to findout user's language by checking its HTTP_USER_AGENT variable
+				if ($lang == '' && !empty($_SERVER['HTTP_USER_AGENT'])) {
+					foreach($array_languages as $key => $value) {
+						if (eregi('(\(|\[|;[[:space:]])('.$value.')(;|\]|\))', $_SERVER['HTTP_USER_AGENT'])) {
+							$lang = $key;
+							break;
+						}
+					}
+				}
+			}
+		}
+		if(!in_array($lang, $this->config['supported']))	$lang = $this->config['lang'];
+		$this->config['detected'] = $lang;
+		load_library('cookies')->set('lang', $lang);
+		return $lang;
+	}
+}
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/tpl/pbidir/header.php
===================================================================
--- websites/pbidir.com/bibivu/tpl/pbidir/header.php	2008-03-09 19:51:51 UTC (rev 1567)
+++ websites/pbidir.com/bibivu/tpl/pbidir/header.php	2008-03-09 20:53:17 UTC (rev 1568)
@@ -1,63 +1,63 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en" dir="ltr" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>pbiDIR<?=htmlentities($title!=''?' - '.$title:'')?></title>
-<?php
-foreach($link as $key=>$v1){
-	?><link <?php
-	foreach($v1 as $name=>$value){
-		?><?=$name?>="<?=addslashes($value)?>" <?php
-	}
-	?>/>
-<?php
-}
-foreach($meta as $key=>$v1){
-	?><meta <?php
-	foreach($v1 as $name=>$value){
-		?><?=$name?>="<?=addslashes($value)?>" <?php
-	}
-	?>/>
-<?php
-}
-foreach($script as $key=>$v1){
-	?><script <?php
-	foreach($v1 as $name=>$value){
-		?><?=$name?>="<?=addslashes($value)?>" <?php
-	}
-	?>></script>
-<?php
-}
-?><script language="javascript" type="text/javascript">
-<!--
-pathToLoadImage = "<?=TPLWEBPATH?>img/loadingAnimation.gif";
--->
-</script>
-</head>
-<body>
-<div id="container">
-	<div id="main">
-		<div id="header">
-			<div class="languages">
-				<a href="/bt/lang/en" class="language_flag"><img src="/bibivu/tpl/img/flag-EN.gif" title="english" alt="english" /></a>
-				<a href="/bt/lang/es" class="language_flag"><img src="/bibivu/tpl/img/flag-ES.gif" title="español" alt="español" /></a>
-				<a href="/bt/lang/it" class="language_flag"><img src="/bibivu/tpl/img/flag-IT.gif" title="italiano" alt="italiano" /></a>
-				<a href="/bt/lang/de" class="language_flag"><img src="/bibivu/tpl/img/flag-DE.gif" title="deutsch" alt="deutsch" /></a>
-				<a href="/bt/lang/fr" class="language_flag"><img src="/bibivu/tpl/img/flag-FR.gif" title="français" alt="français" /></a>
-			</div>
-			<h1 id="logo"><a href="<?=$home_uri?>"><?=load_library('lang')->get('pbidir')?></a></h1>
-			<form action="<?=$search_uri?>" method="get" id="search_form" class="search_form">
-				<input name="str" type="text" id="search_text" class="search_text" value="<?=$search_text?>" /><input type="submit" value="<?=load_library('lang')->get('search')?>" name="search" id="search_button" class="search_button" />
-			</form>
-		</div><?php
-/*
-		<div id="banner"><a onclick="window.open(this.href); return false;" href="http://www.pcbsd.org/"><img alt="PC-BSD" src="/bibivu/tpl/pbidir/images/pcbsd.png"/></a></div>
-*/
-		$this->show('pbidir/admin/menu');
-/*
-		if($task=='home'){
-			$this->show('pbidir/most_popular');
-		}
-*/
-		$this->show('pbidir/menu');
-		?>
-		<div id="content">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html lang="<?=load_library('lang')->get_lang()?>" dir="ltr" xml:lang="<?=load_library('lang')->get_lang()?>" xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>pbiDIR<?=htmlentities($title!=''?' - '.$title:'')?></title>
+<?php
+foreach($link as $key=>$v1){
+	?><link <?php
+	foreach($v1 as $name=>$value){
+		?><?=$name?>="<?=addslashes($value)?>" <?php
+	}
+	?>/>
+<?php
+}
+foreach($meta as $key=>$v1){
+	?><meta <?php
+	foreach($v1 as $name=>$value){
+		?><?=$name?>="<?=addslashes($value)?>" <?php
+	}
+	?>/>
+<?php
+}
+foreach($script as $key=>$v1){
+	?><script <?php
+	foreach($v1 as $name=>$value){
+		?><?=$name?>="<?=addslashes($value)?>" <?php
+	}
+	?>></script>
+<?php
+}
+?><script language="javascript" type="text/javascript">
+<!--
+pathToLoadImage = "<?=TPLWEBPATH?>img/loadingAnimation.gif";
+-->
+</script>
+</head>
+<body>
+<div id="container">
+	<div id="main">
+		<div id="header">
+			<div class="languages">
+				<a href="/bt/lang/en" class="language_flag"><img src="/bibivu/tpl/img/flag-EN.gif" title="english" alt="english" /></a>
+				<a href="/bt/lang/es" class="language_flag"><img src="/bibivu/tpl/img/flag-ES.gif" title="español" alt="español" /></a>
+				<a href="/bt/lang/it" class="language_flag"><img src="/bibivu/tpl/img/flag-IT.gif" title="italiano" alt="italiano" /></a>
+				<a href="/bt/lang/de" class="language_flag"><img src="/bibivu/tpl/img/flag-DE.gif" title="deutsch" alt="deutsch" /></a>
+				<a href="/bt/lang/fr" class="language_flag"><img src="/bibivu/tpl/img/flag-FR.gif" title="français" alt="français" /></a>
+			</div>
+			<h1 id="logo"><a href="<?=$home_uri?>"><?=load_library('lang')->get('pbidir')?></a></h1>
+			<form action="<?=$search_uri?>" method="get" id="search_form" class="search_form">
+				<input name="str" type="text" id="search_text" class="search_text" value="<?=$search_text?>" /><input type="submit" value="<?=load_library('lang')->get('search')?>" name="search" id="search_button" class="search_button" />
+			</form>
+		</div><?php
+/*
+		<div id="banner"><a onclick="window.open(this.href); return false;" href="http://www.pcbsd.org/"><img alt="PC-BSD" src="/bibivu/tpl/pbidir/images/pcbsd.png"/></a></div>
+*/
+		$this->show('pbidir/admin/menu');
+/*
+		if($task=='home'){
+			$this->show('pbidir/most_popular');
+		}
+*/
+		$this->show('pbidir/menu');
+		?>
+		<div id="content">



More information about the Commits mailing list