21301 Posts in 5735 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 667 Views |
-
Making an element NOT translatable

1 April 2011 at 3:49am
I have a dual language website,
and I have added various extra Text fields to my Page class, specific to the website I'm making.
However, I want these extra fields to be non-translatable, so I want them to have identical content for both languages, and not have to update the field in both languages if something changes.How can I do this?
By default, it translates everything I add to a class...Thanks in advance.
-
Re: Making an element NOT translatable

5 April 2011 at 8:44pm
It's basically an easy question: I have a multilingual website, and all I want is for some fields (like a custom Text or something simple) to be *not* translated, so I want it to be identical in both languages?
Anyone please?
-
Re: Making an element NOT translatable

17 April 2011 at 10:31pm
Sorry, thats not possible with the current database row setup. A quick workaround is to create a custom getter, and always retrieve the main translation value.
function getMyUntranslatedField() {
$t = $this->getTranslation('en_US');
return $t ? $t->getField('MyUntranslatedField') : null;
}function getCMSFields() {
$fields = parent::getCMSFields();
// avoid the field being edited on translations
if($this->Locale != 'en_US') $fields->fieldByName('MyUntranslatedField')->makeReadonly();
return $fields;
}I know its a big limitation of the datamodel, it was a tradeoff...
I'm looking for help adding this "field exclusion" mechanism to the core if you're keen.
| 667 Views | ||
|
Page:
1
|
Go to Top |


