leverdeterre / LanguagesManager

An easy way to control manually the language in your application
MIT License
62 stars 11 forks source link

Switching back to English language not working #3

Closed Janak-Nirmal closed 10 years ago

Janak-Nirmal commented 10 years ago
- (void)switchLanguage
{
    if([[[LanguagesManager sharedInstance] getDefaultLanguage] isEqualToString:@"fr"]) {
        [[LanguagesManager sharedInstance] setLanguage:@"en"];
    }
    else {
        [[LanguagesManager sharedInstance] setLanguage:@"fr"];
    }

    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:[[JMOViewController alloc] initWithNibName:nil bundle:nil]];
    navController.navigationBarHidden = YES;
    self.window.rootViewController = navController;

    [UIView transitionWithView:self.window duration:0.5 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{
    } completion:nil];
}

In above code for if condition it always goes to else part i.e.

[[LanguagesManager sharedInstance] getDefaultLanguage] always returns en though current language may be different from it.

leverdeterre commented 10 years ago

Correction done ! Thanks