I successfully implemented plural localization in my app. But if I change the app language, localizedStringWithFormat still returns the plural in previous language.
If I restart the app, the plural will be returned in correct language (the language that I chose).
Is there any possibility to make it clear for localizedStringWithFormat, in which language it should return the plural?
Example code, where the plural is called:
let candiesEaten: Int = 38
let candyCounterString: String = String.localizedStringWithFormat(NSLocalizedString("TEXT_CANDY_COUNTER", comment: ""), arguments: candiesEaten)
The language is changed in the app like this and it works with all other strings as charm:
private static func setLanguageAndSynchronize(_ lang: [String]) {
UserDefaults.standard.set(lang, forKey: Preferences.appleLanguagesKey)
UserDefaults.standard.synchronize()
}