Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > OOP Powerplant for Mac > Re: How to disp...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 443 of 483
Post > Topic >>

Re: How to display StandardAlert in Powerplant while localization

by "Neel" <nilesh_ibmr@[EMAIL PROTECTED] > Mar 9, 2006 at 09:04 PM

I am trying to change application locale dynamically, for that i
need to know the current culture/language of machine so that i can
switch application locale to the same language.
following is the snippet of code which return me the "en_IN". Please
have a look,

CFLocaleRef userLocaleRef = CFLocaleCopyCurrent();
CFStringRef l_CurrentLocale, l_CanStr;
l_CurrentLocale = CFLocaleGetIdentifier(userLocaleRef);

char buffer[255];
memset(buffer, '\0', sizeof(buffer));
l_CanStr =
CFLocaleCreateCanonicalLocaleIdentifierFromString(kCFAllocatorDefault,
l_CurrentLocale);
CFStringGetCString(l_CanStr, buffer, 255, CFStringGetSystemEncoding());
Alert(buffer);
// output is en_IN.

Now, if i change "System Preferences->International->Language" to other
language suppose "Chinese" then i would be expecting something like
"ch_ " as string output but it does not work, it shows always en_IN.
Why so ? Where should i make change to get the current language/culture
of the Macintosh OS X 10.3.5 dynamically ?

My application .plist looks like:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple
Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>CFBundleDevelopmentRegion</key>
        <array/>
        <key>CFBundleDo***entTypes</key>
        <array>
                <dict>
                        <key>0</key>
                        <string></string>
                        <key>CFBundleTypeName</key>
                        <string>Text file</string>
                        <key>CFBundleTypeOSTypes</key>
                        <array>
                                <string>TEXT</string>
                        </array>
                        <key>CFBundleTypeRole</key>
                        <string>Application</string>
                </dict>
        </array>
        <key>CFBundleGetInfoString</key>
............

Please suggest.
Thanks in advance.
 




 4 Posts in Topic:
How to display StandardAlert in Powerplant while localization
"Neel" <nile  2006-03-02 06:21:49 
Re: How to display StandardAlert in Powerplant while localizatio
Stephen Chu <stephen@[  2006-03-02 11:28:22 
Re: How to display StandardAlert in Powerplant while localizatio
"Neel" <nile  2006-03-08 06:43:22 
Re: How to display StandardAlert in Powerplant while localizatio
"Neel" <nile  2006-03-09 21:04:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Aug 29 14:17:47 CDT 2008.