[swift-users] Localization in Swift.

Zhao Xin owenzx at gmail.com
Wed Nov 2 00:56:30 CDT 2016


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 <jens at mooseyard.com> wrote:

>
> > On Nov 1, 2016, at 10:40 PM, Zhao Xin <owenzx at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20161102/d5dea0d2/attachment.html>


More information about the swift-users mailing list