Xcode 15 beta strings catalog

Hey,

I'm trying the new strings catalog, and I have a script that I would like to run on the xcstrings json.

My question is there some documentation on the json format (what keys can it have, and values)?

Also, I didn't try it yet, but what if I set for example 50 languages and 1000 localization keys, is that json really scalable? It could grow quite large, would xcode still keep it as one big file, or it would somehow split it into chunks?

Would be happy for any info from the dev teams, thanks!

Answered by Developer Tools Engineer in 756602022

String Catalogs store an entire string table in a single JSON file, even if there are a large number of keys and languages. If this ends up presenting a problem (with Xcode's performance, for example), please send some feedback our way.

As for the specifics of the JSON format itself, we have not published documentation because it is primarily intended to be read/written by Xcode. If you do end up writing your own parser for this format, please be aware that Xcode reserves the right to change it.

Accepted Answer

String Catalogs store an entire string table in a single JSON file, even if there are a large number of keys and languages. If this ends up presenting a problem (with Xcode's performance, for example), please send some feedback our way.

As for the specifics of the JSON format itself, we have not published documentation because it is primarily intended to be read/written by Xcode. If you do end up writing your own parser for this format, please be aware that Xcode reserves the right to change it.

@Developer Tools Engineer - Thank you for answering this question. I do understand that string catalog files are designed to be interfaced by XCode.

I would like to also bring your attention that there are other valid and relatively common scenarios where other tools need to read/write to this string catalog file. In an enterprise setting xcstrings file as well as other source code will be tracked in a git repository. This means that there are external localization tools via various integrations that directly read/write to this repository. If an enterprise is using an external tool to manage localizations, that tool can directly commit the changes to that xcstrings file without involving a developer or XCode. In fact this is the very reason enterprises uses external tools because not involving developer in every task increases productivity of the company.

You might say that you can export/import xcstrings file to other formats like xliff. However, that still involves a developer to manually do work and perform ETLs with XCode since xliff is not the format XCode ultimately uses.

Since this situation is actually relatively common, may I ask whether Apple can share the JSON scheme with the public? Apple is welcome to change the scheme at any time. The current scheme already includes the version information in the meta-data. You can simply bump the version to 2.0 and make the changes as necessary. Developer community can adopt subsequently.

Thank you for your consideration.

Xcode 15 beta strings catalog
 
 
Q