Created
February 27, 2012 08:26
-
-
Save anonymous/1922569 to your computer and use it in GitHub Desktop.
11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static NSBundle* saved_language_bundle = nil; | |
static int saved_language = -1; | |
NSString* languageSelectedString(NSString* x1) | |
{ | |
NSUserDefaults* prefs = [NSUserDefaults standardUserDefaults]; | |
NSString * result = nil; | |
int language = [[prefs valueForKey:@"uoslanguage"] integerValue]; | |
if (language == 2) | |
{ | |
return @"test"; | |
} | |
if ( language == saved_language ) | |
{ | |
result = [saved_language_bundle localizedStringForKey:x1 value:@"" table:nil]; | |
} else | |
{ | |
saved_language = language; | |
if ( language == 1) | |
{ | |
NSString* path = [[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"]; | |
saved_language_bundle = [NSBundle bundleWithPath:path]; | |
result = [saved_language_bundle localizedStringForKey:x1 value:@"" table:nil]; | |
} | |
else if ( language == 0) | |
{ | |
NSString* path = [[NSBundle mainBundle] pathForResource:@"ru" ofType:@"lproj"]; | |
saved_language_bundle = [NSBundle bundleWithPath:path]; | |
result = [saved_language_bundle localizedStringForKey:x1 value:@"" table:nil]; | |
} else | |
result = @"error"; | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment