Change system alert language from within app

Hi everyone! I am working on app, and customers want it to be fully localized. We have several Localizable.strings and InfoPlist.strings files for each supported language.
There is an opportunity in the app to change app's language "on fly".
(This is done by associating another bundle with chosen language)to main bundle. So when app calls [NSBundle.mainBundle localizedStringForKey:value:table:], it actually refer to bundle with language user has selected.)


Here comes bad consequences. System permission alerts (requests for location usage, camera usage, etc.) are not localized with language selected within the app, but localized with preferred language from iOS Settings.

So, for example, if user has English as preferred language in Settings, but in our app he chose French, the whole app will be in French except system alerts, which will be in English.


Is there any way to fix it? I mean, to choose programmaticaly which language system alert must consider as preferred?


P.S. I know, this is not a good practice, but... you know... customer's desires.

Accepted Reply

>> if user has English as preferred language in Settings, but in our app he chose French, the whole app will be in French except system alerts, which will be in English.


The problem is that English is the preferred language in Settings. It's not just your app. Alerts, etc, are in English because that's what the user asked for. It doesn't make much sense for them to be in a different language.


What your … um … customer is asking for is a French language enclave within an English (or whatever) language device, and that's something iOS simply does not support.

Replies

>> if user has English as preferred language in Settings, but in our app he chose French, the whole app will be in French except system alerts, which will be in English.


The problem is that English is the preferred language in Settings. It's not just your app. Alerts, etc, are in English because that's what the user asked for. It doesn't make much sense for them to be in a different language.


What your … um … customer is asking for is a French language enclave within an English (or whatever) language device, and that's something iOS simply does not support.

Your app cannot dictate an override of the user's default locale/language - I'd suggest your job as a dev is to 'educate' your client 😉. Perhaps a guided tour thru the iOS HIGs would help.


Good luck.

There is an opportunity in the app to change app's language "on fly".

This is not a good idea, for exactly the reasons you’ve discovered. I’ve talked about this extensively before (this thread is a good example).

Is there any way to fix it?

No.

P.S. I know, this is not a good practice, but... you know... customer's desires.

Sure. Your customer is going to have to make the choice between:

  • Changing the localisation on the fly

  • Consistent localisation

I recommend the latter but, hey, they’re paying the bills (-;

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"