Hallo Toflar...
ja... das mit der "initconfig" hat funktioniert . Hintergrund war das ich ein bestehendes Projekt auf Contao umsetzen möchte http://deal4you.es
Das Projekt habe ich mit dem Yii-Framework erstellt darum würde es mir auch sehr gefallen wenn
Contao 3 das Yii-Framework nutzen würde.
Wie gesagt ging es mir darum mit wenig aufwand im Backend Gutscheine usw. Mehrsprachig zu erfassen ohne für die jeweilige Sprache einen neuen Datensatz anlegen zu müssen.
Die Widget-Klasse von Contao habe ich durch meine eigene ersetzt... Die Mehrsprachigen Inhalte werden als serialisiertes Array in einem Feld (name=translation, type = text)
der Tabelle gespeichert.
DCA:
Code:
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_deal_coupons']['title'],
'exclude' => true,
'inputType' => 'text',
'eval' => array(
'mandatory'=>true,
'maxlength'=>10,
'tl_class'=>'w50',
'translation' => true,
),
),
'sub_title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_deal_coupons']['sub_title'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'w50',
'translation' => true
),
),
'short_description' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_deal_coupons']['short_description'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'long clr',
'translation' => true
),
),
'long_description' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_deal_coupons']['long_description'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array('tl_class'=>'long clr',
'translation' => true
),
),
'options' => array(
'label' => &$GLOBALS['TL_LANG']['tl_deal_clients']['street2'],
'exclude' => true,
'inputType' => 'optionWizard',
'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'long clr',
'translation' => true
),
)
Man muss sich um nichts mehr kümmern... Ein klick auf die Flagge (grau = Übersetzung fehlt, farbig = Übersetzung vorhanden) und das übersetzende
Textfeld/Options/usw (Alle Widgets werden unterstüzt) öffnet sich.
Sollte Interesse bestehen könnte die Widget-Klasse in den Core übernommen werden.
Lesezeichen