Last active
June 28, 2016 09:01
-
-
Save asalom/cfade69708bf300c479bea614f39bc41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension String { | |
public func localize(tableName tableName: String? = nil, bundle: NSBundle = NSBundle.mainBundle(), comment: String = "") -> String { | |
return NSLocalizedString( | |
self, | |
tableName: tableName, | |
bundle: bundle, | |
value: "", | |
comment: comment) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
String extension to allow for a cleaner use of localized strings.
Usage:
Or if you have other
Localizable.strings
files:Or if you are in a different target: