prefill field form with default locale content when adding translation #2054
Replies: 2 comments 2 replies
-
Is this different in some way from the the I am not sure I follow what you're proposing, if this is different from fallback I'll need you to maybe elaborate more. edit - link to docs https://payloadcms.com/docs/configuration/localization#enabling-in-the-payload-config |
Beta Was this translation helpful? Give feedback.
-
Hi Dan, Sorry about that, i'l try to better explain my use case. Admins who translate content within the GUI face an empty form after they switch language after creating a new item via de admin GUI, only the id placeholder for the title is shown. So the workflow would be:
The question is regarding step 6: Would it be possible to set a default value for the text based form fields, where this default value is de data from the default language. So instead of starting with an empty form, for example the title and a description (EN) will be filled with the title and description from the default language (NL) which makes is easier to translate as you can translate the content directly in the field. One way to solve this would be to add for example the item data to the defaultValue function arguments, like the validation functionality.
Working with the defaultValue setting is a good option but would be repetitive as it is the same system for all fields. So a field settings could also be an option, something like this:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Would it be possible to prefill a translatable field with the saved content of the default language? For example:
An option would be to use the defaultValue field option and load the content there, but at the moment only locale and user are populated there. Does somebody has a suggestion on how to handle this without custom frontend components? Handling this on a global scope would be even better.
Beta Was this translation helpful? Give feedback.
All reactions