[Po4a-commits] "po4a po4a,1.56,1.57 changelog,1.24,1.25"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Thu Jun 8 20:13:31 UTC 2006


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

Modified Files:
	po4a changelog 
Log Message:
Use the order of the files in the configuration file when we create the
POT and the translated files.


Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- po4a	7 Apr 2006 19:41:41 -0000	1.56
+++ po4a	8 Jun 2006 20:13:28 -0000	1.57
@@ -497,6 +497,7 @@
 my ($pot_filename) = "";
 my (%po_filename); # po_files: '$lang'=>'$path'
 my (%document); # '$master'=> {'format'=>'$format'; '$lang'=>'$path'; 'add_$lang'=>('$path','$path') }
+my $doc_count = 0;
 open CONFIG,"$config_file" or die wrap_msg(gettext("Can't open %s: %s"), $config_file, $!);
 my ($line,$nb) = ("",0);
 while (<CONFIG>) {
@@ -571,6 +572,8 @@
 		unless ($po4a_opts{"quiet"});
 	}
 	$document{$main}{'format'} = $1;
+	$document{$main}{'pos'} = $doc_count;
+	$doc_count++;
 	my %options;
 	%options = %{$document{$main}{'options'}}
 	  if defined %{$document{$main}{'options'}};
@@ -677,7 +680,9 @@
 
 my $potfile=Locale::Po4a::Po->new();
 if ($update_pot_file) {
-    foreach my $master (keys %document) {
+    foreach my $master (sort {
+                               $document{$a}{'pos'} <=> $document{$b}{'pos'}
+                             } keys %document) {
         my %file_opts = %po4a_opts;
         my $options = $document{$master}{"options"}{"global"};
         if (defined $options) {
@@ -842,7 +847,8 @@
     # update all translations
 
     foreach $lang (sort keys %po_filename) {
-	DOC: foreach my $master (sort keys %document) {
+	DOC: foreach my $master (sort { $document{$a}{'pos'} <=>
+	                                $document{$b}{'pos'} } keys %document) {
 	    next unless defined $document{$master}{$lang};
 
 	    my %file_opts = %po4a_opts;
@@ -909,15 +915,15 @@
 
 if ($po4a_opts{"split"}) {
     # We don't need the tmp big POs anymore
-    foreach $lang (sort keys %po_filename) {
+    foreach $lang (keys %po_filename) {
         unlink $po_filename{$lang};
     }
 }
 
 if ($po4a_opts{"rm-translations"}) {
     # Delete the translated documents
-    foreach $lang (sort keys %po_filename) {
-	foreach my $master (sort keys %document) {
+    foreach $lang (keys %po_filename) {
+	foreach my $master (keys %document) {
 	    unlink $document{$master}{$lang};
 	}
     }

Index: changelog
===================================================================
RCS file: /cvsroot/po4a/po4a/changelog,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- changelog	4 Jun 2006 12:57:43 -0000	1.24
+++ changelog	8 Jun 2006 20:13:28 -0000	1.25
@@ -47,6 +47,10 @@
   (html-build-upload.sh)
   * Update the script to build the html documentation. It now uses
     man2html. (This was necessary for the Polish pages)
+  (po4a)
+  * Use the same order as in the configuration file when creating the POT
+    and the translated files.
+    NOTE: this may modify the order of strings in your current POTs.
 
  -- Thu, 13 Apr 2006 11:08:43 +0200
 




More information about the Po4a-commits mailing list