[Top][All Lists]

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

Re: Localization in tools

From: Nicola Pero
Subject: Re: Localization in tools
Date: Thu, 25 Sep 2003 16:11:07 +0100 (BST)

> Dear developers,
> Is it correct that localization does not work in tools? I have a 
> loadable bundle with
>        ./Resources/English.lproj/Localizable.strings
>        ./Resources/German.lproj/Localizable.strings
> Both files are unicode encloded and contain stuff like
> "1" = "Please check the tax rates in vkContract address@hidden";
> "2" = "No Loading Volume for address@hidden";
> "3" = "Cancel";
> When I set my sytem to German in System Preferences and execute the 
> following code in an app, I get the german translation.
>        NSBundle *bundle = [NSBundle 
> bundleWithPath:@"/SomeDir/Bundles/MyBundle.bundle"];
>        NSLog(@"string %@", [bundle localizedStringForKey:@"3" 
> value:@"Fehler" table:nil]);
> When I do the same in a tool I get the english text of 
> ./Resources/English.lproj/Localizable.strings. Why? Shouldn't that work 
> in tools as well?

Yes - I just tried and it works on my GNUstep -

nicola:/opt/nicola/AndreasTest$ make
Making all for bundle Bundle...
 Creating Bundle.bundle/Resources...
 Creating Bundle.bundle/Resources/Info-gnustep.plist...
 Copying localized resources into the bundle wrapper...
Making all for tool Tool...
 Compiling file Tool.m ...
 Linking tool Tool ...
nicola:/opt/nicola/AndreasTest$ ./obj/Tool
2003-09-25 16:08:16.524 Tool[6140] string English
nicola:/opt/nicola/AndreasTest$ defaults write NSGlobalDomain NSLanguages 
nicola:/opt/nicola/AndreasTest$ ./obj/Tool
2003-09-25 16:08:28.094 Tool[6142] string Italian

In attach a .tgz with the files composing the very quick test I used.  
You need to manually fixup the bundle path to where you put the bundle.

Let me know if you find what is going wrong in your tests, or if you can
reproduce a GNUstep bug - it works for me.


Attachment: AndreasTest.tgz
Description: GNU Zip compressed data

reply via email to

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