[Po4a-commits] "po4a changelog,1.75,1.76 po4a,1.58,1.59"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Wed Aug 16 21:57:25 UTC 2006


Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv25689

Modified Files:
	changelog po4a 
Log Message:
Only read a PO once. This provides a good speed improvement for projects
with many documents.


Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- po4a	15 Jul 2006 22:00:37 -0000	1.58
+++ po4a	16 Aug 2006 21:57:22 -0000	1.59
@@ -847,6 +847,10 @@
     # update all translations
 
     foreach $lang (sort keys %po_filename) {
+	# Read the $lang PO once
+	my $po = Locale::Po4a::Po->new();
+	$po->read($po_filename{$lang});
+
 	DOC: foreach my $master (sort { $document{$a}{'pos'} <=>
 	                                $document{$b}{'pos'} } keys %document) {
 	    next unless defined $document{$master}{$lang};
@@ -868,13 +872,16 @@
 	    my $doc=Locale::Po4a::Chooser::new($document{$master}{'format'},
 		                               %{$file_opts{"options"}});
 
-	    my (@file_in_name, at po_in_name);
+	    my @file_in_name;
 	    push @file_in_name, $master;
-	    push @po_in_name, $po_filename{$lang};
+
+	    # Reuse the already parsed PO, do not use the po_in_name
+            # option of process.
+	    $doc->{TT}{po_in} = $po;
+	    $doc->{TT}{po_in}->stats_clear();
 
 	    $doc->process('file_in_name'  => \@file_in_name,
 	                  'file_out_name' => $document{$master}{$lang},
-	                  'po_in_name'    => \@po_in_name,
 	                  'file_in_charset'  => $file_opts{"mastchar"},
 	                  'file_out_charset' => $file_opts{"locchar"},
 	                  'addendum_charset' => $file_opts{"addchar"});

Index: changelog
===================================================================
RCS file: /cvsroot/po4a/po4a/changelog,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- changelog	16 Aug 2006 20:16:16 -0000	1.75
+++ changelog	16 Aug 2006 21:57:22 -0000	1.76
@@ -18,6 +18,8 @@
 	* t/data-23/fonts: Add a test for .I " "
 	* lib/Locale/Po4a/Man.pm, t/data-23/fonts.en, t/data-23/fonts.pot:
 	Fix the above tests.
+	* po4a: Only read a PO once. It was read for every master file of
+	the configuration file.
 
 2006-08-07  Nicolas François  <nicolas.francois at centraliens.net>
 




More information about the Po4a-commits mailing list