Skip to content

Commit

Permalink
fix(ios) : defaultLocale call should not write currentlocale in userd…
Browse files Browse the repository at this point in the history
…efault (#10545)
  • Loading branch information
vijaysingh-axway authored and longton95 committed Dec 18, 2018
1 parent 639c9e6 commit f5fdf88
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions iphone/Classes/TiLocale.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ + (NSString *)defaultLocale
if (l.currentLocale == nil) {
NSArray *languages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
NSString *preferredLang = [languages objectAtIndex:0];
[TiLocale setLocale:preferredLang];
if ([TiUtils isIOS9OrGreater]) {
[l setCurrentLocale:[[l currentLocale] substringToIndex:2]];
preferredLang = [preferredLang substringToIndex:2];
}

return preferredLang;
}
return l.currentLocale;
}
Expand Down

0 comments on commit f5fdf88

Please sign in to comment.