I have my app localized for many languages, but I'd like to limit the available app languages to only a subset of those, because the content is not ready for all of them.
I don't want to delete localization files, because they contain some useful translations that I will use in the future.
The only thing I was able to find and try out is this piece of code:
class AppDelegate: NSObject, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
UserDefaults.standard.set(["Base", "pl", "de", "ru"], forKey: "AppleLanguages")
UserDefaults.standard.synchronize()
ApplicationDelegate.shared.application(
application,
didFinishLaunchingWithOptions: launchOptions
)
return true
}
}
but unfortunately it does not work. When I launch Settings
of my app, I can still choose from about 20-30 languages that I have already some translations for.