Yii 1.1: Useful Multilanguage extensions collection and use.

5 followers

What I want to achieve:

  1. to use multi language url like this:
    http://www.your-domain-example.com/en/some-action/
    http://www.your-domain-example.com/cn/some-action/
  2. different URLs with different views/text
  3. some contents in DB (database) could also auto replaced by some language tags.

After looking around on the forum, and the best multi language extensions or examples I have experience is as below:

for the 1th:
SEO-conform Multilingual URLs + Language Selector Widget (i18n)

for the 2nd:
国际化 (I18N)
When Should Use Of I18N In Application?

for the 3rd:
i18n-columns

I am sure it's very useful tips above to do a multi language site and save time to do yours. I will show here next time.

Total 2 comments

#14427 report it
cihappy at 2013/08/11 06:22am
some patch for migations

to resolove "No new migration found. Your system is up-to-date." just execute:

yiic migrate create 【tablename】 then yiic migrate

#14420 report it
cihappy at 2013/08/10 06:53am
more fun with search/dbcritical

I also need this:

http://www.yiiframework.com/extension/multilingual-behavior/

To enable search on translated fields, you can modify the search() function in the model like this :

public function search() { $criteria=new CDbCriteria;

//...
//here your criteria definition
//...

return new CActiveDataProvider($this, array(
    'criteria'=>$this->ml->modifySearchCriteria($criteria),
    //instead of
    //'criteria'=>$criteria,
));

}

so I have to modifySearchCriteria for my own use.

Leave a comment

Please to leave your comment.

Write new article