fixex #4729 : Today it's not possible for example to translate empty fields with external APIs with the preSave because the preSave expect to return only a datathat not contain i18n values.
With this kind of code, we should be able to update the i18n values :
CMS.registerEventListener({
name: 'preSave',
handler: async ({ entry }) => {
return entry.setIn(["i18n", "it", "data", "title"], "my translated title for IT");
}
});
The change has no regression. PreSave can return data/entry modifications.
Summary
fixex #4729 : Today it's not possible for example to translate empty fields with external APIs with the
preSave
because thepreSave
expect to return only adata
that not containi18n
values.With this kind of code, we should be able to update the i18n values :
The change has no regression.
PreSave
can return data/entry modifications.Test plan
In Progress
Checklist
Please add a
x
inside each checkbox:A picture of a cute animal (not mandatory but encouraged)