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

Re: web site stats updated



Martin Quinson wrote :

> That reminds me that I've on my machine a modified and not commited
> version of check_trans.pl which can see which part of the translated
> text have changed.
> 
> (It is not commited because it depends on a .pm file writen by
> Christian Couder, which is not installed on any machine beside my
> and christian's)
> 
> To make it work, you give it the original old file, the translated
> file, and the diff to apply to the original. Then, it count the html
> tags, and give you where the translation have to be modified.

Hi Martin and everybody,

Yes, in fact the script works like this :

First it compares the tags in the outdated translated file and in the
original old file from which it was translated. In theory the tags
should be exactly the same in both files. (So the script could be also
used as a checker to verify that the translation did not changed
tags.)

For some reasons sometimes all tags don't match. (For example the
translators can sometimes add notes with tags in them.) If this is the
case then the script try again to match tags with a restrained set of
tags (mainly <p>, <h1>, <h2> and a few other if I remember correctly).

If the tags match, the script while matching tags also create an index
of tags with the line numbers in both files where the tags are.

Then the script parses the diff between the new original file and the
old original file (on which the translation is based), to know on
which lines the original file changed. From the line numbers the
script finds the nearest tags above and below the changes, and this
way it tells which parts in the translated file should be changed for
each change in the original file. (All this is using the tag index.)

(Martin, you still owe me a beer for this. :-)

> That's really a nice feature ! It's used on a daily basis here on a
> cron table to send mails to the french translators, so you can
> assume it's pretty tested.

Yes, it doesn't always match tags, but when it doesn't it prints which
tags didn't match.

Bye,
Christian.




Reply to: