Created
March 28, 2023 07:34
-
-
Save josippetric/ff3584e0049920f1abed2257b8173ca6 to your computer and use it in GitHub Desktop.
String Localization Helper
This file contains hidden or 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 String { | |
| var localized: String { | |
| return NSLocalizedString(self, comment: "") | |
| } | |
| func localized(comment: String) -> String { | |
| return NSLocalizedString(self, comment: comment) | |
| } | |
| func localized(with arguments: CVarArg...) -> String { | |
| return String(format: self.localized, locale: nil, arguments: arguments) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment