> On Nov 1, 2016, at 10:56 PM, Zhao Xin <owe...@gmail.com> wrote:
> 
> I am not talking to eliminate "%" style function. I am talking to add more 
> compatibility to `NSLocalizedString` with `\(foo)` style.

I don’t think the ExpressibleByStringInterpolation protocol provides enough 
information to make this work. It hands the implementation a list of values to 
concatenate, some of which are strings, but as far as I can tell there’s no way 
to tell which of those strings are the pieces of the string literal and which 
of them are the results of expressions. So NSLocalizedString would not be able 
to reassemble the string template that you gave it, to look up in the 
localization table.

If I’m wrong about this, show me a workable implementation of it. :)

Also, ExpressibleByStringInterpolation is marked as being deprecated and will 
be “replaced or redesigned in Swift 4.0.” Maybe to solve this limitation?

—Jens
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to