Guest User

Untitled

a guest
Jul 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import Foundation
  2.  
  3. typealias Localized = String
  4.  
  5. extension Localized {
  6.  
  7. func localize() -> String {
  8. return NSLocalizedString(self, comment: "")
  9. }
  10.  
  11. /// Localize plural string key
  12. func localize<T>(_ count: T) -> String {
  13. return String.localizedStringWithFormat(self.localize(), count as! CVarArg)
  14. }
  15. }
Add Comment
Please, Sign In to add comment