[Po4a-commits] "po4a po4a,1.35,1.36"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Wed Nov 16 19:49:17 UTC 2005


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

Modified Files:
	po4a 
Log Message:
reindent.


Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- po4a	16 Nov 2005 19:27:15 -0000	1.35
+++ po4a	16 Nov 2005 19:49:14 -0000	1.36
@@ -283,35 +283,35 @@
     my @options = ();
 
     my %opts = (
-        "help"      => 0,
-        "type"      => "",
-        "debug"     => 0,
-        "verbose"   => 0,
-        "quiet"     => 0,
-        "split"     => 0,
+        "help"            => 0,
+        "type"            => "",
+        "debug"           => 0,
+        "verbose"         => 0,
+        "quiet"           => 0,
+        "split"           => 0,
         "no-translations" => 0,
-        "threshold" => 80,
-        "mastchar"  => "",
-        "locchar"   => "",
-        "addchar"   => "",
-        "options"   => {"verbose" => 0, "debug" => 0}
+        "threshold"       => 80,
+        "mastchar"        => "",
+        "locchar"         => "",
+        "addchar"         => "",
+        "options"         => {"verbose" => 0, "debug" => 0}
     );
     Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
     GetOptions(
-        'help|h'        => \$opts{"help"},
+        'help|h'                => \$opts{"help"},
 
         'master-charset|M=s'    => \$opts{"mastchar"},
         'localized-charset|L=s' => \$opts{"locchar"},
         'addendum-charset|A=s'  => \$opts{"addchar"},
 
-        'verbose|v'     => \@verbose,
-        'debug|d'       => \$opts{"debug"},
-        'quiet|q'       => \$opts{"quiet"},
-        'split|s'       => \$opts{"split"},
-        'keep|k=s'      => \$opts{"threshold"},
+        'verbose|v'             => \@verbose,
+        'debug|d'               => \$opts{"debug"},
+        'quiet|q'               => \$opts{"quiet"},
+        'split|s'               => \$opts{"split"},
+        'keep|k=s'              => \$opts{"threshold"},
         'no-translations'       => \$opts{"no-translations"},
-        'version|V'     => \&show_version,
-        'option|o=s'    => \@options
+        'version|V'             => \&show_version,
+        'option|o=s'            => \@options
     ) or pod2usage();
 
     $opts{"verbose"} = scalar @verbose;
@@ -602,72 +602,72 @@
 }
 
 if (not $po4a_opts{"no-translations"}) {
-# update all translations
+    # update all translations
 
-foreach $lang (sort keys %po_filename) {
-    DOC: foreach my $master (sort keys %document) {
-	next unless defined $document{$master}{$lang};
+    foreach $lang (sort keys %po_filename) {
+	DOC: foreach my $master (sort keys %document) {
+	    next unless defined $document{$master}{$lang};
     
-	my %file_opts = %po4a_opts;
-	my $options = "";
-	if (defined $document{$master}{"options"}{"global"}) {
-	    $options .= $document{$master}{"options"}{"global"};
-	}
-	# append the language options
-	if (defined $document{$master}{"options"}{$lang}) {
-	    $options .= " ".$document{$master}{"options"}{$lang};
-	}
-	if (defined $options) {
-	    # also use the options provided on the command line
-	    %file_opts = get_options(@ORIGINAL_ARGV,
-	                             split(/ /, $options));
-	}
-	my $doc=Locale::Po4a::Chooser::new($document{$master}{'format'},
-	                                   %{$file_opts{"options"}});
+	    my %file_opts = %po4a_opts;
+	    my $options = "";
+	    if (defined $document{$master}{"options"}{"global"}) {
+		$options .= $document{$master}{"options"}{"global"};
+	    }
+	    # append the language options
+	    if (defined $document{$master}{"options"}{$lang}) {
+		$options .= " ".$document{$master}{"options"}{$lang};
+	    }
+	    if (defined $options) {
+		# also use the options provided on the command line
+		%file_opts = get_options(@ORIGINAL_ARGV,
+		                         split(/ /, $options));
+	    }
+	    my $doc=Locale::Po4a::Chooser::new($document{$master}{'format'},
+		                               %{$file_opts{"options"}});
 
-	my (@file_in_name, at po_in_name);
-	push @file_in_name, $master;
-	push @po_in_name, $po_filename{$lang};
+	    my (@file_in_name, at po_in_name);
+	    push @file_in_name, $master;
+	    push @po_in_name, $po_filename{$lang};
 
-	$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"});
+	    $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"});
 
-	my ($percent,$hit,$queries) = $doc->stats();
+	    my ($percent,$hit,$queries) = $doc->stats();
 
-	if ($percent<$file_opts{"threshold"})  {
-	    print wrap_msg(gettext("Discard %s (only %s%% translated; need %s%%)."),
-		$document{$master}{$lang}, $percent, $file_opts{"threshold"});
-	    unlink($document{$master}{$lang}) if (-e $document{$master}{$lang});
-	    next DOC;
-	}
+	    if ($percent<$file_opts{"threshold"})  {
+		print wrap_msg(gettext("Discard %s (only %s%% translated; need %s%%)."),
+		    $document{$master}{$lang}, $percent, $file_opts{"threshold"});
+		unlink($document{$master}{$lang}) if (-e $document{$master}{$lang});
+		next DOC;
+	    }
 
-	if (defined ($document{$master}{"add_$lang"})) {
-	    foreach my $add (@{$document{$master}{"add_$lang"}}) {
-		if ( !$doc->addendum($add) ) {
-		    die wrap_msg(gettext("Addendum %s does NOT apply to %s (translation discarded)."),
-			$add, $document{$master}{$lang});
-		    unlink($document{$master}{$lang}) if (-e $document{$master}{$lang});
-		    next DOC;
+	    if (defined ($document{$master}{"add_$lang"})) {
+		foreach my $add (@{$document{$master}{"add_$lang"}}) {
+		    if ( !$doc->addendum($add) ) {
+			die wrap_msg(gettext("Addendum %s does NOT apply to %s (translation discarded)."),
+			    $add, $document{$master}{$lang});
+			unlink($document{$master}{$lang}) if (-e $document{$master}{$lang});
+			next DOC;
+		    }
 		}
 	    }
-	}
-	if ($file_opts{"verbose"}) {
-	    if ($percent == 100) {
-		print wrap_msg(gettext("%s is %s%% translated (%s strings)."),
-		    $document{$master}{$lang}, $percent, $queries);
-	    } else {
-		print wrap_msg(gettext("%s is %s%% translated (%s of %s strings)."),
-		    $document{$master}{$lang}, $percent, $hit, $queries);
+	    if ($file_opts{"verbose"}) {
+		if ($percent == 100) {
+		    print wrap_msg(gettext("%s is %s%% translated (%s strings)."),
+			$document{$master}{$lang}, $percent, $queries);
+		} else {
+		    print wrap_msg(gettext("%s is %s%% translated (%s of %s strings)."),
+			$document{$master}{$lang}, $percent, $hit, $queries);
+		}
 	    }
-	}
 
-	$doc->write($document{$master}{$lang});
+	    $doc->write($document{$master}{$lang});
+	}
     }
 }
-}
   
 __END__




More information about the Po4a-commits mailing list