Improve iOS region string (thanks @maaniv!)

This commit is contained in:
Joshua Granick
2018-05-31 14:59:09 -07:00
parent 026018886e
commit dde997edcb

View File

@@ -16,7 +16,10 @@ namespace lime {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
#endif #endif
NSString* locale = [[NSLocale currentLocale] localeIdentifier]; NSString* localeLanguage = [[NSLocale preferredLanguages] firstObject];
NSString* localeRegion = [[NSLocale currentLocale] countryCode];
NSString* locale = [[localeLanguage stringByAppendingString:@"_"] stringByAppendingString:localeRegion];
std::string* result = 0; std::string* result = 0;
if (locale) { if (locale) {