moisty70
(Moisesalonso)
October 24, 2010, 6:52pm
1
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.
parcouss
(Julien Parc)
October 24, 2010, 11:17pm
3
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.
moisty70
(Moisesalonso)
October 25, 2010, 9:51am
4
Thanks for the info.
Where goes avalaibleLanguages function?
parcouss
(Julien Parc)
October 25, 2010, 7:13pm
5
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:)
jacmoe
(Jacob Moena)
November 14, 2010, 11:47pm
6
The extension is broken by Yii 1.1.5.
jacmoe
(Jacob Moena)
November 15, 2010, 5:49pm
7
Solved by this post -> Here