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

Consistent files ?



Sorry if I'm repeating myself (I know I posted about this in the past).
The 'term_intersect.pl' script [1] is really something every project
should be using on a daily/weekly/monthly basis as it will compare
all your files against each other (and if you like against other
projects') to match similar terms in hopes of seeing how those terms
where translated.

So in short (and I'm a fan of examples too), say you are working on
the 'debian' .po files and you want to see if you have any inconsistencies
in your files (ie. did I translate "icon" similarly in all my files ?).
You can simply do this on your local machine,

 $ cd my_cvs_copy/translate/debian
 $ term_intersect.pl -dir1 . -dir2 /tmp -same -max 5 -quiet
 -or-
 $ term_intersect.pl -dir1 my_cvs_copy/translate/debian
                     -dir2 /tmp
                     -same
                     -max 5
                     -quiet

this will dump out a 'common_terms.po' output file.  The following
command-lines arguments were used,

 + dir1  - specify the directory I want to compare all of the .po from
 + dir2  - specify the directory I want to compare against
           In this instance its a don't care and thus I simply said use
           /tmp knowing there are no .po files there (this will prompt
           me with a warning, press ENTER to continue when that happens)
 + same  - compare against files in the same directory as well (ie. make
           sure things within dir1 are compared against each other).
 + max 5 - compare terms that don't exceed 5 terms
 + quiet - don't print all the verbose dir/file notes (try it without)

As you can see, the above command will compare all that is the debian
dir and dump out the results.  This is a fast sanity checker that people
should run often to be consistent against their own projects.

The qac_terms_#.po files were generated using this method for those that
are curious.  I'll leave it to the QAC folk to talk about those files and
their plans for 'em.

BTW: As is the norm with all my scripts, running the script with NO
     command-line options will result in a mini-help.  A '-help' will
     give you a one-liner of what each options does.

[1] http://cvs.arabeyes.org/viewcvs/scripts/translate/term_intersect.pl

Salam & Enjoy.

 - Nadim