Hi, Denis
Thanks for your reply!
Yes, those information is very help for us.
Now I've written a Python script to deal with. Python is nice and quick.
Now we've upload POT & PO files to
launchpad.net:
https://translations.launchpad.net/aderp/trunk/
Also open a Translation Project in ADempiere.
http://www.adempiere.com/index.php/TranslationProject
Thank you very much for the nice tool -- po4a !
Peanut Blake
from ADempiere Community
--- On Mon, 7/19/10, Denis Barbier <bouzim(a)gmail.com> wrote:
From: Denis Barbier <bouzim(a)gmail.com>
Subject: Re: [Po4a-devel] Question about xml -> pot with po4a - from ADempiere ERP
community
To: "Peanut Blake" <peanutblake(a)yahoo.com>
Cc: po4a-devel(a)lists.alioth.debian.org
Date: Monday, July 19, 2010, 9:57 AM
On 2010/7/11 Peanut Blake wrote:
> Dear all,
>
> I am from ADempiere open source ERP. I am using po4a
for translation. Thank you very much for your good work!
> Now I meet trouble need your help.
>
> I have one xml file like:
>
> <row id="103" trl="Y">
> <value column="Name"
original="Minutes">Minutes</value>
> <value column="UOMSymbol" original="m "
pot-remark="Short form of 'Minutes'. Don't translate
@@ID-103@@.">m @@id-103@@</value>
> </row>
>
>
> I want to convert to POT file like:
>
> #. Content of: <id-103><Name>
> #, no-wrap
> msgid "Minutes"
> msgstr ""
>
> #. Content of: <id-103><UOMSymbol>
> #. Short form of 'Minutes'. Don't translate
@@ID-103@@.
> #, no-wrap
> msgid "m @@id-103@@"
> msgstr ""
Hi,
When po4a cuts text into translatable strings, it strips
comments from
paragraphs and inserts them into POT files. The XML
module is able to
extract XML comments, you can thus write:
<row id="103" trl="Y">
<value column="Name"
original="Minutes">Minutes</value>
<value column="UOMSymbol"
original="m "><!-- Short form of
'Minutes'. Don't translate @@ID-103@@. -->m
@@id-103@@</value>
</row>
But comments will be pushed back into translated XML
files.
> I have two questions:
>
> 1. How to put remark in xml to POT?
> for example, put
> "pot-remark="Short form of 'Minutes'. Don't translate
@@ID-103@@.""
> to
> "#. Short form of 'Minutes'. Don't translate
@@ID-103@@."
See above.
> 2. How to put id & column in xml to POT?
> for example, put
> id="103" column="Name"
> to
> #. Content of: <id-103><Name>
>
> Does po4a already provide such functions?
No.
But this looks strange to me, are you sure that this
information is
helpful for translators?
If you really want to work that way, you can either
a) write a dedicated po4a module to handle your DTD as you
want
b) or transform your original XML file into another XML
file with
XSLT so that translatable elements contain the desired XML
comments,
process this XML file through po4a, and converts back
translated XML
files into your original format.
Denis