[ast-users] Re: [ksh93-integration-discuss] getopts function and manual page output
Glenn Fowler
gsf at research.att.com
Thu Nov 16 09:49:55 PST 2006
here is an example that generates gencat(1) compatible message files
for one of the components in the ast-base (also ast-open) package
the examkple requires ast nmake to take advantage of the 'msgcat'
base rules common action
the example requires att nmake (for the base rules msgcat common action)
you can nmake -n to see what nmake does to bring it into your cm system,
or you can use nmake and not worry
first download the ast-base (minimal to build nmake and msg catalog support)
or ast-open (many more tools) source package (along with the required INIT
package)
I've posted alpha packages for testing:
http://www.research.att.com/sw/download/package
http://www.research.att.com/sw/download/alpha/INIT.2006-11-15.tgz
http://www.research.att.com/sw/download/alpha/ast-base.2006-11-15.tgz
to build:
# in a clean dir
mkdir -p bin lib/package/tgz
# download the package to bin
# download the *.tgz to lib/package/tgz
bin/package read
bin/package make
bin/package use
# now in a shell ready to test
cd proto
# the test will generate a message catalog for the
# executables and shell scripts in the proto dir
nmake msgcat
# proto.msg is the gencat(1) compatible message catalog
if you look into the ast source you'll note that msgcat does
most of the l10n string extrations work -- the source code
itself has little if any explicit modifications
to mark strings for l10n reaping, i.e., you won't
see many explicit translation calls outside of
the libast translation routines -- and when you do
the C locale strings are used as message indices,
so you won't have to keep a message number dictionary
handy to read diagnostic message in the code
gencat the native proto.msg and install it in the C locale
LC_MESSAGES location according to local conventions
then translate proto.msg (maybe using a jargonizer, or
rot13 or toupper the "..." strings for testing) and gencat
and install that in the non-C locale LC_MESSAGES location
the message indices in the C locale catalog will be used to index
the corresponding messages in the non-C locale catalog
export LC_MESSAGES to the non-C locale and run
sear --man
release --man
you can also use LC_MESSAGES=debug to see the C locale lookup keys
let me know how the process works with native gencat(1)
we use the ast msggen which takes a different tack than
e.g. solaris or gnu/linux gencat, so I am not intimately familiar
with NLSPATH values and message catalog installation dirs --
I just coded enough to get catgets() etc. working against
already installed native catalogs
-- Glenn Fowler -- AT&T Research, Florham Park NJ --
More information about the ksh93-integration-discuss
mailing list