There is no license information available for the latest version (dev-master) of this package.

Translatable Enum fieldtype for Silverstripe.

Installs: 1 347

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 3

Forks: 6

Open Issues: 2


dev-master 2015-12-23 18:18 UTC

This package is not auto-updated.

Last update: 2024-07-06 13:07:12 UTC



Translatable Enum fieldtype

Maintainer Contact

Elvinas Liutkevičius

<elvinas (at) unisolutions (dot) eu>


SilverStripe 3


Simply install the module using the standard method.

Now you can create datafield with translatable enum Field:

class MyDataObject extends DataObject {
	public static $db = array(
		'DbField' => "i18nEnum('default, other', 'default')",

To get translated Enum value in GridField, you need to return the value in this way:

class MyDataObject extends DataObject {
	public function DbField() {
		return i18nEnum::getTranslatedValue($this->className, __FUNCTION__, $this->{__FUNCTION__});

By default translation namespace will be your DataObject class name and the entity will be constructed like this: "db_{DbField}_{enum value}". So your translation file should look like this:

    db_DbField_default: 'Default'
    db_DbField_other: 'Other'

Known issues

  • GridField filtering in GridFieldFilterHeader won't work as expected - it still constructs the search filter using enum values only.