How to create localized entries from code?

Hi,

I’m currently using this in my own take of the strapi-plugin-import-content plugin (GitHub - kiddicolour/strapi-plugin-import-content)

What I ended up with is a 2 step process:

  1. Creat the localized records, using the id from the record containing the default language values
    see line 54 of the import-content service

  2. Update all the records with the localizations array including the id
    see line 173 of the import-content service

This makes sure all relations are set and the admin displays the translations correctly linked.

Hope this helps!

Kind regards,

1 Like