ok, no answer
and neither DOM nor CTF seem to like my translatable DataObjects very much...
so i ended up doing following:
- truned OFF Translatable for my DataObject
- added following fields: 'Title_en_US' and 'Description_en_US' (my default locale is de_DE)
- so i won't have to duplicate my gallery images for translation (like Translatable does in SiteTree) and have information for all languages in one Dataobject.
in my GalleryImage.php i added a function like this:
public function localeTitle() {
if (Director::currentPage()->Locale != Translatable::default_locale()) {
$functionName = 'Title_'.Director::currentPage()->Locale;
$this->Title = $this->$functionName;
}
return $this->Title;
}
and similar for description so i can access the right (translated) title and description from my templates.
in my GalleryPage.php i did something this:
function translatedGalleryImages() {
$Data = $this -> GalleryImages();
// Get Dataobjects from Original-Languague-Page
if ($this->Locale != Translatable::default_locale()) {
$Data = $this->getTranslation(Translatable::default_locale()) -> GalleryImages();
}
return $Data;
}
so i can control the translated Dataobjects in the Template with <% translatedGalleryImages %>
and in in function getCMSFields():
...
$galeriemanager = new HasManyComplexTableField(... ctf config ....);
...
if (Director::currentPage()->Locale == Translatable::default_locale()) {
$fields->addFieldToTab('Root.Content.Galerie', $galeriemanager);
} else {
$fields->addFieldToTab('Root.Content.Galerie', new LiteralField('Gallery Message','<p>Galerie bitte in Standardsprache ('.Translatable::default_locale().') bearbeiten</p><p>Please edit your gallery in default language ('.Translatable::default_locale().')</p>'));
}
return $fields;
...
maybe one can define the original language as fallback (Title/Description) or filter objects which have/haven't filled out fields for current displayed language...