[Nut-upsdev] Re: NUT localization [was Re: patch file]

Peter Selinger selinger at mathstat.dal.ca
Fri Jul 7 02:14:23 UTC 2006

Charles Lepple wrote:
> On 7/6/06, Arnaud Quette <aquette.dev at gmail.com> wrote:
> > * IIRC, gettext is only capable of translating automagically strings,
> > considering the local system's locale (I might be wrong, not checked!)
> This is the most common usage, but I am pretty sure that is just done
> with a macro that calls the gettext library functions (which would
> take arbitrary strings).

Yes, that is correct. However, if you apply gettext to arbitrary
strings (e.g. variables), then you can no longer automatically extract
translatable strings from the source code - in fact, there could be an
infinite number of strings to translate!

> > * we have two kinds of translatable data:
> > (1) daemons msg: {drivers, upsd, upsmon} debug and log messages
> > (2) data tree descriptions, obtained via upsd

Regarding Arnaud's (1) and (2), I think that (1) is a good idea, and
(2) is a bad one. I think the prevailing philosophy is that
translation, like time zones, is a user interface issue. Internally,
times should be represented in UTC, and string data should be
represented in English. For NUT this would mean that data strings
passed around by drivers, upsd, etc, should not be translated.
However, user interfaces (such as upsc) may choose to translate them
for pretty display.

Otherwise, bad or changing or inconsistent translations (or even
locale settings) can wreak havoc.  Imagine a French-speaking upsd
trying to communicate with a Spanish-speaking upsmon and a
German-speaking driver.

-- Peter

More information about the Nut-upsdev mailing list