Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2014-10-08 00:46:19 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2014-10-08 00:47:32 +0400
commit8d084e8c8f48dd2f07d4a3fbd4a941a7bcc0dcfb (patch)
tree5bf15f4f74f3e5a307cfa3f734b2cd086dca69bd /intern/locale/osx_user_locale.mm
parenta8705e99ee8ec9de2f25c3bac1e9895c2f98c224 (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.mm22
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;
+}