On Sun, 14 Jan 2007 12:17:55 +0100 Roland Mainz wrote:
> - ksh93 has builtin localisation support. Instead of using
> /usr/bin/gettext scripts can put a $ in front of "..." string literals
> which makes these texts subject to localisation (see
> http://mail.opensolaris.org/pipermail/tools-discuss/2007-January/003209.html).
> The "tricky" part is that /usr/bin/gettext uses "text domains" to bundle
> message catalogs while ksh93 uses the script name to lookup the name of
> the catalog. This could be solved via plain softlinks (e.g. link
> "/usr/lib/locale/de_DE.UTF-8/LC_MESSAGES/myscript" to
> "/usr/lib/locale/de_DE.UTF-8/LC_MESSAGES/SUNW_OST_OSCMD.mo") but I guess
> such links would require an ARC case per softlink or patch set,
> generating lots of paperwork (I guess ARC doesn't give blanko
> permissions away, right ? :-) ... and we have to ask the i18n/l10n
> people whether they approve such changes in general before starting such
> a work) ... ;-(
> - Use the ksh93 "getopts" builtin (as side-effect things like "myscript
> --man", "myscript --usage" etc. would generate manualpage/usage-like
> output) which is significantly more powerfull than the plain
> /usr/bin/getopts
getopts also localizes
each string listed by the '--??keys' option is used as a localization key
the C locale string is the key itself
the catalog name ("text domain") may be specified in the getopts usage string
[--catalog?any-catalog-name]
-- Glenn Fowler -- AT&T Research, Florham Park NJ --