How to create localized entries from code?

What did worked for me for strapi 4 :

    // Create the content in strapi 4
    const deItem = await strapi.entityService.create(`api::${k}.${k}`, {
      data: toAdd["de"],
    });

    const enItem = await strapi.entityService.create(`api::${k}.${k}`, {
      data: { ...toAdd["en"], localizations: [deItem.id] },
      populate: ['localizations'],
    });