I'm trying to use the .stringsdict functionality in iOS programming to display the proper ordinal suffix (st, nd, rd, etc...) for numbers. I've created the .stringsdict file for english, but it's only using the 'one' and 'other' keys. It's ignoring the 'two' and 'few' options. Anybody see what i've done wrong here?
The file looks like this:
<?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>TEAM_RANK_ORDINAL</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@ordinal_string@</string>
<key>ordinal_string</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lu</string>
<key>one</key>
<string>%lust</string>
<key>two</key>
<string>%lund</string>
<key>few</key>
<string>%lurd</string>
<key>other</key>
<string>%luth</string>
</dict>
</dict>
</dict>
</plist>
I then access it like so, from Swift. For the value 1 it appends st, but every other number appends th:
let fmt = NSLocalizedString("TEAM_RANK_ORDINAL", comment: "")
for i in 0...30 {
println(String(format: fmt, i))
}