0

I'm wondering how I can get and change the current app language manually on the fly using the new String Catalogs system.

Tried checking the docs for information at https://developer.apple.com/documentation/xcode/localization

I expect there to be a way to get the current locale and a function to change it...

Yali Hart
  • 3
  • 1
  • Localization is automatic and built into the system, as long as you implement it properly. What, other than displaying info according to the user's settings are you looking to do? – Yrb Jul 20 '23 at 14:24
  • @Yrb I want to be able to give the user the ability to change the language through the app itself... – Yali Hart Jul 20 '23 at 14:30

1 Answers1

1

If you support iOS 13 or macOS Catalina or later, you no longer need to provide a way to select languages within your app. Apple supports per-app localization:

How to support per-app language settings in your app

When you localize your app, people all over the world can view your content in the language they feel most comfortable reading. And with the latest versions of iOS and macOS, people can have even more control by choosing languages on a per-app basis. For example, someone may set their iPhone’s language to English, but want to use a social media app in Arabic.

Apple is clearly advising against doing language switching manually:

If you currently offer such a UI, you should remove it to avoid customer confusion and potential conflict with the system. If you’d like to guide people to the system settings for language selection, you can replace your app’s custom UI with a flow that launches directly into the Settings app on iOS. On iOS, add the following:

UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!)

On macOS, direct people to System Preferences > Language & Region to add a per-language setting for your app.

soundflix
  • 928
  • 9
  • 22