Skip to content

Instantly share code, notes, and snippets.

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 vincent-pradeilles/14b6a2b56b8058ba89515664b1e73731 to your computer and use it in GitHub Desktop.
Save vincent-pradeilles/14b6a2b56b8058ba89515664b1e73731 to your computer and use it in GitHub Desktop.
public func OverridableLocalizedString(key: String, value: String = "", comment: String = "") -> String {
return NSLocalizedString(key, tableName: "Override", bundle: Bundle.main, value: FrameworkLocalizedString(key, value: value), comment: comment)
}
private func FrameworkLocalizedString(_ key: String, value: String) -> String {
guard let bundle = Bundle.whiteLabelBundle() else { return "" }
return NSLocalizedString(key, tableName: nil, bundle: bundle, value: value, comment: "")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment