Skip to content

Commit 0060fe0

Browse files
authored
Merge pull request #238 from mac-cain13/string-bundle
Add hosting bundle to string resource, and NSLocalizedString
2 parents 18a19f1 + 5c7aa43 commit 0060fe0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R.swift.Library

R.swift/Generators/StringsGenerator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ struct StringsGenerator: Generator {
188188
isStatic: true,
189189
name: values.key,
190190
typeDefinition: .Inferred(Type.StringResource),
191-
value: "StringResource(key: \"\(escapedKey)\", tableName: \"\(values.tableName)\", locales: [\(locales)])"
191+
value: "StringResource(key: \"\(escapedKey)\", tableName: \"\(values.tableName)\", bundle: _R.hostingBundle, locales: [\(locales)])"
192192
)
193193
}
194194

@@ -274,10 +274,10 @@ private struct StringValues {
274274
let escapedKey = key.escapedStringLiteral
275275

276276
if tableName == "Localizable" {
277-
return "NSLocalizedString(\"\(escapedKey)\", comment: \"\")"
277+
return "NSLocalizedString(\"\(escapedKey)\", bundle: _R.hostingBundle, comment: \"\")"
278278
}
279279
else {
280-
return "NSLocalizedString(\"\(escapedKey)\", tableName: \"\(tableName)\", comment: \"\")"
280+
return "NSLocalizedString(\"\(escapedKey)\", bundle: _R.hostingBundle, tableName: \"\(tableName)\", comment: \"\")"
281281
}
282282
}
283283

0 commit comments

Comments
 (0)