Skip to content

Commit

Permalink
Merge pull request #7254 from AngelkPetkov/TIMOB-19566
Browse files Browse the repository at this point in the history
[TIMOB-19566] iOS-Truncated language string
  • Loading branch information
pec1985 committed Oct 5, 2015
2 parents a6b1733 + 7f35278 commit 4773bb2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions iphone/Classes/TiLocale.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#import "TiLocale.h"
#import "TiBase.h"
#import "TiUtils.h"

@implementation TiLocale

Expand Down Expand Up @@ -37,6 +38,11 @@ +(NSString*)defaultLocale
NSArray* languages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
NSString *preferredLang = [languages objectAtIndex:0];
[TiLocale setLocale:preferredLang];
NSString *var = [[UIDevice currentDevice] systemVersion];
if ([TiUtils isIOS9OrGreater]) {
//[TIMOB-19566]:Truncate the current locale for parity between iOS versions
[l setCurrentLocale:[[l currentLocale] substringToIndex:2]];
}
}
return l.currentLocale;
}
Expand Down

0 comments on commit 4773bb2

Please sign in to comment.