1. Help Center
  2. Supported formats

iOS Localizable Stringsdict for pluralized translation keys

What does iOS Localizable Stringsdict file do, and how is it associated with localization?

File Extensions .stringsdict
API Extension stringsdict
Import Yes
Export Yes
Pluralization supported? Yes
Descriptions supported? No
Format Options convert_placeholder


iOS Localizable Stringsdict is an XML-based exchange file format used to define language plural rules. It is used when you need to provide several translations for a string in a language with different plural forms (e.g., Arabic). The root element of a Stringsdict file is <plist> that holds one or more <dict> elements. Each dict element represents a key that will be referenced in the source code.

Note: iOS Stringsdict should only be used to provide alternate translations for languages that have different plural rules. Otherwise, the standard localization file format for iOS and OS X is the iOS Strings Resource file format.

Format Options 

Convert placeholder 

Identifier convert_placeholder  
Type boolean
Upload Yes
Download No          
Default false
Description Placeholder will be converted to match format specific requirements. Example: '$s' => '$@'

Code Sample

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
  <dict>
    <key>pluralized_key</key>
    <dict>
      <key>NSStringLocalizedFormatKey</key>
      <string>%#@localized_format_key@</string>
      <key>localized_format_key</key>
      <dict>
        <key>NSStringFormatSpecTypeKey</key>
        <string>NSStringPluralRuleType</string>
        <key>NSStringFormatValueTypeKey</key>
        <string>d</string>
        <key>one</key>
        <string>Only one pluralization found.</string>
        <key>other</key>
        <string>Wow, you have %s pluralizations!</string>
        <key>zero</key>
        <string>You have no pluralization.</string>
      </dict>
    </dict>
  </dict>
</plist>

This format should only be used to provide alternate strings for languages that have different plural rules. To specify language plural rules that can’t be represented by key-value pairs in the iOS Localizable .strings file, use a .stringsdict file.

Creating complex keys trough the Translation Editor

 

Setting a project’s default file format to iOS Localizable Stringsdict as show below will enable additional functionality in the Add/Edit Key dialog:

stringsdict02

This allows adding/editing the NSStringLocalizedFormatKey. Providing multiple placeholders in this field will create the corresponding amount of keys:

Screenshot 2021-02-16 at 11.29.13

Creating keys as above will result in the following:

Screenshot 2021-02-16 at 11.28.52

Please note that manually refreshing the page might be necessary to see the newly created keys and that this functionality is currently only available through the Translation Editor.

More Information