diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index b46552af8df..de363d6e532 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -398,8 +398,7 @@ static int frame_count = 0; OSIPhone::get_singleton()->set_data_dir( String::utf8([documentsDirectory UTF8String])); - NSString *locale_code = - [[[NSLocale preferredLanguages] objectAtIndex:0] substringToIndex:2]; + NSString *locale_code = [[NSLocale currentLocale] localeIdentifier]; OSIPhone::get_singleton()->set_locale( String::utf8([locale_code UTF8String])); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 2a7108c3136..cc68db9ff94 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1341,8 +1341,8 @@ Error OS_OSX::shell_open(String p_uri) { } String OS_OSX::get_locale() const { - NSString *preferredLang = [[NSLocale preferredLanguages] objectAtIndex:0]; - return [preferredLang UTF8String]; + NSString *locale_code = [[NSLocale currentLocale] localeIdentifier]; + return [locale_code UTF8String]; } void OS_OSX::swap_buffers() {