We have a select set of master French documents in Prismic which we want to translate into a new language (we're not going to translate all documents). There appears to be a process where we can import a new translation for an existing document which is outlined in Prismic's own documentation here:
Can you please confirm if the following process will work:
Create new target locale in Prismic
Export ALL JSON files from Prismic (including the source master language JSON)
Copy the relevant source master JSON files which we need to translate and rename those as follows:
translate_{grouplang}_{lang}.json
Change the target language ID in each translated JSON, e.g.
"lang": "pt-pt",
Import the specific translated JSON files (not all the exported JSONs) by going to Settings->Import/Export->Import your documents
Will the above process work? If so, do we have the option to set each translated document as "draft"?
Welcome to the Prismic community, and thanks for reaching out to us.
The process you are explaining and mentioned in the documentation will surely work. Each translated document after import will come in a release/planned tab. You can not set it as a draft.
Thanks for confirming that process will work. In terms of what happens after we import the relevant translated JSON files - we need to QA/test the translated web pages before they are published. Can you please advise what the process would be for us to enable a translated web page to be tested by one of our external linguists before the web page is published to live?
If Prismic previews are configured, you can preview Release documents live on your website before publishing them.
Learn more about Previews here: https://prismic.io/docs/guides/previews#preview-a-release
What framework are you using? We have different documents for using Previes according to the framework.
Can you please let me know how to fix? I can get to the image urls via a browser so I'm not sure why Prismic is giving me those errors.
Also - we have existing PT-PT pages setup in Prismic which the exported JSON files are based on. When I tried importing another PT-PT JSON file it gave me an error saying A document already exists for this lang (pt-pt) within the group YmK4sRIAAC8AJwBk:
For the error saying: A document already exists for this lang (pt-pt) within the group YmK4sRIAAC8AJwBk: Does the same document already available in your Archive or Release tab? If it is available, you need to delete the documents and try importing them again?
Unable to locate or analyze imageerror: This is a known issue with SVG file format. You can do the following things:
There are some workarounds that might work for you until a fix a produced. I have no ETA for the fix.
a. Changing the meta of SVG manually and retrying the import
b. First import from the media library and then reference it in the imported JSON files.
c. Or change the format of SVG.
Invalid url: ‘mailto: help@zenchef.com’: This doesn't work with Import. You have to do it manually after importing.
For the error saying: A document already exists for this lang (pt-pt) within the group YmK4sRIAAC8AJwBk: Does the same document already available in your Archive or Release tab? If it is available, you need to delete the documents and try importing them again?
Yes, the document does exist in the Archive. If the same document document doesn't exist in "release" or "archived" but is a LIVE document and I still see the error - should I delete the LIVE document first and then import?
Unable to locate or analyze image error:
I tried uploading the SVG to the Media library and copying the link of those 2 SVGs into my JSON file. When I import my updated JSON I still get an error:
Yes, You need to delete the document. What is the type of document? It's Single type or repeatable. Try to change it to repeatable if it works. If it doesn't work, you need to delete the document.
Can you try to change the format of the file. It's uncertain that SVG works with Import. Or you can send me the JSON file and the repo name in a private message, I can try on my end.
I sent you a private message letting you know that I deleted the live document before I imported my JSON and saw the import error warning "minor error" to do with the SVG. I then went ahead and imported the JSON by clicking "import now" and it imported successfully. When I previewed the page the 2 SVGs appeared but can you please double check it all worked? The details of the page are in the email message I sent you.