diff options
author | volzhs <volzhs@gmail.com> | 2017-05-27 03:50:22 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2017-05-27 03:50:22 +0900 |
commit | 062744586324a80a003e1488275b14841cf105d7 (patch) | |
tree | 23378ff1c59eec1b6bdb18b24ce4cfa04f89cd84 /platform | |
parent | ef66f8451ca7b5b98628924231a92e558930c53e (diff) |
Make OS.get_locale() returns same value
Diffstat (limited to 'platform')
-rw-r--r-- | platform/iphone/app_delegate.mm | 3 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 0d9750d701..d02cc15339 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -401,8 +401,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 d13486b490..13bc2226f4 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1228,8 +1228,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() { |