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

Re: gettext-based localization

This page is part of the web mail archives of SRFI 29 from before July 7th, 2015. The new archives for SRFI 29 contain all messages, not just those from before July 7th, 2015.

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)
  (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
per@xxxxxxxxxxx   http://www.bothner.com/per/