Ticket #109 (assigned enhancement)

Opened 4 years ago

Last modified 2 years ago

Proposed interface for I18n-Columns in ActiveRecord

Reported by: Kaste Assigned to: bermi (accepted)
Priority: major Milestone: 2.0
Component: Active Record Keywords:
Cc:

Description

goal: cleaner, faster code. clean interface.

decouple Model from the (global) "available Locales" you define in the config.

see [460]: Look at the unit-test for specifications and usage. Look at the model for the usage. Look at the class I18nizedActiveRecord for the implementation.

Usage: Let's assume we have the columns en_title, es_title (...) in the model. You get some virtual attributes simply by putting $this->addVirtualAttributesForInternationalizedColumn('title'); in the constructor of the model.

Now the attribute 'title' will point to the column that matches the current locale. //=> en_title

The attribute 'titles' will hold an array of all columns keyed by the locale. //=> array('en'=>...,'es'=>...);

Change History

12/19/09 21:57:08 changed by bermi

  • owner set to bermi.
  • status changed from new to assigned.
  • milestone changed from 1.0.1 to 2.0.