Re: Changing the app language
Re: Changing the app language
- Subject: Re: Changing the app language
- From: Brian Willoughby <email@hidden>
- Date: Fri, 27 Jul 2007 13:44:35 -0700
Jeff: I think you cannot have duplicate keys. Those comments would
doubtful accomplish anything in your code. You probably need to
reorganize your design so that your keys are all unique, even if
multiple keys map to the same English words (as you note, some may
map to different words in other languages). I realize that the
general approach is to use the English as the key, but in your case
you'll need unique keys.
Douglas: The user defaults system of Mac OS X has multiple domains:
Global, System, User, Application. It seems logical to assume that
the defaults database setting which sets language preferences for a
user across all applications could be overridden by simply setting
the same preference as an application-specific setting, but with
different languages selected. If this does not work, then I would
suspect it to be a bug. Due to the object-oriented nature of
NSUserDefaults, the language code should have no knowledge of where
the setting comes from or whether it has been overridden by another
domain.
Brian Willoughby
Sound Consulting
On Jul 27, 2007, at 13:27, Jeff Bland wrote:
Great, I got it working using mainBundle's pathForResource, NSData's
dataWithContentsOfFile, and NSPropertyListSerialization's
propertyListFromData. However the comments, which I was using as
headers for
sections that may contain identical keys (identical in english, but not
necessarily in other languages), are completely gone when I load it with
NSData. I suppose I'll have to work around that.
Thanks.
On 7/27/07, Douglas Davidson <email@hidden> wrote:
There's no specific API for this; you need to use NSBundle
language-specific resource APIs to locate the strings file, but in
order to
parse it you can just read it as a property list, so it's really
not much
code.
Douglas Davidson
_______________________________________________
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:
This email sent to email@hidden