doc-i18n-tool (fwd)

Simos Xenitellis simos74 at gmx.net
Thu Oct 11 01:32:09 EEST 2001


Ίσως το παρακάτω εργαλείο σας φανεί χρήσιμο.
Δεν κατάφερα να το μεταγλωττίσω λόγω του ότι θέλει libxml2.
Μετατρέπει τα αρχεία μεταφράσεων μεταξύ po και xml.
Πιστεύω ότι μπορεί να χρησιμοποιηθεί με το λεξικό του Δημήτρη κατά την
αυτόματη μετάφραση αρχείων po.

σίμος


---------- Forwarded message ----------
Date: 10 Oct 2001 14:38:02 -0400
From: Jonathan Blandford <jrb at redhat.com>
To: Daniel Veillard <veillard at redhat.com>, Darin Adler <darin at bentspoon.com>,
     gnome-doc-list at gnome.org, gnome-i18n at gnome.org
Subject: doc-i18n-tool

Hi,

Daniel and I managed to whip up a small tool for generating a pot file
to and from a sgml/xml file.  It seems to work pretty well for a quick
hack, and I don't know how complicated this needs to be.  It needs a
little cleaning up ('--help' doesn't work and there are other argument
oddities) and a man page as well, but it might be worth starting to work
with it.

Should we try to put this in intl-tools?  It's Darin's call of course,
but I think that if it manages to increase the number of translated docs
then it's a good thing.  As a non-translator, I'd appreciate it if those
actually doing the translating could provide feedback.

HOW TO USE IT:
==============

I'm including the source file and a simple Makefile.  You need
libxml2-devel installed in order to build it, but it should just work on
most modern systems.

To create a pot file, you need to do:

% doc-i18n-tool --output-pot-file file.xml > file.pot

You can add the --sgml flag if want to parse an sgml file.
Additionally, I think we really want to do something like:

% xmllint --noblanks file.xml | doc-i18n-tool --output-pot-file --filename file.xml -- - > file.pot

This will minimize chance that random white-space changes will effect
the doc.  It doesn't really matter, so long as we're consistent.

Once you have the pot file, we can translate it, and convert it back by
doing (in Norwegian in this case -- use your own language):

% msgfmt translatedfile.pot -o file.mo
% mkdir -p no/LC_MESSAGES
% cp file.mo no/LC_MESSAGES

Finally, convert it back to SGML by doing:

% LANG=no_NO doc-i18n-tool --package file --localedir `pwd` file.xml | xmllint --format > file-no.xml

Note: If you originally created the pot file using 'xmllint --noblanks',
you need to do the same here.

OTHER ISSUES:
=============

It'd be nice to move to docbook xml ASAP, as we can use the xmllint
tool, then.  Daniel, can we add a --sgml style arg to xmllint to handle
docbook-sgml?  There's no reason we'd want to ever install these po
files, as this should be done in CVS by the translator.

Another problem is that we are over-sensitive.  Ie, if we run into
passages like: <para>... mail to <email>accounts at gnome.org</email>
with...</para>, we probably don't want to do the <email> section
separately.  It think we'll need to add some docbook specific hacks to
catch 'leaf' nodes like this to condense into the doc.

Comment?

Thanks,
-Jonathan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: doc-i18n-tool.c
Type: application/octet-stream
Size: 5847 bytes
Desc: doc-i18n-tool.c
URL: <http://lists.hellug.gr/pipermail/i18ngr/attachments/20011010/00ff61e2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 161 bytes
Desc: Makefile
URL: <http://lists.hellug.gr/pipermail/i18ngr/attachments/20011010/00ff61e2/attachment-0001.obj>


More information about the I18ngr mailing list