Translation, gettext and po


Subject: Translation, gettext and po
From: Tim Allen (rita_tim@tpg.com.au)
Date: Tue Oct 31 2000 - 21:03:25 CST


Faced with some more work to get the id-ID translation up to date, I've written
a couple of Perl scripts to make life easier.

The attached script abi2po.pl converts the strings in AbiWord for one language
to a form that resembles a gettext po file, explicitly labelling any missing
strings as MISSING. A po file is _much_ easier to maintain than the current
AbiWord strings files, since you have all the text for English and your target
language in the one place, together.

The other script, po2abi.pl does the reverse; it converts the po-ish file back
to an AbiWord strings file. I've tested this on id-ID, and the round trip
works
well. Haven't tested it on any other languages, so no idea whether there are
any problems for languages that make more demanding use of character sets or
whatever. Let me know :-).

The format of the pseudo-po file contains a comment that provides the link
with
the AbiWord string id. Don't edit the comment if you want the reverse process
to work.

I found it too hard (ie I was lazy :)) to properly parse the credits, and
preserve them in a round trip, so I copped out and supported a file of the
form
<lang>.credits which po2abi.pl reads in and puts in the file (with a bland
placeholder if the file is missing). I've attached my sample id-ID.credits
just
to make sure the idea is clear.

This does not (yet) support the menu and toolbar text.

The primary motivation for this is to make translating easier. A secondary
consideration is that at some future stage we may want to convert AbiWord to
using gettext for i18n. This should make that job much easier.

The attached po.doc file gives more details about how to use the scripts.

I'm not sure if this should be part of the main distribution, and if so, where
it should go; I shall leave that to others to decide. I think that most
translators will find it useful, so I definitely think it should be made
available generally. I relied heavily on Owen Stenseth's dumpstrings.pl script
as a starting point.

Tim

-- 
-----------------------------------------------------------
Tim Allen             http://www4.tpg.com.au/users/rita_tim/
tim@proximity.com.au  rita_tim@tpg.com.au







This archive was generated by hypermail 2b25 : Tue Oct 31 2000 - 21:04:50 CST