0

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:

  1. I have created a custom Strings file (not Localizable.strings, but with a specific name: Test.strings). Those strings are translated into 4 languages.
  2. I add those Test.strings to our framework target.
  3. 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.strings for that language?

Bonifacio2
  • 3,405
  • 6
  • 34
  • 54
Viktor Vostrikov
  • 1,322
  • 3
  • 19
  • 36

0 Answers0