update.pl emulation script

This commit is contained in:
acli 2005-01-11 09:33:19 +00:00
parent 3cde79b6a6
commit edaad47652
1 changed files with 27 additions and 0 deletions

27
misc/translator/po/update.pl Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/perl
# Convenience script to update a po file
# This emulates the GNOME "update.pl" script
use strict;
use integer;
my $lang = $ARGV[0];
die "Usage: $0 LANG\n" unless defined $lang && $lang =~ /\S/;
my $chdir_needed_p = 1 unless -d('po'); # guess if pwd is translator/ or po/
for my $spec (['css', 'opac'], ['default', 'intranet']) {
my($theme, $module) = @$spec;
my $pid = fork;
die "fork: $!\n" unless defined $pid;
if (!$pid) {
if ($chdir_needed_p) {
chdir('..') || die "..: cd: $!\n";
}
exec('./tmpl_process3.pl', 'update', '-i', "../../koha-tmpl/$module-tmpl/$theme/en/", '-s', "po/${theme}_${module}_$lang.po", '-r');
die "tmpl_process3.pl: exec: $!\n";
}
wait;
}