Skip to content
Arturas-Alfredas Lapinskas edited this page Jul 18, 2015 · 1 revision

Have some trouble with translating enum fields, this module helps but not for all.

So to translate $summary_fieds i use this:

class Order extends DataObject {

private static $db             = array(
    'OrderDate'        => 'Date',
    //MyEnumField need to translate
    'Status'           => 'i18nEnum("Pendling, Approved, Disaproved", "Pendling")'
);
//My summary field
private static $summary_fields = array(
    'i18nStatus'
);
//get the translation
public function geti18nStatus() {
    return _t('Order.db_Status_'.$this->Status, $this->Status);
}

Hope somebody helps!

Clone this wiki locally