0

I am doing multi language app

What I did is, I used two buttons, one for English and One for Arabic

On respective button actions, I am changing my app language. Following is the code for the same

-(void)changeLanguageFunctionEnglish
{
    [[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"en", nil] forKey:@"AppleLanguages"];
    [[NSUserDefaults standardUserDefaults]synchronize];
}

-(void)changeLanguageFunctionArabic
{
    [[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"ar", nil] forKey:@"AppleLanguages"];
    [[NSUserDefaults standardUserDefaults]synchronize];
}

But to reflect this language change I need to restart my app. I don't want to do this restarting. Do anything available, which will fire at the end of the method and my application will get relaunched/restarted once the method execution is done.

Thanks in advance.

I just need to relaunch/restart the app once the language change method is executed.

Sagar
  • 1,286
  • 3
  • 19
  • 34
  • possible duplicate of [Change iOS app's language on the fly](http://stackoverflow.com/questions/6150576/change-ios-apps-language-on-the-fly) – MGY Jul 20 '15 at 06:47
  • @gyer :- I succeed in language change link provided by you. I need to restart/relaunch the app after this change – Sagar Jul 20 '15 at 06:49
  • in your app you change application view right to left when it's change language?? – Sandy Patel Jul 20 '15 at 06:50
  • @SandyPatel :- I didn't get your question. can you elaborate little – Sagar Jul 20 '15 at 06:51
  • @stallone i am just asking you that if your language is in english then all view & text alignment left side right?. but when it's change to arabic language then it's changed to text alignment to right side & some image or button shown in right side. that' my question?? – Sandy Patel Jul 20 '15 at 06:58
  • yes, you are correct. for english its left and for arabic its right. on device language change its working fine. but i don't want to be dependant on device language. so I wrote code above on language change button but failed to relaunch the app – Sagar Jul 20 '15 at 07:01
  • so you must be create two different xib. one for english & second for arabic. – Sandy Patel Jul 20 '15 at 07:03
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/83705/discussion-between-sandy-patel-and-stallone). – Sandy Patel Jul 20 '15 at 07:04

0 Answers0