Re: More localization
Re: More localization
- Subject: Re: More localization
- From: Thomas Lachand-Robert <email@hidden>
- Date: Tue, 11 Dec 2001 21:09:14 +0100
Le mardi 11 dicembre 2001, ` 07:56 , Jens Bauer a icrit :
Hi all,
I've tried localizing my application, but I don't think I had any luck
this time.
Did I miss something, or do I need to do some further work ?
Yes ;-) That's not the way it's supposed to work.
Ane localized application should have subfolders in the 'Resources'
directory, with names like English.lproj, French.lproj, etc. Then the
contents (in files) of these directories should be the same (if all the
app has been localized). In the english.lproj, you find, as keys/values in
printf format, the strings used by the app internally, but displayed to
users like this error message:
@"The file %s cannot be opened since its used by another application." = @
"The file %s cannot be opened since its used by another application.";
This looks odd because the key is usually the same of the string itself;
but you can follow another style:
@"error message for unopened file"= @"The file %s cannot be opened since
its used by another application.";
This is not so clear in your app, and you could forgot the parameter (%s),
so it's not a very good idea. Also there are Apple tools for parsing your
source and generate the Localizable.strings for you, but they would be
defeated by this approach.
Anyway, the other Localizable.strings in the ****.lproj folders should
contain the same list of keys, but with different values, for instance in
French.lproj (I don't speak Danish, sorry):
@"The file %s cannot be opened since its used by another application." = @
"Le fichier %s ne peut jtre ouvert car il est utilisi par une autre
application.";
Don't forget the parameters marks. The order of parameters can be changed
with appropriate syntax.
Now the strings in user interface objects are NOT in *.strings files.
There are directly put in the nib files; in particular the menu is usually
in MainMenu.nib. That's why your approcch doesn't work.
You have to open the nib files with Interface Builder, and then change
here the menus, the buttons, etc.
In order to better understand that, you could try on a real app, in
Omniweb for instance. Look inside the 'Resources' directory, there is a
lot of translations here.
Hope this help,
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.