Last active
October 27, 2020 13:51
-
-
Save moveitonover/0841b4ae116aab39ddde92a1c4892ea8 to your computer and use it in GitHub Desktop.
Localized strings accessible from com.apple.UIKit bundle
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
// | |
// UIKitLocalizedString.swift | |
// | |
// Helper class for accessing the localized strings shipped with Apple UIKit | |
// | |
class UIKitLocalizedString { | |
static let bundle = Bundle(identifier: "com.apple.UIKit") | |
class var ok: String { | |
return localizedStringForKey("Ok") | |
} | |
class var search: String { | |
return localizedStringForKey("Search") | |
} | |
class var cancel: String { | |
return localizedStringForKey("Cancel") | |
} | |
class var done: String { | |
return localizedStringForKey("Done") | |
} | |
static func localizedStringForKey(_ key: String) -> String { | |
return bundle?.localizedString(forKey: key, value: key, table: nil) ?? key | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment