How to change application language when running

Hi All,


I want to change application language when running without using device's setting.

Could you tell me a method or any source code using Objective C or Swift to do it ?


Thank a lot

Replies

Your app can't change the system language from what the user has chosen.


You can only change/re-localize the parts of your app that are under your control. See: Localizing Your App


How to change on-the-fly involves a button/control to make the selection, code to reload the page, and the new UI elements as required. There is no simple lever to pull, code wise.


I'd advise against de-coupling your UI from the user's chosen device language as there is risk of confusing the user and creating an app that needs constant maintenance to keep up with various language-specific OS changes in the future.

I posted a request for improvement on this. Nearly one year ago, only reply was Dupe status..


Bug report :

Here is the use case : Working with a foreign friend, it may be needed to change the language on the fly, each time one or the other has to do something with the app.

There is no easy or safe way to do this directly from the app without being forced to go through the phone setting, which forces to interrupt use of app and takes a long time (up to 15s).

I have found ways on how to do it, by changing the mainBundle class.

h ttp://blog.xebia.fr/2016/08/03/internationaliser-vos-applications-ios/


It seems to work well, but I was advised not to do so, because of possible bad side effects.

See discussion in forum : https://forums.developer.apple.com/thread/97110


Suggestion: provide built in mechanisms in SDK to allow such a change


Note: I measured the time need to switch language through settings : close to 60 seconds overall, with a bad side effect to alter all apps (imagine the friend is chinese when I'm french, using the phone for other apps may become tricky).

See discussion in forum : https://forums.developer.apple.com/thread/97110

Also this post.

Share and Enjoy

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

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