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

[RFC] po-sysv: Internationalizing the init scripts



Hello, 

I just tried to restart a service on the computer of a friend of mine using
redhat, and the messages come in french. Now, I'm jalous and I want the same
functionnality under Debian. I've checked the bug pages of sysvinit and
general, and saw nothing like that.

As usual, it will be more complicated under Debian than under other
distributions because we have no centralized authority and some maintainers
won't accept to see parts of "their" packages out of their hands. 


Here is the design I propose for that, introducing a new package called
"po-sysv". It seems pretty simple and I may implement it soon, if nobody
comes up with major objections.

FILES:
------

/etc/po-sysv/<lang-code>/po-sysv.po
  translation provided by this package, extracted by the scripts of
  w.d.o/intl/l10n and translated as usual (main way of translation)
/usr/lib/po-sysv/<lang-code>/<package>.po
  If the package maintainer wants to override the content of the previous
  database, or simply to integrate those translations in their package.
/etc/po-sysv/<lang-code>/user.po
  The user may want to overide the translations.

/usr/share/locale/.../po-sysv-scripts.mo
  The result of the concatenation of both databases, to be used by the init
  scripts
/usr/share/locale/.../po-sysv.mo
  The messages of the binaries in that package, if needed.

/etc/sysv-i18n/sysv-i18n.bashrc 
  every bash-based init script should source it prepare the i18n of messages.
  
/etc/environment
  the definition of the LANGuage to use (this is standard, isn't it?).

BINARIES:
---------

/usr/sbin/update-po-sysv
  Rebuilds the mo files from concatenation of po files.
  Rebuild the user.po, so that user can edit them.
  
/usr/bin/po-sysv-install <init script>
  - finds out wheter the init script is perl- or bash- based
  - extract the strings from it (using standard tools)
  - create the /usr/lib/po-sysv/<lang-code>/<package>.po if needed

PO CONCATENATION POLICY:
------------------------
The strings are taken in that order (ie, last overides first).
 - Fully translated strings provided by po-sysv.
 - Fully translated strings provided by each package.
 - Fully translated strings provided by the user.
 
The user have the last word, but a given string is overrided only if the new
one is fully translated (fuzzy discarded), of course.


REMAINING PROBLEM:
------------------

/usr/bin/po-sysv-install should be integrated both with po-debconf, so that
each package can have only one DB for both kind of material, and with
debhelp so that this mecanism can be integrated seamlessly to debian.

Both binaries could be placed in two packages (po-sysv and po-sysv-dev) so
that the first one gets a chance to be of priority 'standard'.

Did I edit my /etc/environment or is the definition of LANG in it standard?

It is possible with this design to have string collision between packages.
But I think that this is rather unlikely.

This design also introduce a little mo bloat since all strings are
translated, even for the uninstalled packages. But who cares about 10k? [*]




Any comment?
Thanks, Mt.

[*] This argument can be answered by the fact that this situation is "of
course" only a hack for now. A proper solution involves a central server
containing all translations. With this, each package could contain 
uptodate translations without imposing an extra burden on maintainer
shoulder to handle l10n bugs like we do now for debconf. More on this later.

-- 
Though a program be but three lines long, someday it will have to be
maintained.
          -- The Tao of programming
	  

Attachment: pgpD1CpCc0ITO.pgp
Description: PGP signature


Reply to: