[illumos-Developer] BEADM [WEBREV] 418 replace beadm by tbeadm with gettext support

Gordon Ross gordon.w.ross at gmail.com
Thu Dec 9 13:05:06 PST 2010


On Tue, Nov 30, 2010 at 2:51 PM, Alexander Stetsenko <ams at nexenta.com> wrote:
> latest beadm command webrev:
>
> http://cr.illumos.org/view/l9tyxd9g/

Why use tables of error message strings instead of doing gettext calls
(or the _() macro) at the site were these strings are used?
It appears most of them are used only once.

If you really want defines, you could do like this:
#define STRING1	gettext("string1")
#define STRING2	gettext("string2")

Also, if you do need tables of strings (which I don't think you do here)
the more common way I've seen for doing that is like this:

/* Howto: Tables of translated strings. */

#ifndef I18N	/* never defined, just a trick for xgettext */
#define gettext(S) S
#endif

const char *table[] = {
	gettext("string1"),
	gettext("string2"),
	NULL
};



More information about the Developer mailing list