cvs: pear /I18N/Messages Common.php

From: Date: Fri, 22 Feb 2002 10:40:25 +0000
Subject: cvs: pear /I18N/Messages Common.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-2556@lists.php.net to get a copy of this message
cain Fri Feb 22 05:40:25 2002 EDT Modified files: /pear/I18N/Messages Common.php Log: - added italian, thanks to: Simone Cortesi <simone@cortesi.com> - renamed method get to determineLanguage, seems to fit better i guess Index: pear/I18N/Messages/Common.php diff -u pear/I18N/Messages/Common.php:1.3 pear/I18N/Messages/Common.php:1.4 --- pear/I18N/Messages/Common.php:1.3 Tue Feb 12 12:41:36 2002 +++ pear/I18N/Messages/Common.php Fri Feb 22 05:40:25 2002 @@ -16,7 +16,7 @@ // | Authors: Wolfram Kriesing <wolfram@kriesing.de> | // +----------------------------------------------------------------------+ // -// $Id: Common.php,v 1.3 2002/02/12 17:41:36 cain Exp $ +// $Id: Common.php,v 1.4 2002/02/22 10:40:25 cain Exp $ // /** @@ -34,9 +34,9 @@ { /** - * @var array $list this is simply a list of (all) languages, i extend it whenever a new language is added + * @var array $list this is simply a list of (all) languages, I extend it whenever a new language is added */ - var $list = array('en','de','es','fr'); + var $list = array('en','de','es','fr','it'); /** * @var array $ @@ -44,7 +44,8 @@ var $langString = array('en'=>'english', 'de'=>'german', 'es'=>'spanish', - 'fr'=>'french' ); + 'fr'=>'french', + 'it'=>'italian' ); /** * @@ -82,7 +83,7 @@ * @return string iso-string for the language * */ - function get( $string ) + function determineLanguage( $string ) { // we make it very simple for now, // this should be done using a db one day, either one that "learns" or one which is already a huge dictionary @@ -104,7 +105,17 @@ 'je','tu','il','elle','nous','vous','ils','elles','ma','mon','ta','ton','notre','votre', 'por','quoi','quand','qui','ou','combien', 'pour','par','apres','ce','mais','et','ou','oui','non','en','avec', - 'suis','est','avoir') ); + 'suis','est','avoir'), + + // italian provided by: Simone Cortesi <simone@cortesi.com> + 'it' => array( 'il','lo','la','i','gli','le', + 'questo','quello', + 'io','tu','lui','lei','ella','egli','noi','voi','loro','essi', + 'mio','tuo','suo','nostro','vostro', + 'chi','perché','quanto','quando','dove', + 'di','a','da','in','con','su','per','tra','fra', + 'essere','fare','avere') + ); $splitString = explode(' ',$string); // get each single word in a field foreach( $splitString as $key=>$aString ) // remove spaces around the word and make it lower case

« previous php.pear.cvs (#2556) next »