Gnus development mailing list
 help / color / mirror / Atom feed
From: pinard@progiciels-bpi.ca (François Pinard)
Cc: ding@ifi.uio.no, Ulrich Drepper <drepper@gnu.ai.mit.edu>
Subject: Re: Internationalization
Date: 11 Nov 1996 16:35:44 -0500	[thread overview]
Message-ID: <oqsp6g71sf.fsf@icule.progiciels-bpi.ca> (raw)
In-Reply-To: Lars Magne Ingebrigtsen's message of 1996-11-10 16:31:18+01:00

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

| [...] I suddenly got the urge to internationalize Gnus.  [...]  If such
| a thing was to be done, how should one do it?  Has there been done work
| in this area for other Elisp packages?

Let's keep tight contact on this one, Lars.  I'm deeply interested and
involved.  And since Red Gnus is a sizeable package, it would surely throw,
as an example to all, an heavy pole in the good direction.  I compulsively
want to convince you of the good direction to take! :-)


* Step 1.  Get file:

	ftp://alpha.gnu.ai.mit.edu/gnu/gettext-0.10.24.tar.gz

and install it on your site.  Follow this recipe:

	./configure --with-included-gettext
	make check
	make install

becoming root for the install if necessary.  If you do not have root
privileges, rather use:

	./configure --with-included-gettext --prefix=$HOME/local
	make check
	make install

or such, and ensure you have ~/local/bin on your $PATH.


* Step 2.  Get a recent PO mode for Emacs, from:

	ftp://alpha.gnu.ai.mit.edu/gnu/po/po-mode.el

and override the one which was installed by gettext.  Ensure you have
this new one on your load-path.


* Step 3.  Use this installed PO mode to *mark* all translatable strings
in Red Gnus.  The recipe is more or less like this:

	etags *.el

	M-x visit RET RET
	C-x f rgnus.po RET

And then, just loop on the following two commands:

	,	find next candidate for a translatable string
	M-,	(conditional) mark it for translation if it makes sense

