head	1.6;
access;
symbols
	start:1.1.1.1
	salsaman:1.1.1;
locks; strict;
comment	@# @;


1.6
date	2007.06.29.17.18.19;	author gfinch;	state Exp;
branches;
next	1.5;

1.5
date	2006.01.28.20.58.19;	author gfinch;	state Exp;
branches;
next	1.4;

1.4
date	2005.07.28.15.40.22;	author gfinch;	state Exp;
branches;
next	1.3;

1.3
date	2005.07.26.18.42.35;	author gfinch;	state Exp;
branches;
next	1.2;

1.2
date	2004.11.30.00.34.42;	author gfinch;	state Exp;
branches;
next	1.1;

1.1
date	2004.09.19.04.07.13;	author gfinch;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2004.09.19.04.07.13;	author gfinch;	state Exp;
branches;
next	;


desc
@@


1.6
log
@update to gpl 3; other fixes
@
text
@#!/usr/bin/perl

# rfxgettest - Copyright G. Finch (salsaman) 2005
# Released under the GPL 3 or higher - see file COPYING or www.gnu.org for details





exit 0 unless ( $] >= 5.005_03 || $] <= 5.005 );

#undef $/;

use File::Basename;

$prefix=$ARGV[0];
shift (@@ARGV);
$outfile=$ARGV[0];
shift (@@ARGV);

while (!($ARGV[0] eq "")) {
    $file = $ARGV[0];
    $file =~ s/\.\.\///;
    $basename = basename($file);
    my $plugin_name=(&rc_read("name",$file))[0];
    my $description=(&rc_read("description",$file))[0];
    my @@params=&rc_read("params",$file);
    
    my $define=(&rc_read("define",$file))[0];
    my $delim=substr($define,0,1);
    if ($delim =~ /[\^\$\.\*\+\?\|\(\)\[\]\{\}\\]/) {
       $delim="\\".$delim;
    }

    $e = "msgid \"$plugin_name\"";
    $fileposition = "#: $prefix/share/lives/plugins/effects/rendered/$basename:0\n";
    unless (&exists($e)) {
      $e.="\nmsgstr \"\"\n";
      push @@{$entry{$e}}, $fileposition;              
    }

    @@temp=split(/$delim/, $description);
    $e = "msgid \"$temp[0]\"";
    unless (&exists($e)) {
	$e.="\nmsgstr \"\"\n";
	push @@{$entry{$e}}, $fileposition;              
    }

    $e = "msgid \"$temp[1]\"";
    unless (&exists($e)) {
	$e.="\nmsgstr \"\"\n";
	push @@{$entry{$e}}, $fileposition;              
    }

    foreach (@@params) {
	unless ($_ eq "") {
	    @@temp=split(/$delim/);
	    $e = "msgid \"$temp[1]\"";
	    unless (&exists($e)) {
		$e.="\nmsgstr \"\"\n";
		push @@{$entry{$e}}, $fileposition;              
	    }
	}
    }
    shift (@@ARGV);
}

foreach $e (sort keys %entry) {
    if ($e=~/layout/ or $e=~/hseparator/) {} else {
    print @@{$entry{$e}};
    print $e;
    print "\n";
    }
}



#////////////////////////////////////////////////////

sub exists {
# stop duplicate entries. TODO - add the msgid after the original entry
    my ($ex)=@@_;
    chomp($ex);
    my $exi=`grep '$ex' $outfile`;
    if ($exi eq "") {return 0;}
    return 1;
}


sub rc_read {
    # return an array value from our .rc file
    my ($key,$rcfile)=@@_;
    my $string="";
    my (@@result,$part);

    unless (defined(open IN,"$rcfile")) {
	print STDERR "  - Unable to read values from script file, $rcfile\n";
	exit 2;
    }
    $part=0;
    while (<IN>) {
	if ($_=~ /(.*)(<\/$key>)/) {
	    return @@result;
	}
	if ($part==1||$_=~ /(<$key>)(.*)/) {
	    if ($part==1) {
		chomp($_);
		$string=$_;
		@@result=(@@result,$string);
	    }
	    else {
		$part=1;
	    }
	}
    }
    return @@result;
}
@


1.5
log
@RFX spec updates
@
text
@d4 1
a4 1
# Released under the GPL 2.0 - see file COPYING or www.gnu.org for details
@


1.4
log
@update to 0.9.5-pre4
@
text
@d3 4
a6 2
# a lame attempt at xgettext for perl
# no line numbers, yet
a7 3
# 5.005_02 in particular seems to have a BIG BUG
# resulting in an endless loop and a memory leak in the 
# regex machinery :(
a8 1
## updated by salsaman for LiVES
d12 1
a12 1
undef $/;
d21 2
a22 3
while (<>) {
    print STDERR ".";
    $file = $ARGV;
d25 3
d29 35
a63 22
    while (/(?:N|print) \(?"((?:[^"\\]+|\\.)*)"\)?/sg) {
       my $s = $1;
       if($s=~/\|/){
         @@temp=split(/\|/, $s);
       } else {
         $s =~ s/\\n//;
         @@temp[0]=$s;
       } if ($temp[0]) {
         $e = "msgid \"$temp[0]\"";
         $fileposition = "#: $prefix/share/lives/plugins/effects/rendered/$basename:0\n";
         unless (&exists($e)) {
          $e.="\nmsgstr \"\"\n";
          push @@{$entry{$e}}, $fileposition;              
         }
       }
       if($temp[1] and not $temp[1]=~/[0-9]/) {
         $e = "msgid \"$temp[1]\"";
         unless (&exists($e)) {
          $e.="\nmsgstr \"\"\n";
          push @@{$entry{$e}}, $fileposition;              
        }
      }
d65 1
d67 1
a74 1
print STDERR " done.\n";
d76 3
a78 1
#########################################################
d88 30
@


1.3
log
@i18n fixes
@
text
@d24 1
d60 1
d62 1
@


1.2
log
@update i18n
@
text
@d20 2
d27 1
a27 1

d31 1
a31 1
       @@temp=split(/\|/, $s);
d33 2
a34 2
       $s =~ s/\\n//;
       @@temp[0]=$s;
d36 6
a41 4
       $e = "msgid \"$temp[0]\"\n";
       $e .= "msgstr \"\"\n";
       $fileposition = "#: $prefix/share/lives/plugins/effects/rendered/$basename:0\n";
       push @@{$entry{$e}}, $fileposition;
d44 6
a49 5
       $e = "msgid \"$temp[1]\"\n";
       $e .= "msgstr \"\"\n";
       push @@{$entry{$e}}, $fileposition;              
       }
       
a51 1

d61 8
@


1.1
log
@Initial revision
@
text
@d9 3
d16 4
d24 1
d36 1
a36 1
       $fileposition = "#: $file:0\n";
@


1.1.1.1
log
@Initial Import
@
text
@@
