-
Notifications
You must be signed in to change notification settings - Fork 6
Home
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!