Feature #103062
openMissing l10n_mode option to not copy the field
0%
Description
Some fields should remain empty when creating a new translation, instead of copying the original value. This is the case for optional SEO fields, that would fallback to the title of the page/record when empty. Copying the original languages value in those fields makes it very likely to display original language on translated pages whenever editors forget to edit them to the target language.
The l10n_mode
behaves differently between pages and records (see https://forge.typo3.org/issues/97526), making it it technically possible to prevent translating a field in pages by removing its l10n_mode
attribute (although this is not documented).
l10n_mode | Pages | Other records |
---|---|---|
(unset) | field will not be copied | field will be copied (without a prepending string) |
"" | field will be copied (without a prepending string) | field will be copied (without a prepending string) |
It would be useful to have a clearly defined and documented l10n_mode
that prevents fields from being copied, in both pages and other records.
Right now, our workaround was to create a hook for processDatamap_postProcessFieldArray
that runs only for translation operations ($status === 'new'
and the transOrigPointerField
has a value), loops over all $GLOBALS['TCA'][$table]['columns']
and unsets all $fieldArray
keys for which the l10n_mode
is noCopy
.
It's working fine, but it would probably make sense to offer such an option directly in the native DataHandler, and ensure a consistent behaviour between pages and other records.