discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Localization in an application


From: Adam Fedor
Subject: Re: Localization in an application
Date: Mon, 29 Mar 2004 15:10:50 -0700


On Monday, March 29, 2004, at 01:04 PM, Chris B. Vetter wrote:

On Fri, 26 Mar 2004 21:19:32 -0700
Adam Fedor <fedor@doc.com> wrote:
On Mar 25, 2004, at 4:49 PM, Chris B. Vetter wrote:
No, because this will set NSLanguages in NSGlobalDomain, not the
application's.
Perhaps you'll have to write your own NSUserDefaults method to do it.
I also think there is a bug in +[NSUserDefaults userLanguages] that
doesn't properly get the languages if they have been updated.

The problem isn't with setting the language and store it in the user's
defaults.

NSUserDefaults+setUserLanguages: writes into NSGlobalDomain, and
therefor will affect all applications and tools -- that's not what I
want.

So, instead I use

  NSArray *array = [NSArray arrayWithObject: @"SomeLanguage"];
  [userDefaults setObject: array forKey: @"NSLanguages"];

to write to the application's domain. It works insofar, that upon
restart "SomeLanguage" will be used instead of the default language set
in NSGlobalDomain.

However, what I'm _really_ trying to figure out is, why the change of
the language doesn't take effect right away.

That's the bug I was talking about above.



  table =
    @"/path/to/Resources/German.lproj/Localizable.strings";


[...]
Why is it trying to read .../Localizable and not .../Localizable.strings



That's mostly just an incorrect error message, I think it really is looking for the right file, but the table needs to be a path relative to the bundle, not an absolute path (is it?). Although perhaps NSBundle should recognize that the path is absolute and use that...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]