Forums / Developer / How to set up a non translatable datatype ?

How to set up a non translatable datatype ?

Author Message

Jerome Despatis

Monday 09 November 2009 7:39:08 am

Hi

I'm coding a datatype, but it contains only specfic data, and i don't want the user to be able to set different values for different languages for this datatype.

In fact, i'd like that any attribute with this datatype to be untranslatable.

I can, of course, set it in the admin interface, but is it possible to set it directly in the datatype class ?

i've tried, the following code in my datatype constructor:

$this->eZDataType(self::DATA_TYPE_STRING, "Extension..", array('translation_allowed' => false));

It shows in the interface the language is disabled for this attribute, so it seems to work, but NOT!

in the ezcontentclass_attribute, i can see for this attribute that the fied 'can_translate' is at 1, and not 0

Any idea is welcome

Romain Petit

Wednesday 11 November 2009 2:43:23 pm

Hi,

In your datatype's "edit" template :

{if eq($attribute.object.initial_language_code,$attribute.language_code)}

inputs... etc....

{else}

nothing, your not in the initial language

{/if}