diff options
author | Jens Verwiebe <info@jensverwiebe.de> | 2013-03-03 02:50:46 +0400 |
---|---|---|
committer | Jens Verwiebe <info@jensverwiebe.de> | 2013-03-03 02:50:46 +0400 |
commit | 1c5f18f42b4de1dcd90dcb134105db9e11d14d5a (patch) | |
tree | 1f5c836c6620d005e378433df282268ff46164a5 /intern/ghost | |
parent | b74c686c66f5b18f454422e1af2fed726ad4570f (diff) |
OSX: Get the current locale in objC-style
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 2d8070191c9..bc215ae4914 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -542,6 +542,7 @@ int cocoa_request_qtcodec_settings(bContext *C, wmOperator *op) #pragma mark initialization/finalization +const char *user_locale; // Global current user locale GHOST_SystemCocoa::GHOST_SystemCocoa() { @@ -580,6 +581,12 @@ GHOST_SystemCocoa::GHOST_SystemCocoa() rstring = NULL; m_ignoreWindowSizedMessages = false; + + //Get current locale + CFLocaleRef myCFLocale = CFLocaleCopyCurrent(); + NSLocale *myNSLocale = (NSLocale *)CFBridgingRelease(myCFLocale); + NSString *nsIdentifier = [myNSLocale localeIdentifier]; + user_locale = [nsIdentifier UTF8String]; } GHOST_SystemCocoa::~GHOST_SystemCocoa() |