Übersetzungen für DCA werden teilweise nicht geladen?
Hallo beinander,
ich hab einen eigenen Inhaltstyp über diese DCA Dingens erstellt und versuche jetzt die Labels zu benennen. Ganz so, wie es in der Doku steht.
Aber aus irgendeinem mir unerfindlichen Grund wollen manche Labels einfach nicht benannt werden. Hab Prod & Dev Cache gelöscht, den Dev Server neugestartet, composer cache gelöscht, ja selbst den kompletten Rechner neugestartet aus Verzweiflung. Der betreffende Teil ist "risk_level" und "profit_level". Die Optionslabels werden nur als "very_low", "middle" usw. angezeigt, statt "Very Low" usw. Komischerweise hat "risk_level" mal funktioniert. Jetzt aber plötzlich nicht mehr. Außerdem hatte ich gestern noch Probleme mit "finproduct_legend", aber heute wohl nicht mehr.
PHP-Code:
$GLOBALS['TL_DCA']['tl_finproduct'] = [
'config' => [
'dataContainer' => DC_Table::class,
'enableVersioning' => true,
'switchToEdit' => true,
'sql' => [
'keys' => [
'id' => 'primary'
]
]
],
'list' => [
'sorting' => [
'mode' => 1,
'fields' => ['name'],
'flag' => 1,
'panelLayout' => 'search,limit'
],
'label' => [
'fields' => ['name'],
'format' => '%s'
],
'operations' => [
'editheader' => [
'href' => 'act=edit',
'icon' => 'header.svg'
],
'delete' => [
'href' => 'act=delete',
'icon' => 'delete.svg'
],
'show' => [
'href' => 'act=show',
'icon' => 'show.svg'
]
]
],
'fields' => [
'id' => [
'sql' => ['type' => 'integer', 'unsigned' => true, 'autoincrement' => true],
],
'tstamp' => [
'sql' => ['type' => 'integer', 'unsigned' => true, 'default' => 0]
],
'name' => [
'search' => true,
'inputType' => 'text',
'eval' => ['maxlength' => 255, 'mandatory' => true],
'sql' => ['type' => 'string', 'length' => 255, 'default' => '']
],
'description' => [
'search' => true,
'inputType' => 'textarea',
'eval' => ['mandatory' => true, 'allowHtml' => true, 'rte' => 'tinyMCE'],
'sql' => 'text'
],
'risk_level' => [
'search' => false,
'inputType' => 'select',
'eval' => ['mandatory' => true, 'tl_class' => 'w50'],
'reference' => &$GLOBALS['TL_LANG']['tl_finproduct']['risk_level']['values'],
'options' => [
1 => 'very_low',
2 => 'low',
3 => 'middle',
4 => 'high',
5 => 'very_high'
],
'sql' => ['type' => 'string', 'length' => 100, 'default' => 1]
],
'profit_level' => [
'search' => false,
'inputType' => 'select',
'eval' => ['mandatory' => true, 'tl_class' => 'w50'],
'reference' => &$GLOBALS['TL_LANG']['tl_finproduct']['profit_level']['values'],
'options' => [
1 => 'very_low',
2 => 'low',
3 => 'middle',
4 => 'high',
5 => 'very_high'
],
'sql' => ['type' => 'string', 'length' => 100, 'default' => 1]
]
],
'palettes' => [
'default' => '{finproduct_legend},name,description,risk_level,profit_level'
],
];
Die Übersetzungsdatei:
PHP-Code:
$GLOBALS['TL_LANG']['tl_finproduct']['new'] = ['Create new product', 'Creates a new product'];
$GLOBALS['TL_LANG']['tl_finproduct']['edit'] = ['Edit product ID %s', 'Edit product ID %s'];
$GLOBALS['TL_LANG']['tl_finproduct']['finproduct_legend'] = 'Financial Product';
$GLOBALS['TL_LANG']['tl_finproduct']['name'] = ['Name', 'Name of the financial product'];
$GLOBALS['TL_LANG']['tl_finproduct']['description'] = ['Description', 'Description of the financial product'];
$GLOBALS['TL_LANG']['tl_finproduct']['risk_level']['values']['very_low'] = 'Very low';
$GLOBALS['TL_LANG']['tl_finproduct']['risk_level']['values']['low'] = 'Low';
$GLOBALS['TL_LANG']['tl_finproduct']['risk_level']['values']['middle'] = 'Middle';
$GLOBALS['TL_LANG']['tl_finproduct']['risk_level']['values']['high'] = 'High';
$GLOBALS['TL_LANG']['tl_finproduct']['risk_level']['values']['very_high'] = 'Very High';
$GLOBALS['TL_LANG']['tl_finproduct']['risk_level'] = ['Risk Level', 'Risk level of the financial product'];
$GLOBALS['TL_LANG']['tl_finproduct']['profit_level']['values']['very_low'] = 'Very low';
$GLOBALS['TL_LANG']['tl_finproduct']['profit_level']['values']['low'] = 'Low';
$GLOBALS['TL_LANG']['tl_finproduct']['profit_level']['values']['middle'] = 'Middle';
$GLOBALS['TL_LANG']['tl_finproduct']['profit_level']['values']['high'] = 'High';
$GLOBALS['TL_LANG']['tl_finproduct']['profit_level']['values']['very_high'] = 'Very High';
$GLOBALS['TL_LANG']['tl_finproduct']['profit_level'] = ['Profit Level', 'Profit level of the financial product'];
Und der DEBUG Output via contao-console von einem der beiden Felder:
PHP-Code:
"profit_level" => array:7 [
"search" => false
"inputType" => "select"
"eval" => array:2 [
"mandatory" => true
"tl_class" => "w50"
]
"reference" => &10 null
"options" => array:5 [
1 => "very_low"
2 => "low"
3 => "middle"
4 => "high"
5 => "very_high"
]
"reference" ist komischerweise "null". Ich versteh's grad nicht... Vielleicht hat jemand ne Idee? Danke schonmal. :)