diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-10-17 09:43:14 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-10-17 09:43:14 -0300 |
commit | eb607b39dfbad9988dc3b4f7d4be25700fb6c716 (patch) | |
tree | 7647fda1b2d4844242709fcb1e4c4908272bf065 | |
parent | f44d15e4fc44aea2c8538cca4629ca47e6b33475 (diff) | |
parent | d48a1bd22d624bfe381d5e1770aab14f2c59c142 (diff) |
Merge pull request #2608 from didier-v/OSX_get_locale
Added specific get_locale to OSX platform
-rw-r--r-- | platform/osx/os_osx.h | 2 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 49fa6c0862..e8277688ac 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -157,6 +157,8 @@ public: Error shell_open(String p_uri); void push_input(const InputEvent& p_event); + String get_locale() const; + virtual void set_video_mode(const VideoMode& p_video_mode,int p_screen=0); virtual VideoMode get_video_mode(int p_screen=0) const; virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const; diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index b0ce37cecf..4990d04ab6 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1254,6 +1254,11 @@ Error OS_OSX::shell_open(String p_uri) { return OK; } +String OS_OSX::get_locale() const { + NSString* preferredLang = [[NSLocale preferredLanguages] objectAtIndex:0]; + return [preferredLang UTF8String]; +} + void OS_OSX::swap_buffers() { [context flushBuffer]; |