Created
February 2, 2014 12:49
-
-
Save floriankugler/8767926 to your computer and use it in GitHub Desktop.
NSStringGenderRuleType example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>congratulate %@ to %d(his/her) birthday</key> | |
<dict> | |
<key>NSStringLocalizedFormatKey</key> | |
<string>Congratulate %@ to %#@pronoun@ birthday</string> | |
<key>pronoun</key> | |
<dict> | |
<key>NSStringFormatSpecTypeKey</key> | |
<string>NSStringGenderRuleType</string> | |
<key>NSStringFormatValueTypeKey</key> | |
<string>d</string> | |
<key>0</key> | |
<string>his</string> | |
<key>1</key> | |
<string>her</string> | |
</dict> | |
</dict> | |
</dict> | |
</plist> |
@floriankugler just wanted to share my findings: NSStringGenderRuleType
finally works starting from iOS 9.0. Better late than never!
This is pretty much the only thing on all of the internet that provides an example for NSStringGenderRuleType
...I have filed feedback to Apple to hopefully get their documentation for localization/stringsdict updated. I suggest everyone else does the same! 😄
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't work yet. The output is always something like "Congratulate Paul to (null) birthday".