The grouplang ID is a common identifier for a document and its translations. A document in the master language and all its translations are sharing the same grouplang ID. You can find the grouplang ID at the end of the JSON files you get when exporting documents. It looks like this:
Import a new translation for an existing document
You can import translated content for an existing document. To do this, you need to import files with this naming convention
Example: if you'd like to import a "fr-fr" French translation of an existing "en-us" document (for which the grouplang ID is
WKq0ph4AACEA4M9B), the JSON file you'll import for the French content needs to be named like this:
The filename has to contain the grouplang ID that you can find in the master language document when exporting it.
Bulk duplicating documents from a language to another
In some cases, users are willing to bulk duplicate documents from a language to another, and then have translators work directly on the copies in the Prismic UI. In that case, you can use this script to automatically prepare many Import files with the right file naming convention.
You might see an error when trying to import a translation for a document that is of a Singleton type. In that case, just need switch the type from Singleton to Repeatable. Once you're done with the import, you can change it back to Singleton.