Bug #88936
closedTCA config.default value can not be localized
0%
Description
TCA config.default value can not be localized.
It shows not the value from the xlf file instead the complete "LLL:..." string.
Example:
'example_field' => [
'label' => 'LLL:EXT:extKey/Resources/Private/Language/locallang.xlf:label',
'description' => 'LLL:EXT:extKey/Resources/Private/Language/locallang.xlf:description',
'config' => [
'type' => 'input',
'default' => 'LLL:EXT:extKey/Resources/Private/Language/locallang.xlf:default'
]
],
Updated by Josef Glatz over 5 years ago
According to the docs, there was no support for LLL strings for ['columns']['*']['config']['default'] =
(checked master, 9.5, 8.7, 7.6, 6.2)
I suggest to transform this to a feature. Beside that I think it could get pretty tricky to get the default value based on the current site configuration and activate language in formEngine/TCA/DataHandler.
Updated by Georg Ringer over 5 years ago
- Status changed from New to Needs Feedback
We had this feature request already and it has been declined for a good reason. The used language for the translation would be the one of the backen editor and not the one of the record which is created. As an example: A native german editor will have his backend in german to make the life easier. So if the editor adds content to his blog which is default in english and maybe german and itialian translation, he will get itlian labels into his german or english content? what is the benefit?
It is very easy with the current formengine concept to provide custom default values (take a look at e.g. EXT:news and the default archive date) and there is no problem at all to publish that as extension as well. For the core I would decline the request, can you agree on that?
Updated by Christian Hackl over 5 years ago
oh yes you are right, that makes sense - because I did not think about it right - sry. :)
TCA is only for BE... so yeah...
It would be cool anyway, if such values of the TCA, such as a default value which is actually meant for the FE, could be translated accordingly...
but I can imagine that this would not be that easy at the moment ... so closed by me
Updated by Georg Ringer over 5 years ago
- Status changed from Needs Feedback to Rejected
Updated by Michael Stopp over 3 years ago
I know I'm late to the party and this issue is closed.
But I'd still like to weigh in on one aspect:
Your rejecting comments suggest that the presented solution by OP wouldn't work because it is somehow conceptually unsound.
But I think it's actually quite clear (I'm not saying easy to implement though): the default value is content, so it has nothing to do with the current BE user language, but with the record language. So if an editor with an Italian BE works on a German record, the default value should come from a German locallang file. If that's not available, the default language is used.
The placeholder value in TCA is a different case: that is clearly an instruction/help for the current editor, hence it needs to be in the BE language.
I still think the issue is valid and it's a missing feature. Unless I have completely missed something, I don't see why the suggested solution wouldn't work conceptually (if done right...).
But again: I don't know how difficult it would be to implement in practical terms, because I don't have enough insight into the deeper layers of this matter.