What is a stringsdict file in Xcode

Reading time: 2 min

Updated: September 28, 2025

Navigation

Quick Summary

  • Pluralization format: .stringsdict files handle complex string formatting and plural rules in iOS apps
  • XML based structure: Property list format that defines rules for different quantity variations
  • Language specific rules: Each language has unique pluralization rules (some have 6+ variations)
  • Companion to .strings: Works alongside .strings files for advanced localization needs
  • Automatic selection: iOS automatically chooses the correct plural form based on count and language
  • Legacy format: Still functional but replaced by String Catalogs in modern development

 

What is a .stringsdict File?

A .stringsdict file is Xcode’s traditional solution for handling pluralization and complex string formatting in iOS apps. While .strings files handle simple key value translations, .stringsdict files manage the complex rules needed when text changes based on quantity.

For example, “1 item” vs “5 items” requires different text, but some languages have even more complex rules with separate forms for zero, one, two, few, many, and other quantities.

 

File Structure

A .stringsdict file uses XML property list format. Here’s a typical example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>items_count</key>
  <dict>
    <key>NSStringLocalizedFormatKey</key>
    <string>%#@items@</string>
    <key>items</key>
    <dict>
      <key>NSStringFormatSpecTypeKey</key>
      <string>NSStringPluralRuleType</string>
      <key>NSStringFormatValueTypeKey</key>
      <string>d</string>
      <key>zero</key>
      <string>No items</string>
      <key>one</key>
      <string>%d item</string>
      <key>other</key>
      <string>%d items</string>
    </dict>
  </dict>
</dict>
</plist>

 

How Pluralization Works

Plural Categories

Different languages use different plural categories:

  • English: one, other (2 forms)
  • French: one, other (2 forms)
  • Russian: one, few, many, other (4 forms)
  • Arabic: zero, one, two, few, many, other (6 forms)
  • Chinese: other (1 form – no pluralization)

Usage in Code

Reference pluralized strings in Swift using:

let itemCount = 5
let message = String.localizedStringWithFormat(
    NSLocalizedString("items_count", comment: "Item count"),
    itemCount
)
// Result: "5 items"

 

File Organization

Like .strings files, each language needs its own .stringsdict file:

MyApp/
├── en.lproj/
│   ├── Localizable.strings
│   └── Localizable.stringsdict
├── fr.lproj/
│   ├── Localizable.strings
│   └── Localizable.stringsdict
└── ru.lproj/
    ├── Localizable.strings
    └── Localizable.stringsdict

 

Common Use Cases

Item Counts

  • “1 photo” vs “5 photos”
  • “No messages” vs “1 message” vs “12 messages”
  • “1 minute ago” vs “30 minutes ago”

Time and Measurements

  • Duration: “1 hour” vs “2 hours”
  • Distance: “1 mile” vs “5 miles”
  • File sizes: “1 byte” vs “1024 bytes”

Complex Formatting

  • Mixed variables: “%d files in %d folders”
  • Conditional text: Different messages based on user type
  • Gender-specific translations (in some languages)

 

Limitations and Challenges

  • Complex syntax: XML format is verbose and error-prone
  • Manual management: No automatic synchronization with code changes
  • File duplication: Separate .stringsdict file needed for each language
  • Version control: XML diffs can be difficult to review
  • Learning curve: Requires understanding of Unicode plural rules

 

Modern Alternative: String Catalogs

.stringsdict (Legacy) String Catalogs (.xcstrings)
Complex XML syntax Visual interface for plurals
Separate file per language Single file, all languages
Manual rule creation Right-click → “Vary by Plural”
Error-prone editing Built-in validation
No automatic detection Automatic string discovery

.stringsdict files solved the critical problem of pluralization in iOS apps before String Catalogs existed. While they’re still functional and necessary for certain workflows, their complex XML syntax and manual management make them complicated.

For new projects, String Catalogs provide the same pluralization capabilities with a much more user friendly interface. However, understanding .stringsdict files remains important for maintaining legacy projects and working with established localization pipelines.

Use Transolve to translate your app
in a snap of a finger

Cookie settings
We value your privacy
We use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking "Accept All", you consent to our use of cookies. Cookie Policy