[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/misc/translator/po update.pl,1.1.2.2,1.1.2.3
From: |
Ambrose C. LI |
Subject: |
[Koha-cvs] CVS: koha/misc/translator/po update.pl,1.1.2.2,1.1.2.3 |
Date: |
Tue, 11 Jan 2005 01:51:02 -0800 |
Update of /cvsroot/koha/koha/misc/translator/po
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15036
Modified Files:
Tag: rel_2_2
update.pl
Log Message:
More comments in the code to explain what it does
and check the language code command line argument a bit more carefully
Index: update.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/po/Attic/update.pl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** update.pl 11 Jan 2005 09:40:38 -0000 1.1.2.2
--- update.pl 11 Jan 2005 09:50:58 -0000 1.1.2.3
***************
*** 8,24 ****
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";
}
--- 8,39 ----
my $lang = $ARGV[0];
! die "Usage: $0 LANG\n" unless $lang =~ /^[a-z]{2}(?:_[A-Z]{2})?$/;
! # Remember whether we see the "po" directory; this is used later to guess
! # whether the current directory is translator/po or translator.
! my $chdir_needed_p = 1 unless -d('po');
! # Go through the theme/module combinations we need to update. There can be
! # more than two; e.g., if we want ['default', 'opac'] too we can put it in
! for my $spec (
! ['css', 'opac' ],
! ['default', 'intranet']
! ) {
my($theme, $module) = @$spec;
my $pid = fork;
die "fork: $!\n" unless defined $pid;
if (!$pid) {
+
+ # If current directory is translator/po instead of translator,
+ # then go back to the parent
if ($chdir_needed_p) {
chdir('..') || die "..: cd: $!\n";
}
!
! # Now call tmpl_process3.pl to do the real work
! 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";
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/misc/translator/po update.pl,1.1.2.2,1.1.2.3,
Ambrose C. LI <=