Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing the app language



I played around with the AppleLanguages thing a bit:

[[NSUserDefaults standardUserDefaults] setObject:[NSArray
arrayWithObject:@"English"] forKey:@"AppleLanguages"];
[[NSUserDefaults standardUserDefaults] synchronize];

This indeed changed the application language off my system default language,
and worked exactly as expected with one exception - it doesn't take effect
until the application restarts. I suppose some internal settings need to be
flushed or something for NSLocalizedString to update the strings file it
reads from, I don't know how or if it's possible to change that.

So I have the choice of seeking and reading the strings file as Douglas
proposed, but not having my save panels and the like be translated, or
changing the language preference under the application domain, as Brian
proposed, and not getting real time switching.

Alastair asked my reasons for supporting such an option. I don't have a
particular need for it in my current project - it's just a feature that I
like and want to include. Which should be enough reason. In this case,
either behavior listed above is acceptable since it's not vital to the
program, but I'm still gonna play with NSUserDefaults some more.

Thanks for your input,
- Jeff
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Changing the app language (From: "Jeff Bland" <email@hidden>)
 >Re: Changing the app language (From: Douglas Davidson <email@hidden>)
 >Re: Changing the app language (From: "Jeff Bland" <email@hidden>)
 >Re: Changing the app language (From: Brian Willoughby <email@hidden>)
 >Re: Changing the app language (From: Alastair Houghton <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.