hi,
for my site i want to show some articles on a article holder page. every article is saved as an dataobject to the db, not to the sitetree. the translation (i18n) for my sitetree elements works fine. But how can i use i18n for my dataobjects.
At the moment i have done the following but i think, that is not the right way?!
I have added a new object (transtable) to my _config.php: Object::add_extension('Dermatologie', 'Translatable');
After "dev/build" i got the new table "dermatologie_translationgroups". But i did not know to pass the values to it. So i decided to fill the new field "Locale" in "Dermatologie" with the language values used on the site:
function getCMSFields() {
$array = array(
'de_DE' => 'deutsch',
'en_GB' => 'englisch',
'ru_RU' => 'russisch',
'fr_FR' => 'französisch',
'es_ES' => 'spanisch',
);
$fields = new FieldSet(
new CheckboxField('anzeigen', 'Artikel ein-/ausblenden'),
new CalendarDateField('gueltigab', 'Anzeigen ab dem'),
new DropdownField(
'Locale',
'sprache wählen',
$array
),
new TextareaField('Headline', 'Überschrift'),
new TextareaField('Subheadline', 'Subheadline'),
new HtmlEditorField('Copytext', 'Artikeltext'),
new ImageField('Thumb', 'Artikelbild')
);
return $fields;
}
So i am able to give eache article a specific language.
Here are my questions:
1. How can i get the languages currently used in my Sitetree (translations) to pass them to my array. So it is more flexible in future.
2. I think this is the wrong way to solve this problem. How do you translate your dataobjects?
3. Does anybody know if there is a way tou use "/dev/tasks/i18nTextCollectorTask" without PHPUnit being installed on the Server (shared Hosting, CGI)?
I hope the will be a helpful discussion on item 2 ;-)
Greetings, Carsten.