previousTranslation2_Decorator_ErrorText クラス概要 (Previous) (Next) Translation2_Decorator_Iconv クラス概要next

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

Translation2_Decorator_Lang クラス概要

Translation2_Decorator_Lang クラス概要 – 空の文字列に対する代替言語を提供するデコレータ

Lang デコレータの例

空の文字列に対する代替言語を提供したい場合に有用なデコレータです。 スタックに積み重ねることが可能で、複数のデフォルト言語を設定することができます。 setOption() でパラメータ fallbackLang を使用すると、現在のデコレータの代替言語を指定できます。

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

// メインの言語として英語を設定します
$tr->setLang('en');

// 最初の代替言語としてイタリア語を設定します
$tr =& $tr->getDecorator('Lang');
$tr->setOption('fallbackLang''it');

// その次の代替言語としてスペイン語を設定します
$tr =& $tr->getDecorator('Lang');
$tr->setOption('fallbackLang''es');
?>

previousTranslation2_Decorator_ErrorText クラス概要 (Previous) (Next) Translation2_Decorator_Iconv クラス概要next

Download Documentation Last updated: Sun, 21 Jun 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.