[Koha-cvs] CVS: koha/misc/translator tmpl_process3.pl,1.9,1.10

Ambrose C. LI acli at users.sourceforge.net
Mon Feb 23 21:04:07 CET 2004


Update of /cvsroot/koha/koha/misc/translator
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4469

Modified Files:
	tmpl_process3.pl 
Log Message:
Fixed bug in "create" action reported by Benedict


Index: tmpl_process3.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/tmpl_process3.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** tmpl_process3.pl	23 Feb 2004 05:51:30 -0000	1.9
--- tmpl_process3.pl	23 Feb 2004 20:04:04 -0000	1.10
***************
*** 213,216 ****
--- 213,218 ----
  }
  
+ my $xgettext = './xgettext.pl';	# actual text extractor script
+ 
  if ($action eq 'create')  {
      # updates the list. As the list is empty, every entry will be added
***************
*** 223,227 ****
      close $tmph;
      # Generate the specified po file ($str_file)
!     system ('xgettext.pl', '-s', '-f', $tmpfile, '-o', $str_file);
      unlink $tmpfile || warn_normal "$tmpfile: unlink failed: $!\n", undef;
  
--- 225,230 ----
      close $tmph;
      # Generate the specified po file ($str_file)
!     my $st = system ($xgettext, '-s', '-f', $tmpfile, '-o', $str_file);
!     warn_normal "Text extraction failed: $xgettext: $!\n", undef if $st != 0;
      unlink $tmpfile || warn_normal "$tmpfile: unlink failed: $!\n", undef;
  
***************
*** 236,246 ****
      close $tmph1;
      # Generate the temporary file that acts as <MODULE>/<LANG>.pot
!     system('./xgettext.pl', '-s', '-f', $tmpfile1, '-o', $tmpfile2,
  	    (defined $charset_in? ('-I', $charset_in): ()),
  	    (defined $charset_out? ('-O', $charset_out): ()));
!     # Merge the temporary "pot file" with the specified po file ($str_file)
!     # FIXME: msgmerge(1) is a Unix dependency
!     # FIXME: need to check the return value
!     system('msgmerge', '-U', '-s', $str_file, $tmpfile2);
      unlink $tmpfile1 || warn_normal "$tmpfile1: unlink failed: $!\n", undef;
      unlink $tmpfile2 || warn_normal "$tmpfile2: unlink failed: $!\n", undef;
--- 239,254 ----
      close $tmph1;
      # Generate the temporary file that acts as <MODULE>/<LANG>.pot
!     my $st = system($xgettext, '-s', '-f', $tmpfile1, '-o', $tmpfile2,
  	    (defined $charset_in? ('-I', $charset_in): ()),
  	    (defined $charset_out? ('-O', $charset_out): ()));
!     if ($st == 0) {
! 	# Merge the temporary "pot file" with the specified po file ($str_file)
! 	# FIXME: msgmerge(1) is a Unix dependency
! 	# FIXME: need to check the return value
! 	system('msgmerge', '-U', '-s', $str_file, $tmpfile2);
!     } else {
! 	warn_normal "Text extraction failed: $xgettext: $!\n", undef;
! 	warn_normal "Will not run msgmerge\n", undef;
!     }
      unlink $tmpfile1 || warn_normal "$tmpfile1: unlink failed: $!\n", undef;
      unlink $tmpfile2 || warn_normal "$tmpfile2: unlink failed: $!\n", undef;





More information about the Koha-cvs mailing list