Help with DropDownBox to change language

Hello,

Cannot find a tutorial for creating a change language dropdown to be included across my yii site.

I’ve seen this wiki post: http://www.yiiframework.com/wiki/26/setting-and-maintaining-the-language-in-application-i18n/

Do all my controllers have to extend MyController?

I supposse there is a better way to create a dropdown language switcher. Is there?

You may create the widget for fetching available languages from DB, and then in your layout create dropdown.

I wrote a little extension called DropDownRedirect (it is a widget) which can help you to do that. See the exemple of how I used it, it is exactly what you want i think.

Thanks for the info.

Where goes avalaibleLanguages function?

I forgot it, sorry.

This is in my WebUser class:




public function getAvalaibleLanguages() {

		return array('en' => Yii::t('site', 'english'), 'fr' => Yii::t('site', 'french'));

}



Thanks for telling me:)

The extension is broken by Yii 1.1.5. :)

Solved by this post -> Here ;)