LocalizedString.swift 653 B

12345678910111213141516171819202122
  1. //
  2. // LocalizedString.swift
  3. // LoopUI
  4. //
  5. // Created by Kathryn DiSimone on 8/15/18.
  6. // Copyright © 2018 LoopKit Authors. All rights reserved.
  7. //
  8. import Foundation
  9. internal class FrameworkBundle {
  10. static let main = Bundle(for: FrameworkBundle.self)
  11. }
  12. func LocalizedString(_ key: String, tableName: String? = nil, value: String? = nil, comment: String) -> String {
  13. if let value = value {
  14. return NSLocalizedString(key, tableName: tableName, bundle: FrameworkBundle.main, value: value, comment: comment)
  15. } else {
  16. return NSLocalizedString(key, tableName: tableName, bundle: FrameworkBundle.main, comment: comment)
  17. }
  18. }