JSON to iOS Stringsdict Converter
Convert JSON pluralization files to Apple .stringsdict XML plist format for Xcode iOS/macOS localization. Free online tool.
About
Apple's NSStringPluralRuleType system requires .stringsdict files - verbose XML plists that encode pluralization rules per the Unicode CLDR specification. A single key with six plural categories (zero, one, two, few, many, other) expands to roughly 25 lines of XML. Hand-editing these files invites malformed plist errors that Xcode reports cryptically at runtime, not compile time. Handing raw XML to translators increases the risk of accidentally broken tags and lost work.
This tool accepts a structured JSON input and produces a valid Localizable.stringsdict plist. The JSON format is compact enough for translators to work with directly. The converter validates every key, enforces required other categories, and generates the DTD-compliant XML that Xcode expects. It approximates the output of the jts CLI tool but runs entirely in the browser with no install. Limitation: this tool does not validate that your plural categories match the target locale's CLDR rules - you must verify that independently.
Formulas
The converter maps a flat JSON object into Apple's nested plist XML. Each top-level JSON key becomes a <dict> entry in the plist. For each key, the tool generates:
The format key pattern uses Apple's variable substitution syntax:
Each variable dictionary follows this structure:
Where specifier is a C printf format code (default d for integers). The other category is mandatory per Apple documentation. All other categories are optional and language-dependent per Unicode CLDR plural rules.
JSON input schema expected:
Reference Data
| CLDR Plural Category | NSStringFormatSpecTypeKey Value | Example Languages | Typical Numeric Range | Required |
|---|---|---|---|---|
| zero | NSStringPluralRuleType | Arabic, Latvian, Welsh | 0 | No |
| one | NSStringPluralRuleType | English, German, Spanish, French | 1 | No |
| two | NSStringPluralRuleType | Arabic, Hebrew, Slovenian | 2 | No |
| few | NSStringPluralRuleType | Polish, Czech, Russian, Arabic | 2 - 4 (varies) | No |
| many | NSStringPluralRuleType | Polish, Russian, Arabic, Welsh | 5 - 20 (varies) | No |
| other | NSStringPluralRuleType | All languages (fallback) | Everything else | Yes |
| Plist Structure Elements | ||||
| NSStringLocalizedFormatKey | Format string referencing variables, e.g. %#@count@ | |||
| NSStringFormatSpecTypeKey | Always NSStringPluralRuleType for plural entries | |||
| NSStringFormatValueTypeKey | Printf format specifier: d (integer), f (float), lu (unsigned long) | |||
| Common Format Specifiers | ||||
| d | Signed integer (Int / NSInteger) | |||
| u | Unsigned integer (UInt) | |||
| f | Floating point (Double / Float) | |||
| lu | Unsigned long (UInt on 64-bit) | |||
| ld | Signed long (Int on 64-bit) | |||
| .2f | Float with 2 decimal places | |||