diff options
author | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2014-10-08 00:46:19 +0400 |
---|---|---|
committer | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2014-10-08 00:47:32 +0400 |
commit | 8d084e8c8f48dd2f07d4a3fbd4a941a7bcc0dcfb (patch) | |
tree | 5bf15f4f74f3e5a307cfa3f734b2cd086dca69bd /intern/locale/osx_user_locale.mm | |
parent | a8705e99ee8ec9de2f25c3bac1e9895c2f98c224 (diff) |
Ghost Context Refactor
https://developer.blender.org/D643
Separates graphics context creation from window code in Ghost so that they can vary separately.
Diffstat (limited to 'intern/locale/osx_user_locale.mm')
-rw-r--r-- | intern/locale/osx_user_locale.mm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/intern/locale/osx_user_locale.mm b/intern/locale/osx_user_locale.mm new file mode 100644 index 00000000000..1ed33bb1713 --- /dev/null +++ b/intern/locale/osx_user_locale.mm @@ -0,0 +1,22 @@ +#include "boost_locale_wrapper.h" + +#import <Cocoa/Cocoa.h> + +#include <cstdlib> + +static char* user_locale = NULL; + +// get current locale +const char* osx_user_locale() +{ + ::free(user_locale); + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + CFLocaleRef myCFLocale = CFLocaleCopyCurrent(); + NSLocale * myNSLocale = (NSLocale *) myCFLocale; + [myNSLocale autorelease]; + NSString *nsIdentifier = [myNSLocale localeIdentifier]; + user_locale = ::strdup([nsIdentifier UTF8String]); + [pool drain]; + + return user_locale; +} |