Pattern: Missing bundle
for NSLocalizedString
Issue: -
Calls to NSLocalizedString
should specify the bundle which contains the strings file.
Examples of correct code:
NSLocalizedString("someKey", bundle: .main, comment: "test")
NSLocalizedString("someKey", tableName: "a",
bundle: Bundle(for: A.self),
comment: "test")
NSLocalizedString("someKey", tableName: "xyz",
bundle: someBundle, value: "test"
comment: "test")
arbitraryFunctionCall("something")
Examples of incorrect code:
↓NSLocalizedString("someKey", comment: "test")
↓NSLocalizedString("someKey", tableName: "a", comment: "test")
↓NSLocalizedString("someKey", tableName: "xyz",
value: "test", comment: "test")