First of all, ksh93 does not appear to use gettext() for message translation 
as suggested by Olga Kryzhanovska.

libast/misc/translate.c seems to be where actual message translation
occurs and this function uses the standard POSIX catgets() API to retrieve
a message from a standard message catalog  after first determining what 
the message ID is (still need to figure out how this actually occurs!)

Where the $" ..." translation should occur seems to be in sh_endword() in
lex.c when mode is 1.  However, this function appears to be currently set 
up to handle only ksh93 error strings using ERROR_translate().

In short, as far as I can see,  ksh93 does not appear to support localized 
message strings at present.

David, Glenn, feel free to correct me if I am wrong.  I may have missed 
something obvious!


> Date: Wed, 20 May 2009 12:34:41 +0200
> From: [email protected]
> To: [email protected]; [email protected]
> CC: 
> Subject: [ast-developers]     Re: [ast-users] Seeking help with $"string", 
> ksh -D, gencat and         NLSPATH
> 
> On 18/05/2009, Wendy Lin <[email protected]> wrote:
> > On 25/04/2009, ольга крыжановская <[email protected]> wrote:
> >  > On 4/25/09, Wendy Lin <[email protected]> wrote:
> >  >  > I need help with $"string" strings to localise a script until Tuesday.
> >  >  >  I created a test script with $"string" messages, ran ksh -D to 
> > extract
> >  >  >  the strings but gencat refuses to process this output with a Syntax
> >  >  >  error message.
> >  >  >
> >  >  >  Can anyone provide a complete example with NLSPATH for Solaris how I
> >  >  >  can localise a script from the beginning to the end, please?
> >  >
> >  >
> >  > I tried to apply the description in
> >  >  http://wooledge.org:8000/BashFAQ/098 to ksh93 but failed:
> >  >  $ cat myscript
> >  >  #!/usr/bin/ksh93
> >  >  echo $"hello world"
> >  >  $ mkdir jjj
> >  >  $ cd jjj
> >  >  $ cat myscript.in
> >  >  msgid  "hello world"
> >  >  msgstr "hello world l10n"
> >  >  $ /usr/bin/msgfmt -s -o myscript.cat myscript.in
> >  >  $ cd ..
> >  >  $ NLSPATH="$HOME/jjj/%N.cat" gettext -d myscript "hello world"
> >  >  hello world l10n
> >  >  $ TEXTDOMAIN="myscript" NLSPATH="$HOME/jjj/%N.cat" bash ./myscript
> >  >  hello world l10n
> >  >  $ TEXTDOMAIN="myscript" NLSPATH="$HOME/jjj/%N.cat" ksh93 ./myscript
> >  >  hello world
> >  >
> >  >  It looks the built in gettext support in ksh93 is broken.
> >
> >
> > I agree this is broken or not sufficiently documented.
> >  My manager wishes to ask if a AST support contract is required to
> >  obtain information how to use $"string" or a bug fix?
> 
> Hello? Is the list working?
> 
> Wendy

_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to