Is there a way to duplicate a document in all locales? Not just the currently selected language

If I hit duplicate on a document it only duplicates the currently selected language.

I have each document translated in many different languages and this is therefor not really saving me any time since the duplicated document is empty in all languages except the currently selected one. The rest of the duplication has to be done manually.

Can anyone confirm if this simply is the case? Or if I am missing something (which I hope!).

2 Likes

Hey Leopold, thanks for reaching out.

You are correct, right now copying a document (with all its content or just with the slice structure and assets) to another locale needs to be one document at a time.

We are working on introducing bulk actions this will allow you to bulk copy documents to another locale. I’m not sure that this will cover your use case entirely but what we can do is mark this as a feature request.

For the moment, and until the Bilk actions feature is released (You can follow the status of new features in our progress page!) you can still bulk duplicate docs, but you'll need to use the Import export feature:

Thanks very much for the reply. Just to make sure we are talking about exactly the same thing.

Example:

  • I have a single document already translated to multiple languages (English, Spanish, German).
  • I am viewing the document in English.
  • I press "Duplicate" (not Copy to another locale).
  • I get a duplicate/copy of the English document, but when I switch to Spanish or German those languages are empty in my newly created copy.

I could imagine the following change:

Either, the default duplicate behavior would be to include all locales - or it would be optional:

Currently it is like this:

Screen Shot 2020-12-17 at 12.41.50

It could be like this:

Screen Shot 2020-12-17 at 12.40.38

Oh ok I understand, so it was 'duplicating' rather than copying. It is still a similar process, for the moment you would still need to go one by one because this newly created copies are considered independent documents.

The example that you gave is a very good one, thanks a lot for putting this up, this kind of examples are great for sharing with the product team. I'll be sure to share this with them

1 Like

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the :heart: button to show your support for the feature and check out our Feature Request Guidelines.

You can use the Import/Export module and some scripting to bulk duplicate documents to many locales at once.

  • Publish the original document from the Prismic UI
  • Export your documents using the Export module

Play this script on the list of documents you want to duplicate to all locales at once:

  • Get the “grouplang ID” value from the original
  • generate one JSON file for each of the language you want to duplicate the document to
  • in each JSON file you generate, replace the lang value with the target locale code (i.e., “lang”: “es-es”)
  • In each JSON file you generate, insert the grouplang value (the one you grabbed from the original file, i.e., “grouplang”: “X3dY8hAAACQASEKF”)
  • Name each generated files following this convention translate_{grouplang}_{lang}.json

So for example, if you need to generate duplicate JSON files for 3 locales, you’ll end up with these files (assuming the group land ID of the original is X3dY8hAAACQASEKF)translate_X3dY8hAAACQASEKF_fr-fr.json
translate_X3dY8hAAACQASEKF_es-es.json
translate_X3dY8hAAACQASEKF_it-it.json

  • ZIP the generated files
  • Import them using the Import module

We decided to use Prismic to simplify the authoring process for non technical people. But it appears that some simple actions like this one, it requires running a script and the marketing or legal teams are definitely not going to do that.

Do you plan to release a Duplicate in all locales button at some point, as proposed in the screenshot above?

1 Like

This feature already exists but in a slightly different way. You can manually select each language that you wanna copy the content to @prismic24. For the Duplicate in all locales button, I'll add it to our product board. Maybe we can consider it for future updates.

Please keep in mind that if you use Content Relationship fields you need to copy all documents to the same release, otherwise this will resolve in broken links.

Hi Pau,

Is there any workaround?
For now, my Prismic users duplicate a document per locale, but the documents are not linked to each other, meaning that when you open a document and switch the locale, there is no content…

There's no workaround for the moment. This is something that needs to be modified manually. The links in the translations need to be readded after they're copied.

Can you tell me how to re-add the links between translations linked to the same document afterwards?

You can keep the links by copying all the documents to another locale at the same time. The docs will be added to a release, and the links will be saved correctly. The only disadvantage is that the links must already exist in the documents of the master locale, and that you have to select many documents simultaneously.

Any updates about this feature?

Hi @r.skrypnik,

Yes, this is something we now support :slight_smile: You can do this from any space where your pages are. Select them, click on the globe icon on the top right of my screenshot below, and you can then select all the locales you need those documents translated to.

Let me know if you need any help with that!

I tried to use it but it doesn't work way I expected
I don't get the idea of using releases instead of simply duplicating the existing document

It's just a way to bundle the documents and put them in one place while you're doing that, so you know where they are and what you have and it allows you to double check before you publish anything. At this time we don't intend to change this behavior, you just have to go in your Planned tab and click "publish now" on the copied documents and you will achieve the same result :slight_smile:

Thank you for the answer!
Unfortunately, there are some problem with it as well:

  1. Selecting all the locales at once doesn't apply content translation which was in original documents; instead of it, it just sets english lang to all of translations


  2. There are only two options of copy modes available; in my case, I need to copy all the content including assets; I will have to copy-paste the content again:
  3. After publishing copied article - it simply replaces the original one

H @r.skrypnik,

  1. I'm struggling to understand what you mean. The feature to duplicate in multiple languages will not translate to other languages, it will simply create the page in the locale that you want. You still have to translate after. The translation with AI feature is separate. If you already have a version of a page in a certain language, is there a reason why you are copying it again that way in bulk? Unless I'm misunderstanding what's happening here. If so feel free to correct me :slight_smile:
  2. Copy all content also copies the images in the page when I've tried, what assets are you seeing not being transferred over?
  3. If you published the copied article, the newer version will replace the older version. Is that not the behavior you're expecting?

Hello @Ezekiel,

  1. The original article already has all translations. Here’s the problem: those translations are not applied when I duplicate the document — for the French article I’m getting English content, which is strange (that’s why I sent those three screenshots).
  2. If I choose “Copy all content,” it transfers only the text (no assets). “Copy slice structure and assets” transfers only assets and structure, which matches the name. The issue is with the first option.
  3. This topic is about duplicating a document, not just updating existing content. A release is a good idea, but it has nothing to do with duplication.