Feature #103062

Updated by Yann Weyer 4 months ago

Some fields should remain need to be empty when creating a new translation, instead of copying the original value. translating them. This is for example the case for optional SEO fields, that would fallback to the title of the page/record when empty. Copying Keeping the original languages value in those fields makes it very likely to display original language on translated pages whenever increases the risk of editors forget forgetting to edit them to the target language. language, and displaying text in the original languageā€¦ 

 The @l10n_mode@ behaves differently between pages and records (see, 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.