[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [RFC] po-sysv: Internationalizing the init scripts

On Tue, Oct 14, 2003 at 04:38:12PM +0100, amck@utvinternet.com wrote:
> Why po-debconf ? gettext also supports shell, etc. (which is 
> how redhat, etc. do it).  Some /etc/init.d files , such as
> pcmcia, etc are shared across plaforms, which we would want,
> and they use GETTEXT. Why not just use gettext, placing the
> po files in the same place as redhat /mandrake, etc?

Yes, that's how it should be done (and makes transition to a po-based 
system easier)

> (Obviously use po-debconf for debconf stuff, but boot and
> /etc/init.d services would use
>   if [ -e /bin/gettext ] 
>       GETTEXT="getttext --domain $SERVICE "
>   else
>       GETTEXT="echo -n"
>   $GETTEXT "Starting service..."
> etc.

Just to nitpick:

/etc/init.d/service should source a file (in RedHat this file is under 
/etc/sysconfig/i18n IIRC) which defines:

   if [ -e /bin/gettext ]
       ECHO="getttext --domain $SERVICE "
       ECHO="echo -n"

   $ECHO "Starting service..."

(which is better for maintainers since you can ask them to just sed 'echo 
-n' into $ECHO and they might see that as a small change).

Now, notice that some strings (echo "done." or echo "Usage: $N 
{start|stop|restart|force-reload}") could be translated globally 
instead on a per-domain basis.

Also notice that many of the programs called by most init scripts (such as 
start-stop-daemon) should be i18n/l10n'ized or otherwise you are only 
translating half of the script.

Finally, in order to be able to make this real you have to:

- make the proper implementation (the file which is sourced by init 
scripts and the infraestructure for translations)

and then

a) force it through policy (unlikely)
b) make a mass-filing of bugs asking "pretty please" for maintainers to 
change the init scripts while

One of the good side effects of having all "echo"s in init.d scripts being 
under some kind of control over this information which would help solve 
#169600 or even include the nice RedHat feature of colorising the output of 
start-stop daemon (green OK, red NOK).

IMHO a generic mechanism for "echo"s in init.d scripts should be defined 
and mandated by policy and then, an i18n implementation of this could be 



Attachment: pgpue5oqR23_R.pgp
Description: PGP signature

Reply to: