cc:  robbin.kawabata at sun.com  kenjiro.tsuji at sun.com
Subject: Re: Re: Re: [ksh93-integration-discuss] comments on ksh93 migration 
plan
--------

> I want to minimize this as much as possible, so we can continue to
> update from the ksh93 source in a timely manner.
> But in Solaris utilities, we gettext() messages, and 
> this is the basis for generating messaging files which are automatically
> passed onto the localization groups for translation.  I admit that I
> did not turn on the translation functions when building ksh93
> and do not yet understand it enough to know if we can create some kind of
> wrapper or macros for ksh93 to fit into the Solaris i18n framework.
> 

The ast toolkit comes with a tool, msgcc.  for extracting phrases that
need translation, both error message and built-in man pages.
It does not require gettext() or changes to the source in order to work.
Each library and each program creates a file for strings that need translation.
An example, the first twenty message in the C locale for libshell are these:
====================cut here===============================
$translation msgcc 2002-09-18
$quote "
$set 3
1 "[varname seconds]"
2 "alias - define or display aliases"
3 "\balias\b creates or redefines alias definitions or writes the existing 
alias definitions to standard output.  An alias definitions provides a string 
value that will replace a command name when the command is read.  Alias names 
can contain any printable character which is not special to the shell.  If an 
alias value ends in a space or tab, then the word following the command name 
the alias replaces is also checked to see whether it is an alias."
4 "If no \aname\as are specified then the names and values of all aliases are 
written to standard output.  Otherwise, for each \aname\a that is specified, 
and \b=\b\avalue\a  is not specified, the current value of the alias 
corresponding to \aname\a is written to standard output.  If \b=\b\avalue\a is 
specified, the alias \aname\a will be created or redefined."
5 "\balias\b is built-in to the shell as a declaration command so that field 
splitting and pathname expansion are not performed on the arguments.  Tilde 
expansion occurs on \avalue\a.  An alias definition only affects scripts read 
by the current shell environment.  It does not effect scripts run by this 
shell."
6 "Causes the output to be in the form of alias commands that can be used as 
input to the shell to recreate the current aliases."
7 "Used for tracked aliases.  These are aliases that connect a command name to 
the pathname of the command and are reset when the \bPATH\b variable is unset.  
The tracked aliases feature is now obsolete."
8 "Ignored, this option is obsolete."
9 "[name[=value]...]"
10 "Successful completion."
11 "One or more \aname\a operands did not have an alias definition, or an error 
occurred."
12 "\bsh\b(1), \bunalias\b(1)"
13 "bg - resume jobs in the background"
14 "\bbg\b places the given \ajob\as into the background and sends them a 
\bCONT\b signal to start them running."
15 "If \ajob\a is omitted, the most recently started or stopped background job 
is resumed or continued in the background."
16 "Each \ajob\a can be specified as one of the following:"
17 "\anumber\a"
18 "\anumber\a refers to a process id."
19 "\anumber\a refers to a process group id."
20 "\anumber\a refer to a job number."
====================cut here===============================

For each locale, someone would have to create a similar file replacing each
of these with the string corresponding to that locale.  Another tool then
compiles these into catalogs that are looked up at runtime when outputting
error messages and help and man pages.

Note, that the error numbers will be the same for strings that
haven't changed from release to release so that only new strings
need translation after the library has been updated.  There is
a tool to take the binary catalogs and restore them to this
format for editing.

It could be that Solaris has a different format for catalog files.
In that case, you might want to use that and then change the
interface in libast that looks up message catalog strings.
Our current method uses the C locale string to find the message
number, and then uses the message number to get the locale
specific string.

However, it might be possible to keep the same format for
these catalog files since the only tools that use them
know how to handle the current format.

I believe that there are nmake rules for updating the message
catalogs, but since Glenn Fowler has been doing this I don't
have any experience with it.

David Korn
dgk at research.att.com

Reply via email to