lib/xcmultilingual/templates/swift.erb in xcmultilingual-0.2.1 vs lib/xcmultilingual/templates/swift.erb in xcmultilingual-0.2.2

- old
+ new

@@ -18,18 +18,18 @@ <% table.keys.each do |key| -%> case <%= key.safe %> = "<%= key %>" <% end # keys -%> func string() -> String { - return NSLocalizedString(rawValue, tableName: "<%= table.name %>", bundle: <%= nsbundle %>, value: "\(rawValue)", comment: "") + return NSLocalizedString(rawValue, tableName: <%= class_name %>.name, bundle: <%= nsbundle %>, value: rawValue, comment: "") } static let name = "<%= table.name %>" static var keys: [String] { return ["<%= table.keys.join("\", \"") %>"] } - + static var localizations: [String] { return <%= class_name %>.keys.map { <%= class_name %>(rawValue: $0)!.string() } } }