until you marked all strings.  You may decide that `message' will be
a translating function, in which case tell PO mode by using M-. to add
`message' to the list of known marking functions, so the command `,' will
skip them.  My choice would be to not consider `message' as translating,
while Richard Stallman would see it as translating.  Use _ as the general
marking function (the default with `M-,') and N_ for those translatable
strings for which translation should be delayed at run time.  The command
`M-.' without prefix allows using other marks with completion.


* Step 4.  Alter your files so they logically all include the
following Emacs LISP text near their beginning:

    (eval-and-compile
      (or (fboundp 'gettext) (defsubst gettext (string) string)))
    (defsubst _ (string) (gettext string))
    (defsubst N_ (string) string)

Red Gnus should now work exactly as before, and you may distribute the
resulting work right away, continuing from now on to mark translatable
strings as you go in your Gnus work.  As things would stand at this point,
you have zero overhead for English.


* Step 5.  Recreate a better gnus.pot file through the following command:

	xgettext -drgnus -k_ -kN_ -kmessage *.el

and send it to me (or to gnu-translation@gnu.ai.mit.edu, it's the same
address) the resulting gnus.pot file under a name like rgnus-0.63.pot.
I'll then submit it to all translation teams for getting the translation
of all messages done.  When I get translated PO files, I check them for
formal correctness and, if OK, you semi-automatically get a copy.

Oops!  This is not right.  xgettext has not been changed yet to handle
Emacs LISP sources.  OK, for now, just stick to the rgnus.po file which
was generated while you were marking strings in step 3.  I'll push so
xgettext gets adapted sooner, or I'll do it myself if it slows us down.


* Step 6.  Either wait until someone develop a patch for GNU Emacs so it
includes gettext as a new primitive, or else, reimplement it in Emacs LISP.
The gettext primitive is not ready yet, but I believe it has to be done in
any case, we cannot really escape it, even if it may take a while.  On the
other hand, GNU gettext is quite featureful, and it will be relatively
difficult to reimplement it all in Emacs LISP without forgetting features.

Nevertheless, an Emacs LISP implementation of gettext would be very useful
as an interim measure, even if partial, before it gets integrated in Emacs
for real.  If you do so, please keep in close contact with me, as it would
be a wonderful thing for the GNU translation project.  A few translation
teams are starving to dive into the translation of Emacs LISP packages.
Just make very sure you stick to the GNU .mo format, which is described
somewhere in the GNU gettext manual.  The format allows for sequential
search, binary search or even a double-hashing search on the compiled PO
file, but if you use hashing, you have to precisely stick to the algorithm
implemented by gettext.  In any case, Ulrich Drepper and I have given a
great deal of thought to all of this.  Let's keep in touch, please.



So far, experience taught us that the most tedious part of all this
is producing the translation themselves.  Each national team works at
its own pace.  Some are fast and aggressive, others are almost dormant.
That's why I suggest that you proceed to the marking step fairly soon,
so translations may be going while xgettext is being adapted, and gettext
either interfaced from Emacs or reimplemented in Emacs LISP.

-- 
François Pinard         ``Vivement GNU!''        pinard@iro.umontreal.ca
Support Programming Freedom, join our League!  Ask lpf@lpf.org for info!


  parent reply	other threads:[~1996-11-11 21:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-10 15:31 Internationalization Lars Magne Ingebrigtsen
1996-11-10 17:05 ` Internationalization Andy Eskilsson
1996-11-10 17:51   ` Internationalization Kai Grossjohann
1996-11-10 19:02 ` Internationalization David Kågedal
1996-11-11  6:27   ` Internationalization Steinar Bang
1996-11-11 15:20   ` Internationalization Lars Magne Ingebrigtsen
1996-11-11  0:25 ` Internationalization visigoth
1996-11-11 15:25   ` Internationalization Lars Magne Ingebrigtsen
1996-11-11 22:19     ` Internationalization David Moore
1996-11-12 22:45       ` Internationalization Lars Magne Ingebrigtsen
1996-11-11 12:14 ` Internationalization Robert Bihlmeyer
1996-11-11 12:50 ` Internationalization Per Abrahamsen
1996-11-11 15:14   ` Internationalization William Perry
1996-11-11 15:24     ` Internationalization Per Abrahamsen
1996-11-11 22:01   ` Internationalization François Pinard
1996-11-12 10:58     ` Internationalization Per Abrahamsen
1996-11-12 15:59       ` Internationalization François Pinard
1996-11-12 16:57         ` Internationalization Ulrich Drepper
     [not found]           ` <rjwwvqgxz1.fsf@babbage.dina.kvl.dk>
     [not found]             ` <x7ralyf6rx.fsf@myware.rz.uni-karlsruhe.de>
     [not found]               ` <rj3eydhwx5.fsf@babbage.dina.kvl.dk>
1996-11-14 12:28                 ` Internationalization François Pinard
1996-11-12 22:07         ` Internationalization Lars Magne Ingebrigtsen
1996-11-13 19:19           ` Internationalization Jan Vroonhof
1996-11-13 22:05             ` Internationalization William Perry
1996-11-14 19:27               ` Internationalization Ralph Schleicher
1996-11-12 20:12   ` Internationalization Jan Vroonhof
1996-11-11 21:35 ` François Pinard [this message]
1996-11-12  1:57   ` Internationalization Ulrich Drepper
1996-11-12 19:56   ` Internationalization Lars Magne Ingebrigtsen
1996-11-12 22:40     ` Internationalization Ulrich Drepper
2002-10-20 21:21     ` Internationalization François Pinard
1996-11-17 22:59 ` Internationalization Ralph Schleicher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=oqsp6g71sf.fsf@icule.progiciels-bpi.ca \
    --to=pinard@progiciels-bpi.ca \
    --cc=ding@ifi.uio.no \
    --cc=drepper@gnu.ai.mit.edu \
    --cc=pinard@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).