In the previous article, I've explained how to add a Strings Catalog to a Swift package to support localizations. Now, we'll try to translate it into more languages.
The Strings Catalog itself is just JSON internally. You can see it in Xcode by right-clicking on the file and selecting Open As → Source Code.
Now we can easily translate it into more languages with AI help. I played with Copilot and Gemini, and both work great. Here's an example with Copilot. Just paste that JSON and ask to add more languages:
And here we go:
Just paste that JSON into the Strings Catalog source code, and you've got it translated.
The Copilot dialog has some length limitations, so if you have a pretty long JSON, just split it into smaller chunks.