cvs: pear /Translation2/docs/examples Translation2_example.php
| From: | Lorenzo Alberton | Date: | Fri, 23 Apr 2004 15:01:53 +0000 |
| Subject: | cvs: pear /Translation2/docs/examples Translation2_example.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-18630@lists.php.net to get a copy of this message | ||
quipo Fri Apr 23 11:01:53 2004 EDT
Modified files:
/pear/Translation2/docs/examples Translation2_example.php
Log:
stay up-to-date with latest changes
http://cvs.php.net/diff.php/pear/Translation2/docs/examples/Translation2_example.php?r1=1.6&r2=1.7&ty=u
Index: pear/Translation2/docs/examples/Translation2_example.php
diff -u pear/Translation2/docs/examples/Translation2_example.php:1.6
pear/Translation2/docs/examples/Translation2_example.php:1.7
--- pear/Translation2/docs/examples/Translation2_example.php:1.6 Fri Apr 23 09:49:29 2004
+++ pear/Translation2/docs/examples/Translation2_example.php Fri Apr 23 11:01:53 2004
@@ -18,11 +18,11 @@
$tr->setLang('it');
$tr->setPageID();
$tr =& $tr->getDecorator('CacheMemory');
-//$tr->prefetch = false;
+//$tr->setOption('prefetch', false);
$tr =& $tr->getDecorator('Lang');
-$tr->setFallbackLang('en');
+$tr->setOption('fallbackLang', 'en');
$tr =& $tr->getDecorator('Lang');
-$tr->setFallbackLang('de');
+$tr->setOption('fallbackLang', 'de');
// =[DEBUG INFO]======================================
@@ -43,21 +43,16 @@
// set an 'English Decorator', i.e. add English as a fallback language
\$tr = & \$tr->getDecorator('Lang');
-\$tr->setFallbackLang('en');
+\$tr->setOption('fallbackLang', 'en');
// add a 'German Decorator', i.e. add German as a third fallback language
\$tr = & \$tr->getDecorator('Lang');
-\$tr->setFallbackLang('en');
+\$tr->setOption('fallbackLang', 'en');
EOT;
// ====================================================
debug($str);
-//$tr = &new Translation2_Decorator_CacheMemory(&$tr);
-//$tr->prefetch = false;
-//$tr = &new Translation2_Decorator_CacheLiteFunction(&$tr);
-//$tr->setCacheLite(new Cache_Lite_Function($cache_options));
-
debug('$tr->get(\'test\');');
writeValue('test', $tr->get('test'));
debug('$tr->get(\'only_english\'); //test fallback language for a string not
translated in Italian');
@@ -104,7 +99,7 @@
$tr = & $tr->getDecorator('CacheMemory');
//$tr->prefetch = false;
$tr = & $tr->getDecorator('Lang');
-$tr->setFallbackLang('it');
+$tr->setOption('fallbackLang', 'it');
// =[DEBUG INFO]======================================
@@ -124,7 +119,7 @@
// set an 'Italian Decorator', i.e. add Italian as a fallback language
\$tr = & \$tr->getDecorator('Lang');
-\$tr->setFallbackLang('it');
+\$tr->setOption('fallbackLang', 'it');
EOT;
// ====================================================
debug($str);
@@ -172,7 +167,7 @@
$tr->setLang('it');
-$tr->setFallbackLang('en');
+$tr->setOption('fallbackLang', 'en');
$tr->setParams(array(
0 => '',
'user' => 'Joe',
@@ -184,7 +179,7 @@
// =[DEBUG INFO]======================================
$str = <<<EOT
\$tr->setLang('it');
-\$tr->setFallbackLang('en');
+\$tr->setOption('fallbackLang', 'en');
\$tr->setParams(array(
0 => '',
'user' => 'Joe',
@@ -208,7 +203,7 @@
// =[DEBUG INFO]======================================
$str = <<<EOT
// set a 'SpecialChars Decorator' to replace htmlentities
-\$tr = &new Translation2_Decorator_SpecialChars(&\$tr);
+\$tr = & Translation2->getDecorator('SpecialChars');
\$tr->setOptions(array('charset' => 'ISO-8859-1'); //default
EOT;
// ====================================================
@@ -244,13 +239,13 @@
writeTitle('HANDLE CONFLICTS');
$tr->setLang('en');
-$tr->setFallbackLang('it');
+$tr->setOption('fallbackLang', 'it');
$tr->setPageID('in_page');
// =[DEBUG INFO]======================================
$str = <<<EOT
\$tr->setLang('en');
-\$tr->setFallbackLang('it');
+\$tr->setOption('fallbackLang', 'it');
\$tr->setPageID('in_page');
EOT;
// ====================================================