[illumos-Developer] BEADM [WEBREV] 418 replace beadm by tbeadm with gettext support
Gordon Ross
gordon.w.ross at gmail.com
Sat Dec 11 14:30:03 PST 2010
On Sat, Dec 11, 2010 at 6:10 AM, Alexander Stetsenko <ams at nexenta.com> wrote:
> 11.12.2010 07:56, Gordon Ross [ asked about empty messages.po file]
>
> xgettext generate empty file because of it lacks "_" keyword checking, also
> it lacks option to enable (it seems)
> gxgettext -k_ - generate ok file, and I tested this by creating russian
> translation,
> but really I don think this make sense anyway, because make _msg (not make
> msg as you wrote, and that confused me)
> generate good .po file too.
>
> this is output of make _msg:
Ah! I did not realize that the default rule for "make _msg" uses
the pre-processed C files! Interesting. (That, by the way, would
break the message table example I sent previously:) I guess
more of the code I've worked with had it's own POFILE rules
that just ran xgettext directly on the *.c files. Whatever.
Thanks for sending your "make _msg" output.
That cleared up for me what I was missing.
> I`ve attached beadm.po, is this ok?
That looks fine, except for another issue that I thought I
mentioned previously. The messages file has "yes", "no"
strings, which is not ideal. The code in confirm_destroy()
should be using the nl_langinfo(3C) function with keys:
YESSTR, NOSTR, YESEXPR, NOEXPR (langinfo.h)
Do a google search for those and you'll find examples.
(Print using the first two, check responses using the
second two with regcomp(), regexec(), etc.)
>> And I still really don't like beadm_errmsg_init() [...]
> Well, If I wrote beadm from scratch I would [...]
There are 42 beadm_errmsg[] array elements.
How long would it take long to turn the references to
those array elements into gettext calls? (or _("string")
And then remove the enum beadm_errno and array?
Thanks,
Gordon
More information about the Developer
mailing list