-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NSString.localizedStringWithFormat to take stringsdict pluralization into account #91
Comments
Actually according to the documentation, I'm not so sure that |
Cool question... So when you look at the implementation over at https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/String.swift:
whereas localizedStringWithFormat is implemented as:
According to Apple locale=nil is equivalent to locale=NSLocale.systemLocale() and:
|
So localizedStringWithFormat is the correct one. |
Ah! Good thinking looking into the Swift OSS source code! Thanks for digging into it! |
Still feels non-Swifty to me to use a static func when an I think I'll use |
I see your point... there is something quite ObjC-y about it. 😄 Anyway, there's zero difference between the two. Go with what looks nicer. |
Use
NSString.localizedStringWithFormat(format, args)
(instead of justString(format:arguments:)
in the strings templates, to take.stringsdict
pluralization into account.See @marmelroy's talk at dotSwift'16 here.
The text was updated successfully, but these errors were encountered: