[ANN] Translation support added to "press-release" tool

Tommy Reynolds Tommy.Reynolds at MegaCoder.com
Fri Feb 10 18:48:28 UTC 2006


Hello, All!

Thanks to a hint from Alan Cox and others, I have seen the error of
my ways, at least regarding .pot files, .po files, and translation in
general.

I've reworked the "press-release" module in hopes that it now
parallels the accepted practice for translating Fedora documents.
How is works is like this:

1) An XML document is prepared in the "${LANG}" locale, for
   example "en".  There is a "foo-en.xml" file that exists.

2) A Norwegian translator wants to make a copy.  To do this, the 
   locale string "no" is added to the "${OTHERS}" definition in the
   press-release "Makefile":

   LANG=en
   OTHERS=no

3) Watch closely here, I'm not leaving *any* steps out:

   $ make

4) This will generate the .pot translation template file, the raw 
   "no.po" file holding the translations. generate the "foo-no.xml"
   file using the translated strings, and render the new "foo-no.pdf"
   document.

Now that the document generation process is complete, the translator
can begin adding translated strings to the "no.po" file and repeating
Step #3 until happiness ensues.

Meanwhile, if the base document "foo-en.xml" gets modified, the
translator can just do:

   $ cvs update
   $ make no.po

and have any new changed merged into the existing "no.po" file.

There are some convenience targets produced by the make-fu that might
not be obvious:

   $ make po-no        <== Produces a new "foo.pot" file and merges
   			   into "po.no" if needed.
   $ make xml-no       <== Merges "foo-en.xml" and "no.xml" into
			   "foo-no.xml".
   $ make pdf-no       <== Renders press release in Norwegian PDF
   $ make txt-no       <== Renders press release in Norwegian text

Notice that all "foo-XXX.xml" files except for "foo-${LANG}.xml" are
generated files and are thus temporary.  Translators NEVER edit an
XML file directly, only .po files.

Let me know if this is usable.

Cheers




More information about the fedora-docs-list mailing list