Skip to content

← All tools

Free tool for iOS and Mac developers

Convert .strings and .stringsdict to a String Catalog

Drop your Localizable.strings files (one per language, from the xx.lproj folders) and any .stringsdict, and download a single Localizable.xcstrings. Comments become each key's comment, .stringsdict plural rules become plural variations, format specifiers such as %@ and %lld are kept exactly, and every translation is marked translated. It also goes the other way: open a String Catalog and get a .strings and, for plurals, a .stringsdict per language. Everything runs in this page; nothing is uploaded.

Direction

Drop your .strings and .stringsdict files or the folder that holds the .lproj folders

One Localizable.strings per language, plus any .stringsdict. The language is read from the xx.lproj folder name; set it by hand if it is missing. Files are read in this page and never uploaded.

Your String Catalog

Add at least one .strings or .stringsdict file with a language to see the catalog.

How it works

  • •Each .strings file is read as Apple's strings-file format: UTF-8 or UTF-16 (the byte order mark decides), /* */ and // comments, escaped quotes, \n, \t and \U escapes, and unquoted keys where Apple allows them. A .strings that is an XML or binary plist is read too.
  • •The comment right above an entry becomes the key's comment in the catalog. The placeholder comment "No comment provided by engineer." is dropped. When languages disagree, the source language's comment wins.
  • •A .stringsdict entry whose format is just one plural variable becomes a plural variation with the same cases (zero, one, two, few, many, other). A format with text around the variable, or several variables, becomes substitutions, with the number's specifier written as %arg, the way Xcode stores it. Device rules become device variations.
  • •We checked the result with Xcode's own command-line tool: the catalogs this page makes compile back (xcstringstool compile) to the same .strings values and plural rules as the files they came from, and the JSON is written exactly as Xcode writes it.
  • •The reverse direction splits a catalog the way Xcode's build does: plain strings to .strings, plurals, substitutions and device variations to .stringsdict. We compared the output with xcstringstool compile, and plutil reads every .strings file it writes.

What it does not do

  • •Width variations (NSStringVariableWidthRuleType), plural cases that refer to another variable, and variations inside variations are not converted. The page lists each one it leaves out.
  • •Every converted translation is marked "translated". The page cannot know which ones still need review.
  • •It does not scan your code, so it cannot know which keys are still used. Xcode does that on the next build and marks unused keys stale.
  • •It does not convert .xliff or .xcloc exports. Use Xcode's Import Localizations for those.
  • •In the reverse direction, catalog states (new, needs review) are not kept: .strings files have no place for them.

Questions

Can't Xcode convert .strings to a String Catalog itself?
Yes: Xcode 15 and later can migrate a project's .strings and .stringsdict files to a String Catalog. This page is for the times that is not handy: files from another project or a translator, a project you do not want to open, a quick look at what the catalog will contain, or going back to .strings for an older tool or a deployment target that needs them.
How do .stringsdict plurals map to a String Catalog?
A rule whose format is only the plural variable, such as %#@photos@, becomes a plural variation: each case (one, other and so on) keeps its text, for example "%d photo". A format with more around it, such as "%#@files@ in %@", becomes a string with a substitution named files, and inside it the number is written as %arg. That is the form Xcode itself uses.
Which language is each file?
The page reads it from the folder name: de.lproj means German, zh-Hans.lproj Simplified Chinese. If you choose a folder or drop one, the names come through. If you pick single files, the browser does not pass the folder name, so set the language for each file in the list.
Are UTF-16 .strings files supported?
Yes. Older projects and genstrings often wrote UTF-16 with a byte order mark; the page reads UTF-16 in either byte order and UTF-8, with or without a byte order mark. The catalog is always written as UTF-8 JSON, as Xcode writes it.
Why does my source language have fewer entries than the other languages?
In a String Catalog the key is the source text. When a source-language entry says exactly the same as its key ("Cancel" = "Cancel"), Xcode stores nothing for it, and so does this page. When the source text differs from the key (a key like "delete_album"), it is stored.
Is anything uploaded?
No. Files are read by JavaScript in this page and the results are made in your browser. You can go offline after the page has loaded and it still works.

Related