how to use this extention (multilang)

hi friend’s

how to use this extention : http://www.yiiframework.com/extension/yii-multilanguage

???

The wiki don’t write about the case we need inserting, updateing multilang data records.

When insert it will use main (Post) model’s fields (ex: title) as default value for (PostLang),

and insert into post_lang 3 records, but blank l_title for the other languages.

After read the MultilangBehavior code I figured out we can simply handle this:




// Assume default lang is en

$model = new Post();

....

// With title is one of localizedAttributes and 'languages'=>array ('en', 'ja', 'vi');

$model->ml->setLangAttribute('title_ja', 'In Japanese Post title');

$model->ml->setLangAttribute('title_vi', 'In Vietnamese Post title');

....

$model->save();



Hope this help.

[color="#006400"]/* moved from General Discussion */[/color]