Skip to content

Instantly share code, notes, and snippets.

@vprtwn
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vprtwn/6b52315758e8631f9f9e to your computer and use it in GitHub Desktop.
Save vprtwn/6b52315758e8631f9f9e to your computer and use it in GitHub Desktop.
Localize all the strings!
import Foundation
infix operator | {}
func | (lhs: String, rhs: String) -> String {
return NSLocalizedString(lhs, comment: rhs)
}
postfix operator | {}
postfix func | (s: String) -> String {
return NSLocalizedString(s, comment: "")
}
let name = "Ben"
let title = "\(name)'s Profile"|"{User First Name}'s Profile"
let labelText = "Username"|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment