multilingualactiverecord MultilingualActiveRecord

  1. This extension is give up, please visit new extension: i18n-activerecord
  2. Documentation
  3. Change Log

This extension is give up, please visit new extension: i18n-activerecord

url: http://www.yiiframework.com/extension/i18n-activerecord/

This extension simplifies the handling of multilingual content stored in the database.

It assumes that you use two tables for your content (one for the main content and a second one for the translations) with a one-to-many relationship between them.

Resources

Documentation

Requirements
  • Yii 1.1 or above
Installation
  • Extract the release file under protected/extensions
Usage

See the following code example:

class Product extends JMultilingualActiveRecord
{
    public function localizedAttributes()
    {
        return array('name','content');
    }

    public function languages()
    {
        return array('zh_cn');
    }

    public function primaryLang()
    {
        return array('en_us');
    }

    public function langClassName()
    {
        return __CLASS__.'Mui';
    }

    public function langForeignKey()
    {
        return 'owner_id';
    }
}

Change Log

Alpha 2
  • add filter by special attribute useage: News::model()->localized('zh_cn', 'title')->findAll(); it will only match title is not empty rows
2 1
4 followers
1 309 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Database
Tags:
Developed by: jerry2801
Created on: Jan 26, 2010
Last updated: 14 years ago

Downloads

show all