Package: po4a
Version: 0.34-2
Severity: wishlist

I think this should be inclided as an example helper script or even integrated
into additional --previous functionality.  wdiff makes good sense in many
cases! 

On Mon, Feb 09, 2009 at 11:24:29PM +0100, Javier Fernández-Sanguino Peña wrote 
on debian-...@l.d.o:

For those translators that find it difficult to find the changes in a given
msgid the attached perl snippet might be useful.

How to use:

If you run po4a using --previous (the new Makefile will do this if your po4a
version supports it) you will get these type of content in the PO file:

#| msgid ""
#| "Any package installation operation must be run with superuser privileges,
"
#| "so either login as <literal>root</literal> or use <command>su</command> "
#| "or <command>sudo</command> to gain the necessary access rights."
msgid ""
"Any package installation operation must be run with superuser privileges, so "
"either log in as <literal>root</literal> or use <command>su</command> or "
"<command>sudo</command> to gain the necessary access rights."

Pasting this to the standard input of the attached perl script will reveal
the difference (using 'wdiff', which you need to have installed):

======================================================================
 [-login-] {+log in+}
======================================================================

Sometimes those are difficult to spot to the untrained eye :)

Regards

Javier


----
#!/usr/bin/perl -w
# Quick and dirty script to compare two msgids (when using po4a with
# --previous) with wdiff to find the differences between them

my $file1="diff1";
my $file2="diff2";

open (my $DIFF1, ">$file1") || die ("Cannot open $file1: $!");
open (my $DIFF2, ">$file2") || die ("Cannot open $file2: $!");

my $fileh="";
while ($line = <STDIN>) {
    $fileh="";
    chomp $line;
    $file = $DIFF1 if ( $line =~ /^\#\|/ ) ;
    $file = $DIFF2 if ( $line =~ /^"/ ) ;
    $line =~ s/^\#\| //;
    $line =~ s/^"//;
    $line =~ s/"$//;
    print $file $line if $line ne 'msgid "';
}

close $DIFF1; close $DIFF2;

exec ("wdiff -3 $file1 $file2 | less");

exit;


----



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to