Localize-Swift
Localize-Swift copied to clipboard
String with variable
Hi Roy :)
How can I localized this?
let name = NSUserDefaults.standardUserDefaults().valueForKey("name") as! String
searchBar.placeholder = "Hey, \(name) how can we help you?"
the name change depend on which user is currently logged in. Btw thank you very much!
You could do something like this
"nsls_string".localizedFormat(name)
And in localizable.strings: "nsls_string"="Hey, %@ how can we help you?";
plz add to Readme
I just ran into this problem! Thanks @piv199 that worked!