5 // Created by Hori,Masaki on 2017/10/01.
6 // Copyright © 2017年 Hori,Masaki. All rights reserved.
11 protocol Localizable {
13 var key: String { get }
14 var table: String? { get }
15 var comment: String { get }
17 var string: String { get }
20 extension Localizable {
24 return NSLocalizedString(key, tableName: table, bundle: .main, comment: comment)
28 struct LocalizedString: Localizable {
31 let table: String? = nil
35 init(_ string: String, comment: String) {
37 self.comment = comment
41 struct LocalizedStringFromTable: Localizable {
48 init(_ string: String, tableName: String, comment: String) {
50 self.table = tableName
51 self.comment = comment