Our application had a serious issue in production. The problem was that, for some languages, users did not see the localized strings, but actual keys! I did not think that this was possible, because it should have selected the English language as default if a person had applied some localization settings. Please, let me know what I am doing wrong:
- I have created a custom Strings file (not Localizable.strings, but with a specific name:
Test.strings
). Those strings are translated into 4 languages. - I add those
Test.strings
to our framework target. - Our framework has extension localized, which looks like this:
func localized() ->String {
let frameworkBundle = Bundle(identifier: "com.framework")!
var localizedString = NSLocalizedString(self, tableName: "Test", bundle: frameworkBundle, value: "", comment: "")
return localizedString
}
It should work perfectly. Why it is not a case? Perhaps I should do something in the application target? Maybe the issue comes from the fact, that application target does not has any Localizable.string
s for that language?