I has known that, and it is the developer's choice, which means, the developer has already known that. There are many circumstances that there are no needs to translate at all. 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.
And of course, ` String.localizedStringWithFormat(NSLocalizedString("blabla%@blabla", comment: "blabla"), ` has already allows to do that. I just think it should be in a more Swift way by using `\(foo)`. Zhaoxin On Wed, Nov 2, 2016 at 11:45 AM, Jens Alfke <j...@mooseyard.com> wrote: > > On Nov 1, 2016, at 7:52 PM, Zhao Xin <owe...@gmail.com> wrote: > > The second should be > > let says = String.localizedStringWithFormat(NSLocalizedString(" >> blabla >> % >> @ >> blabla >> ", comment: " >> blabla >> "), >> String( >> count >> ) >> ) > > > That’s not quite right, because the conversion of `count` to a string > won’t be localized. Some languages use non-ASCII digits, use characters > other than “.” for decimal points, etc. Depending on the exact type of > `count`, it would need to be something like: > > String.localizedStringWithFormat(NSLocalizedString("blabla%dblabla", > comment: "blabla"), count) > > Hardcoding this specific kind of transformation into the parser seems like > a bad idea, since NSLocalizedString isn’t part of the language. Why don’t > you just use localizedStringWithFormat instead of string interpolation in > your code? > > —Jens >
_______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users