Limit available app languages

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.

Replies

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.

So in fact the app is not yet localised in those languages. A better practice would be to only add a language when it is readily available. And release a new version.

Did I miss something ?

I don't want to delete localization files, because they contain some useful translations that I will use in the future.

You may need to move unready localized resources when archiving, and then move them back when you want to test them.

Not sure there may be some better ways for you.

Thanks for you answers.

I had to delete the localization resources for the languages that weren't ready yet and now it works as expected.