From dde997edcb28cf2e26d7ca2d20a1313c758cac46 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 31 May 2018 14:59:09 -0700 Subject: [PATCH] Improve iOS region string (thanks @maaniv!) --- project/src/system/Locale.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/project/src/system/Locale.mm b/project/src/system/Locale.mm index 84d9fc796..4e76c8cf7 100644 --- a/project/src/system/Locale.mm +++ b/project/src/system/Locale.mm @@ -16,7 +16,10 @@ namespace lime { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; #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; if (locale) {