Re: Diffing POT files
- From: Chris Leonard <cjlhomeaddress gmail com>
- To: Ask Hjorth Larsen <asklarsen gmail com>
- Cc: gnome-i18n <gnome-i18n gnome org>
- Subject: Re: Diffing POT files
- Date: Thu, 22 Mar 2012 12:48:48 -0400
On Thu, Mar 22, 2012 at 11:36 AM, Ask Hjorth Larsen <asklarsen gmail com> wrote:
> Not quite, but pyg3t contains a tool called gtcompare which will give
> a qualitative overview of the differences between two files (useful
> e.g. if there are conflicting changes and you want to see roughly how
> bad things are)
>
> For example here's some output comparing before and after a recent
> translation of mine:
>
> ----------------------------------
> askhl@mime:~/Downloads$ gtcompare old/gnome-disk-utility.master.da.po
> gnome-disk-utility.master.da.po
> Each file contains 425 msgids, and they are all identical.
>
> 0 messages remain untranslated.
> 0 untranslated messages changed to fuzzy.
> 5 untranslated messages changed to translated.
> 0 fuzzy messages changed to untranslated.
> 0 messages remain fuzzy.
> 28 fuzzy messages changed to translated.
> 0 translated messages changed to untranslated.
> 0 translated messages changed to fuzzy.
> 392 messages remain translated.
>
> There are no conflicts among translated messages.
> -----------------------------------
>
> Right now the script has no options. Maybe we should implement an
> option to print the actual messages in specified categories. This
> would be exceedingly easy I think. What would be a good syntax?
> Something like:
>
> gtcompare --fuzzy2translated --untranslated2fuzzy file1 file2
>
> (a bit long)
>
> Or:
> gtcompare --print f2t,u2f file1 file2
>
> (rather ugly)
>
> Any ideas?
Well, you have 9 possible output categories, so I suppose defining
which you want is going to be useful.
In a simpler situation (three possible categories) the Translate
Toolkit posplit command has a very simple syntax
http://translate.sourceforge.net/wiki/toolkit/posplit
posplit file1.po
and the output is
file1-translated.po
file1-untranslated.po
file1-fuzzy.po
(be warned that the posplit script can be destructive of the input
file, so perform it on a copy of your precious input file). I filed a
bug on this and I think it is patched in the dev version, but I'm not
sure if it is released.
In the posplit case, you just get the three output files no matter
which of them you are really interested in, but it is no great burden
to discard the ones you do not want. The acceptability of that
default might be less clear for gtcompare which would produce 9 output
files (if modified to give you the files and not just the stats). On
the other hand, if this "verbose" output is only invoked with an
option flag, then you know what you are getting yourself in for when
you run it with the option flag and that you could/would get 9 output
files, so it would not violate user expectations.
Possibly something simple like:
gtcompare --verbose file1 file2
(result you get the 9 output files)
I've installed PyG3T and I will play with it, if only because I love
playing with widget collections to see figure out what workflows I can
"pipeline" with a script, but I'm not sure thsi will get me where I
want.
gtcompare seems focused on looking at the msgstr (translations in the
PO) and not the msgid (originals of the untranslated POT), but I will
see what I can do with it anyway.
cjl
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]