[swift-evolution] Localization support for string interpolation

Uli Kusterer kusterer at orangejuiceliberationfront.com
Tue Apr 26 19:59:23 CDT 2016


On 22 Apr 2016, at 09:09, Daniel Höpfl via swift-evolution <swift-evolution at swift.org> wrote:
> On 21.04.16 18:29, Uli Kusterer wrote:
>> Yeah, idea here is principle of least surprise. Most lcoalization
>> tools pre-populate the translations with the keys, so having the
>> positional indices in there would mean nobody forgets it and then
>> gets back a translation with the contents reversed
> 
> If you want to play around with it, I added a branch in the proof of
> concept repo that uses positional arguments in the keys.

 Thanks!

> While it is possible to use different placeholders (%d, %f, ...)
> depending on the type of the interpolation argument, I don't think it is
> worth it.

 Only reason I could see for doing this would be backwards compatibility if you share the same localized strings between ObjC and Swift, I don't think it's worth it just for that.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://orangejuiceliberationfront.com



More information about the swift-evolution mailing list