Free tool
Convert .strings to .xcstrings
Xcode 15 replaced Localizable.strings with the String Catalog. This does the migration in the browser. Both directions, comments intact.
Runs in your browser. No account, no upload, nothing leaves your machine.
Runs in your browser. The file is never uploaded.
The migration Xcode does not offer for old files
Xcode migrates a .strings file when you add a String Catalog to a target, but only for files that are already in that target. A .strings that came from an agency, a contractor or an older branch has to be converted by hand. By hand means opening a JSON format with a nested localizations, variations and stringUnit structure that nobody writes from memory. This tool writes it. Keys are sorted alphabetically, the way Xcode sorts them, so committing the result does not produce a diff over the whole file.
What survives
Converting is easy. Not breaking the file is the hard part.
Every converter that treats a language file as plain text will eventually ship you a crash. These are the three places it happens.
- Placeholders stay placeholders
- %@, %lld, %1$s, {name} and {{count}} come out exactly as they went in. A placeholder that got escaped, renumbered or translated is a crash on the device, not a typo.
- Plural forms stay separate
- Xcode variations, the Android plurals element and gettext msgstr[n] all mean the same thing and all spell it differently. They map onto each other here instead of collapsing into one string. Polish has four forms; all four survive.
- Keys keep their shape
- Nesting, dotted paths, arrays and translator comments carry across wherever the target format has somewhere to put them. Where it does not, the section below says so.
What does not come across
Written down here, because the alternative is finding out in a broken build.
Device variations (variations.device, the iPhone-versus-iPad split) and substitutions are not carried across. The intermediate form has no concept of them, and inventing one would put the wrong string on the wrong device. extractionState is set to manual on everything the tool writes, because it cannot know which strings Xcode found by scanning your source. Comments survive in both directions.
How it works
- Step 1
Drop the file in
Drag your .strings onto the left box, pick it with the file button, or paste the text. Nothing is uploaded. The conversion runs in this tab.
- Step 2
Read the result
The .xcstrings appears as you type. The counter under the box says how many keys came through, so a file that lost half its content is visible immediately.
- Step 3
Copy or download
Take the text to the clipboard, or download it with the right extension. Swap the arrow to go the other way.
One language file in. 64 languages out.
Converting a format is the part you can do by hand. Translating 3,627 keys into 64 languages without breaking a single placeholder is the part you cannot. On the next release you only pay for the strings that changed.
€19 per month incl. VAT, cancellable monthly.
Questions
- Does the plural handling survive?
- Yes, in both directions. In a String Catalog plurals live under variations.plural.CATEGORY.stringUnit, one level deeper than an ordinary string. A reader that only looks at stringUnit silently drops every plural in the file. This one reads both.
- Why is my source language missing from the .xcstrings?
- That is normal, and this tool handles it. When the key is the English text, which is Xcode's default, Xcode omits the source localization entirely to save space. A converter that only reads localizations sees an empty file. Here the key is used as the value in that case.
- Can I go from .xcstrings back to .strings?
- Yes. Press the swap arrow. That direction is useful when a tool in your pipeline still only speaks .strings, or when you want to diff a String Catalog in a readable format.
- Is my file uploaded anywhere?
- No. Both codecs run as JavaScript in this tab. You can disconnect from the network and the converter keeps working. Language files carry product names, prices and unreleased feature names. That is not a file to hand to a random web service.