LocalizedString.swift 596 B

123456789101112131415161718192021
  1. //
  2. // LocalizedString.swift
  3. // G7SensorKitUI
  4. //
  5. // Created by Pete Schwamb on 3/20/23.
  6. //
  7. import Foundation
  8. internal class FrameworkBundle {
  9. static let main = Bundle(for: FrameworkBundle.self)
  10. }
  11. func LocalizedString(_ key: String, tableName: String? = nil, value: String? = nil, comment: String) -> String {
  12. if let value = value {
  13. return NSLocalizedString(key, tableName: tableName, bundle: FrameworkBundle.main, value: value, comment: comment)
  14. } else {
  15. return NSLocalizedString(key, tableName: tableName, bundle: FrameworkBundle.main, comment: comment)
  16. }
  17. }