previousClass Summary Translation2_Decorator_ErrorText (Previous) (Next) Class Summary Translation2_Decorator_Iconvnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Class Summary Translation2_Decorator_Lang

Class Summary Translation2_Decorator_Lang – Decorator to provide a fallback language for empty strings.

Lang Decorator Example

This decorator is very useful when you want to provide a fallback language for empty strings. It is stackable, so you can have more than one default language. Use setOption() with the fallbackLang parameter to specify the fallback language of the current decorator.

<?php
$tr 
= new Translation2($driver$dbinfo$params);

//set English as the main language
$tr->setLang('en');

//set Italian as the first fallback language
$tr =& $tr->getDecorator('Lang');
$tr->setOption('fallbackLang''it');

//set Spanish as the second fallback language
$tr =& $tr->getDecorator('Lang');
$tr->setOption('fallbackLang''es');
?>

previousClass Summary Translation2_Decorator_ErrorText (Previous) (Next) Class Summary Translation2_Decorator_Iconvnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.