esd-translators
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ESD-translators] state of the template manager -- kitchen


From: Stary, Tomas
Subject: Re: [ESD-translators] state of the template manager -- kitchen
Date: Mon, 28 Mar 2016 04:47:03 +0100

Hi Thérèse, hi all,

Thanks for the tip. I have now started using the po4a and it works
very good for me. I think it should be the preferred way of working for
anyone who is starting a new translation from scratch. I can also see
benefits of the system for existing translation, but it is up to you
if you decide to migrate to this system. If yes, I have described the
process here.


I have set the system to initiate the PO files and I have also
prepared Makescript to make the process more straight-forward. I have
committed them into git under the branch po4a (it could be merged to
master branch if you are happy with it).

I used po4a-gettextize to get the strings from the original HTML
files. For making the POT file it works well (it recognises repeated
strings automatically). The POT file can be simply copied to make a PO
file you decide to start a translation into a new language. Then the
PO files can be edited in text editors (I have used poedit[0],
and Emacs with po-mode[1]).


The situation is a bit more complicated with the languages that
already have the translation. The po4a-gettextize allows specifying
existing translations, but the version of the original has to be the
same as of the existing translation. Then it can extract the
translated strings into PO file directly.

I have tried it with a few translations in ESD, and non of them worked
on the first time. This was because there are mistakes which were
introduced due to editing the HTML files directly. But I think it
should not be too difficult to correct those mistakes (po4a-gettextize
gives very indicative error messages).

Once the translation has been extracted into a PO file, it can always
be updated for the new versions of the original files. This is done
using po4a-updatepo. Then the updated string can be translated in your
editor of PO files.


Finally, when the translation of PO files has been finished, we can
generate the translated HTML files using po4a-translate.


To make it more simple, I have prepared Makefile with all the required
commands for the creation of empty template POT files, extraction of
PO files with strings from an existing translation, and update of the
PO file for a new version. The generation of the translated HTML is
done by commands in Makefile.gen.

I have tried to put a lot of comments in the Makefiles, but perhaps
some bits might not be completely clear. I have found the manual
pages[2] of po4a quite helpful (especially the Graphical overview).

[0] http://poedit.net
[1] https://www.emacswiki.org/emacs/PoMode
[2] dev.man-online.org/man7/po4a/

Cheers,

Tomas


On Sun, Mar 27, 2016 at 11:41:34AM +0200, Thérèse Godefroy wrote:
> Hi Tomas, hi everyone,
> 
> Le 27/03/2016 10:15, Stary, Tomas a écrit :
> > Hi Thérèse, everyone,
> > 
> > I'm new in the translations, so I don't exactly know how does it work
> > in other projects.
> > 
> > The system you suggest seems quite convenient to me. If I understand
> > it correctly it can not only deal with the text repeated on multiple
> > pages, but also addresses the updates in the original page, which
> > would be great for the translations of the future updates of the
> > original text.
> > 
> > Is it an automatic procedure to generate the POT files for the
> > project? I have found that xgettext can be used to get the strings to
> > be translated from the programs source files, but xgettext does not
> > support html.
> 
> You are right, gettext can't extract strings from HTML. For that, you
> need PO4A [0] (a sort of wrapper around gettext tools, which only works
> on strict XHTML by the way). Sorry I wasn't specific enough in my
> previous post.
> 
> To create a POT file, you only need one command (e.g. po4a-gettextize
> without specifying a translation). This can be automated, of course, but
> I don't think we have new files often enough to make it worthwhile. On
> the other hand, it may be worthwhile to automate updating the POTs and
> the POs.
> 
> 
> > In my previous comment I was only the concerned about the text
> > repeated on multiple pages, which complicates the translation and
> > corrections of translated text.
> > 
> > In my naive view this could be solved simply by splitting the
> > documents into a number of template pages based on the criteria of
> > text repetitions. The template files could be then concatenated
> > together to generate the target page, such that the files with the
> > repeated text would be reused.
> 
> This is what Raffael is doing, I believe. It works fine too.
> 
> 
> > I would probably choose to do this task using Makefile script as it is
> > what I am most familiar with. However, regarding the splitting into
> > template pages, I can only think of a manual way of doing it.
> 
> If the splitting is done only once, that's OK. But our problem is that
> so far Zak has been providing the complete pages, not the pieces.  So,
> we have to find out which pieces have been modified, and update the
> corresponding translations. I make colored diffs to visualize the
> changes but in my experience it's not foolproof. POs are more reliable.
> 
> I'm not familiar with makefiles. Would you help with that?
> Getting closer and closer to GNUN [1]... ;-)
> 
> > Best,
> > 
> > Tomas
> 
> Best,
> Thérèse
> 
> [0] http://dev.man-online.org/man7/po4a/
> [1] https://www.gnu.org/software/trans-coord/manual/gnun/gnun.html
> 
> 
> _______________________________________________
> ESD-translators mailing list
> address@hidden
> http://lists.fsf.org/mailman/listinfo/esd-translators



reply via email to

[Prev in Thread] Current Thread [Next in Thread]