[Nut-upsdev] Re: NUT localization [was Re: patch file]
Arnaud Quette
aquette.dev at gmail.com
Thu Jul 6 19:01:57 UTC 2006
2006/7/6, Charles Lepple <clepple at gmail.com>:
>
> On 7/6/06, Arnaud Quette <aquette.dev at gmail.com> wrote:
> > just in time, since I'm finishing 2.0.4-pre1.
> > I'll release it tomorrow, and I'll check to include your patch.
>
> One more thing: the patch changes the solis driver language to
> Portuguese. Are these units sold outside of Brazil?
>
> At some point, if we start supporting more drivers that are sold
> regionally, it might be good to use gettext so that people see driver
> messages in their native language, but when debugging, they can switch
> to the POSIX "C" locale and get English messages without recompiling.
I'm thinking about i18n in nut for some time...
here are some randoms thoughts:
* we have two kinds of translatable data:
(1) daemons msg: {drivers, upsd, upsmon} debug and log messages
(2) data tree descriptions, obtained via upsd
* IIRC, gettext is only capable of translating automagically strings,
considering the local system's locale (I might be wrong, not checked!)
* It means that we would:
(a) limit (the optional) gettext use to (1),
(b) support (2) within nut.
* For (b), we need:
- to translate cmdvartab, and call it cmdvartab.lg_LG, using the standard
codes,
- to improve the "GET DESC" request of the network protocol:
GET DESC <upsname> <varname> <language>
GET DESC su700 ups.status fr_FR
<language> is optional. If it's blank, or if the matching file (ie
cmdvartab.fr or cmdvartab.fr_FR) doesn't exist, the standard (C) file
(cmdvartab) will be used. That case would need either a way to feed back, or
warn the requester.
The best and simpler solution is to embed the local used in the answer, ie:
DESC <upsname> <varname> <language> "<description>"
DESC su700 ups.status "UPS status"
Arnaud
--
Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
OpenSource Developer - http://arnaud.quette.free.fr/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20060706/656398dd/attachment-0001.htm
More information about the Nut-upsdev
mailing list