Fekide / strapi-plugin-translate

Strapi plugin for automated translations using different Translate Providers
https://market.strapi.io/plugins/strapi-plugin-translate
MIT License
45 stars 18 forks source link

[BUG]: Component relations inside dynamic zone disappear when translating from content manager #315

Open gaspop opened 11 months ago

gaspop commented 11 months ago

Describe the bug If a collection/single type has a dynamic zone, and a component inside that zone has a relation to another collection type/entity, this relation is reset when using "translate from another locale" inside the content manager and saving.

To Reproduce Steps to reproduce the behavior:

  1. In the content-type builder, Create a collection type called "Type A"
  2. Create a component called "Block", with a field relation to "Type A"
  3. Create another collection type called "Type B" with a dynamic zone, where you can add the "Block" component.
  4. In settings, under internationalization, add a second locale if there isn't one
  5. In the content manager, create an instance of "Type A", translate this instance to another locale.
  6. Create an instance of Type B, add a "Block" component to its dynamic zone and set the relation to the instance of "Type A"
  7. Open the new instance of Type B in the second locale, then press "Translate from another locale" and select the first locale.
  8. Before saving, look at the component inside the dynamic zone, it should show a relation to the translated instance of "Type A".
  9. Save, leave the translated instance and return, look at the component inside the dynamic zone again. The relation is gone.

Expected behavior When pressing save after selecting "translate from another locale", relations in components in dynamic zones should not be lost.

Screenshots N/A

System (please complete the following information):

Plugin config Please add your plugin config here, e.g.

module.exports = {
  translate: {
    enabled: true,
    config: {
      provider: 'deepl',
    },
  },
}

Additional context It looks as if the relation is still there after translating, but it isn't kept when saving. The problem only occurs when translating in the content manager, not when batch translating.