discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Localize GWorkspace


From: Nicola Pero
Subject: Re: Localize GWorkspace
Date: Thu, 30 Aug 2001 21:43:50 +0100 (BST)

    Enrico> But, exactly, in NSLocalizedString (xxx, comment), what is
    Enrico> supposed to be/do the "comment" string?

When we have tools which can generate the Localizable.strings files
automatically, the comments will be added as comments before the
string to translate.  Upon finding something like

NSLocalizedString (@"My useful string", @"My useful comment about the string");

in the source code, the tools would/will generate the lines 

/* My useful comment about the string */
" My useful string" = "My useful string";

in the Localizable.strings file (of course, the translator then can
use this as a skeleton for the Localizable.strings for his/her own
language, where s?he can replace the right hand side with the
translation in her/his own language).  The comment can help the
translator to decide how to translate when it is not clear how to
translate (because the original string is now out of context, and out
of context might not be so clear what the string means).  The comment
is totally ignored by the library code (which means that because we
don't have the tools now, the comment is totally ignored for now :-) ).

If you don't have a comment (because the string is so self-explanatory
that it doesn't need it), you can leave it blank, by using @"" as a
comment.  If the string might be unclear out of context, it is
recommended that you add a comment (even if it is unused for now).

If you are localizing in a real hurry, you can just use _() as in

_(@"My useful string")

which is just exactly the same as 

NSLocalizedString (@"My useful string", @"")

This use no comments, which is bad, but because localizing using _()
is trivial, there are no excuses for not doing it ...

Writing the required tools should not be too difficult but ... we want
tools which are not only able to generate a skeleton
Localizable.strings file, but also to *update* the existing ones (I
mean, removing all messages which are not any longer in the new code,
adding any new message which is in the new code but is not in the
Localizable.strings file, but keeping any message - including its
translation - which is in the code and was already in the
Localizable.strings files).

If I remember correctly, Pascal has contributed some shell scripts
which you can use to generate Localizable.strings files from the
source code - so basically they should already do part of the tools'
job.  You can ask him for the scripts source code, I think he'll be
happy to share them.

I personally wouldn't mind if we had a couple of Objective-C tools
which do the job ... then we could integrate those into the make
package ... and you would only need to type `make strings' or
something similar and the make package would automatically run the
needed tools on the source files updating the appropriate
Localizable.strings automatically ...



reply via email to

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