Apple Strings format (.strings, .stringsdict)
The Apple Strings format reads both legacy Apple localization file
types in one format: the line-based .strings key/value tables and the
.stringsdict plist-XML plural dictionaries (locale by .lproj directory).
In .strings, a comment preceding an entry becomes a translator note and
printf specifiers (%@, %lld, %1$@) are protected as inline codes. In
.stringsdict, each NSStringLocalizedFormatKey and every CLDR plural
category (zero/one/two/few/many/other) is modeled as a block,
with %#@var@ tokens protected. Writes are byte-faithful — only changed
values are spliced back — and UTF-8 and UTF-16 (LE/BE) encodings are
preserved. The modern .xcstrings String Catalog is handled by the
separate xcstrings format.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
extractComments | boolean | true | Surface a /* ... */ or // ... comment preceding a .strings entry as a translator note on the emitted block. |
protectPlaceholders | boolean | true | Lift printf-style specifiers (%@, %lld, %1$@) and .stringsdict %#@var@ tokens into inline codes so they are never translated. |
Configure these parameters interactively and copy the YAML on the Format Reference.
Examples
Leave placeholders inline
Do not protect printf/%#@var@ tokens as codes.
protectPlaceholders: false
Processing notes
.stringsand.stringsdictare detected by their extensions; a stream without one is classified by content..stringsdictplural categories are modeled as separate blocks, like the String Catalog.Binary-plist
.stringsis out of scope; UTF-8 and UTF-16 text encodings are preserved on round-trip.
← Back to the Format Reference