Ticket #109 (new enhancement)

Opened 1 year ago

Proposed interface for I18n-Columns in ActiveRecord

Reported by: Kaste Assigned to:
Priority: major Milestone: 0.9
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'=>...);