[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: msmerge for a directory from the Catalog manager?
From:       Michel Loos <loos () qt1 ! iq ! usp ! br>
Date:       2003-02-24 17:16:34
[Download RAW message or body]

Em Seg, 2003-02-24 ās 13:17, Stanislav Visnovsky escreveu:
> On Sat, 22 Feb 2003, Pablo de Vicente wrote:
> 
> > Hello,
> > 
> >   Is there a way to define a user command which makes msmerge for all PO files 
> > of a directory in KBabel Catalog Manager?. I have done this for individual 
> > files (it is described in the documentation) but would like to do it for a 
> > whole directory.
> 
> It's not possible ATM :-(
> 
> Stanislav

Well I am doing just that.
See attached script which keeps my po base uptodate.


-- 
Michel Loos <loos@qt1.iq.usp.br>

["merger.pl" (merger.pl)]

#!/usr/bin/perl 

use File::Find;
use File::Basename;

chomp (my $localdir=`pwd`);
my @dir=('../../templates');
find(\&wanted,@dir);

sub wanted
{
   my $filename = $File::Find::name;
   $filename =~ s/\.\.\/\.\.\/templates\///;
   if (m/pot$/) 
   {
      $filename =~ s/t$//;
      my $longfilename = $localdir."/".$filename;
      if (-e $longfilename)
      {
	 $todo = "msgmerge -o $filename $filename $File::Find::name\n";
      } else {
         ($base,$path) = fileparse($longfilename);
	 if (-d $path)
	 {}
	 else
	 { print " directory does not exist \n";
	  mkdir $path, 0755 or warn "could not make dir $path"}

         $todo = "cp $File::Find::name $filename\n";
      }
      print $todo;
   }
}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic