Mehul Solanki
Mehul Solanki

Reputation: 463

How to provide multi language support in iOS?

I'm facing a problem for multi-language support in iOS. I need to supports many languages but i like to make something by which user not need to leave app for just changing language in settings. I am able to change language but i need to restart ios app for taking its effects.

i used following for changing language :

[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"fr", nil]
                                              forKey:@"AppleLanguages"];
    [[NSUserDefaults standardUserDefaults] synchronize];

and i read that restarting app or killing app is against the apple privacy. Please provide your suggestions.

Thanks in advance.

Upvotes: 0

Views: 387

Answers (2)

Andrea
Andrea

Reputation: 26385

Do not change language of an app at runtime, you will have an application with interface in the selected language, but all system services in the "settings" language. Imagine the you have Chinese in the settings, while using the app you change in English and (always inside the app) you visit a section with a map, the map will be shown in Chinese.

Upvotes: 0

Sergey Demchenko
Sergey Demchenko

Reputation: 2954

I've created my custom LanguageManger, which allows to change language in runtime. You can find code here: https://github.com/antrix1989/LanguageManager

Upvotes: 2

Related Questions