cvs: pear /I18N/examples I18N_Message.php
| From: | Wolfram Kriesing | Date: | Tue, 12 Feb 2002 17:29:10 +0000 |
| Subject: | cvs: pear /I18N/examples I18N_Message.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2407@lists.php.net to get a copy of this message | ||
cain Tue Feb 12 12:29:10 2002 EDT
Added files:
/pear/I18N/examples I18N_Message.php
Log:
- example, for showing how it works (i still dont know if examples are ok here)
Index: pear/I18N/examples/I18N_Message.php
+++ pear/I18N/examples/I18N_Message.php
<?php
/**
*
* test of Message_Common
*
*/
print 'TEST I18N_Messages_Common<br><br>';
require_once( 'I18N/Messages/Common.php' );
$strings[] = 'This is a test for all of you out there';
$strings[] = 'Das ist ein Test für euch alle da draussen.';
$strings[] = 'Esto es una prueba para todos vosotros ahi.';
foreach( $strings as $aString )
print "<b>$aString</b> --- seems to be of the language:
".I18N_Messages_Common::get($aString).'<br>';
/**
*
* test of Message_Translate
*
* DB file: http://wolfram.kriesing.de/libs/php/examples/SimpleTemplate/translate.sql
*
*/
print '<br><br>TEST I18N_Messages_Translate<br><br>';
require_once( 'I18N/Messages/Translate.php' );
$translate = new I18N_Messages_Translate( 'mysql://root@localhost/test' );
$translated[] = $translate->simpleTranslate( 'source code' , 'de' );
$translated[] = $translate->translate( 'translate (i.e. into ($someVar-or any other
string))' , 'de' );
$translated[] = $translate->translateMarkUpString( $input , 'de' );
foreach( $translated as $aTrans )
print "$aTrans<br>";
print_r( $translate->getAll( 'de' ) );
?>