I am not talking to eliminate "%" style function. I am talking to add more compatibility to `NSLocalizedString` with `\(foo)` style. As there is no rule forbidding that, it should work. If someone doesn't need the flexible parts, why he has to use the complicated way?
Zhaoxin On Wed, Nov 2, 2016 at 1:49 PM, Jens Alfke <j...@mooseyard.com> wrote: > > > On Nov 1, 2016, at 10:40 PM, Zhao Xin <owe...@gmail.com> wrote: > > > > For example, if I want show the user that I have to ask him to give me > permission of a folder, the `url.path` has no need to translate. > > We’re getting off-topic, but paths do need to be translated, at least on > Mac systems. The names of many standard folders like “Applications” and > “Documents” are hardwired to English in the filesystem but are localized in > the UI. Some application names get localized too (there’s a table in the > app’s Info.plist that can substitute localized names.) > > Anyway, string interpolation is convenient, but I wouldn’t say it should > be the only way to format strings in Swift; it’s a lot less flexible than > the C-style “%” substitutions. For comparison, even though C++’s iostreams > use “<<“ to format strings by concatenation, I still end up using “%” based > formatting a lot, depending on the use case. > > —Jens
_______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users