I'm developing app that supports "en" and "ru" languages, users can select language inside app.
If default phone's locale set to "en", but inside app selected "ru" language, then when trying to localize plural sentence ignored 'many'/'few' form. So it's localized by the English plural rules.
Definition:
<key>%d files</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@files@</string>
<key>files</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>one</key>
<string>один файл</string>
<key>many</key>
<string>%d файлов</string>
<key>other</key>
<string>%d файла</string>
</dict>
</dict>
Code to localize (manually create 'ru' locale):
let locale = NSLocale(localeIdentifier: "ru_RU")
String(format: NSLocalizedString("%d files", comment: ""),
locale: locale,
count)
As output i got:
for count = 1: "один файл" - and it's right
for count = 2: "2 файла" - it's also right (from category 'other')
for count = 6: "6 файла" - wrong, also from category 'other', but should be taken from 'many'
If i switch phone's language to Russian, then all being localized correctly.