Re: gettext-based localization Per Bothner 12 Apr 2002 19:37 UTC

Scott G. Miller wrote:
>>I.e. instead of having to come up with a MESSAGE-TAG for each
>>message, why not use the primary-language "MESSAGE" as it's own
>>template?  This is much simpler and convenient, plus of course
>>it is compatible with the GNU gettext paradigm, which I think is
>>desirable.  (Primary-language need not mean English, of course, but
>>it should be one that both the programmers and likely translators
>>are comfortable with.)
>
>
> Also, using the primary language as the tag discourages clean
> localization patterns, where the author of the code should be collecting
> his locale dependent messages in one place so that translators can
> easily translate the messages without having to seek them out in the
> code.

That's a tools issue.  gettext has tools the automatically generates
pre-translation files, containing each message to be translated, as
well as its context (file and line).

A major advantage of of using the primary language message as the tag
is that it makes the program easier to understand, since when you
read the program you *see* what kind of message is emitted.
Which do you prefer:
   (put-message 'hello user)
or:
   (format (gettext "Hello ~a!") user)

I would find the latter more informative.

> Or, if the primary language programmer wants to make a
> change in said primary language, he has to search out the string in his
> code as well.

Yes, that is an potential issue.  On the other hand, that isn't
different from other updates, when messages are added or removed.
--
	--Per Bothner
xxxxxx@bothner.com   http://www.bothner.com/per/