Setting and maintaining the language in Application (i18n)

Comparing #7 with #10

Tags

i18n, translation

Content

[...]
{
$currentLang = Yii::app()->language;
$this->render('langBox', array('currentLang' => $currentLang));
}
}
?>
 
``` **components/views/langBox.php** ```php <?php
 
<?=
 echo CHtml::form(); ?> <div id="langdrop"> <?=php echo CHtml::dropDownList('_lang', $currentLang, array( 'en_us' => 'English', 'is_is' => 'Icelandic'), array('submit' => '')); ?> </div> </form>
 
 
```
 
?php echo CHtml::endForm(); ?>
 
```
 
 
See also
 
------------------
 
- [Here](http://www.yiiframework.com/wiki/208/how-to-use-an-application-behavior-to-maintain-runtime-configuration/ "How to use an application behavior to maintain runtime configuration") is another approach using behaviors.
 
 
Links
 
-----
 
- [Chinese version](http://www.itkuaixun.com/bbs/thread-203-1-1.html "Chinese version")