Re: [swift-users] Swift localisation, percentage sign escaping

2017-05-11 Thread Zhao Xin via swift-users
Forgot to show an example. In Swift, below code won't work, let says = NSLocalizedString("It runs \(count) times", comment: "run times") You should use let says = String.localizedStringWithFormat(NSLocalizedString("It runs %@ times", comment: "run times"), String(count)) Zhaoxin On Fri, May

Re: [swift-users] Swift localisation, percentage sign escaping

2017-05-11 Thread rintaro ishizaki via swift-users
2017-05-11 18:44 GMT+09:00 Adam Sutcliffe via swift-users < swift-users@swift.org>: > Hi, > > I've been having an issue with a localised string,, one of which has a > percentage sign in it: > > "GAMERANK_5_DESC" = "Wow! You're racing ahead. Only 5%% of our users get > here!"; > > the key is built

Re: [swift-users] Swift localisation, percentage sign escaping

2017-05-11 Thread Saagar Jha via swift-users
Interpolation doesn’t need escaping, but String(format:) does. Saagar Jha > On May 11, 2017, at 02:44, Adam Sutcliffe via swift-users > wrote: > > Hi, > > I've been having an issue with a localised string,, one of which has a > percentage sign in it: > >

[swift-users] Swift localisation, percentage sign escaping

2017-05-11 Thread Adam Sutcliffe via swift-users
Hi, I've been having an issue with a localised string,, one of which has a percentage sign in it: "GAMERANK_5_DESC" = "Wow! You're racing ahead. Only 5%% of our users get here!"; the key is built as such: Obj-c : NSString *key = [NSString stringWithFormat:@"GAMERANK_%@_DESC" ,rank]; Swift: