Last active
July 11, 2019 12:00
-
-
Save kocoai/bdb89be96af1fba41448921928aac1ad to your computer and use it in GitHub Desktop.
template NSLocalizedString #swiftgen #swift
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
extension L10n { | |
fileprivate static func tr(_ key: String, _ args: CVarArg...) -> String { | |
// Load from App's Bundle first | |
let format: String = NSLocalizedString( | |
key, | |
bundle: Bundle.main, | |
value: NSLocalizedString(key, bundle: Bundle(for: SportStringsBundleToken.self), value: "", comment: ""), | |
comment: "" | |
) | |
return String(format: format, locale: Locale.current, arguments: args) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment