diff options
Diffstat (limited to 'platform/iphone/os_iphone.mm')
-rw-r--r-- | platform/iphone/os_iphone.mm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/platform/iphone/os_iphone.mm b/platform/iphone/os_iphone.mm index f0bbbd39ca..a7366ffdec 100644 --- a/platform/iphone/os_iphone.mm +++ b/platform/iphone/os_iphone.mm @@ -305,20 +305,20 @@ String OSIPhone::get_user_data_dir() const { return user_data_dir; } -void OSIPhone::set_locale(String p_locale) { - locale_code = p_locale; -} - String OSIPhone::get_locale() const { - return locale_code; -} + NSString *preferedLanguage = [NSLocale preferredLanguages].firstObject; + + if (preferedLanguage) { + return String::utf8([preferedLanguage UTF8String]).replace("-", "_"); + } -void OSIPhone::set_unique_id(String p_id) { - unique_id = p_id; + NSString *localeIdentifier = [[NSLocale currentLocale] localeIdentifier]; + return String::utf8([localeIdentifier UTF8String]).replace("-", "_"); } String OSIPhone::get_unique_id() const { - return unique_id; + NSString *uuid = [UIDevice currentDevice].identifierForVendor.UUIDString; + return String::utf8([uuid UTF8String]); } void OSIPhone::vibrate_handheld(int p_duration_ms) { |