Make OS.get_locale() returns same value

This commit is contained in:
volzhs 2017-05-27 03:42:28 +09:00
parent 29c7118f32
commit a495feae3e
2 changed files with 3 additions and 4 deletions

View File

@ -398,8 +398,7 @@ static int frame_count = 0;
OSIPhone::get_singleton()->set_data_dir( OSIPhone::get_singleton()->set_data_dir(
String::utf8([documentsDirectory UTF8String])); String::utf8([documentsDirectory UTF8String]));
NSString *locale_code = NSString *locale_code = [[NSLocale currentLocale] localeIdentifier];
[[[NSLocale preferredLanguages] objectAtIndex:0] substringToIndex:2];
OSIPhone::get_singleton()->set_locale( OSIPhone::get_singleton()->set_locale(
String::utf8([locale_code UTF8String])); String::utf8([locale_code UTF8String]));

View File

@ -1341,8 +1341,8 @@ Error OS_OSX::shell_open(String p_uri) {
} }
String OS_OSX::get_locale() const { String OS_OSX::get_locale() const {
NSString *preferredLang = [[NSLocale preferredLanguages] objectAtIndex:0]; NSString *locale_code = [[NSLocale currentLocale] localeIdentifier];
return [preferredLang UTF8String]; return [locale_code UTF8String];
} }
void OS_OSX::swap_buffers() { void OS_OSX::swap_buffers() {