[Po4a-commits] po4a po4a,1.16,1.17

Martin Quinson po4a-devel@lists.alioth.debian.org
Mon, 16 Aug 2004 23:41:11 +0000


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

Modified Files:
	po4a 
Log Message:
Implement -A and -M

Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- po4a	14 Aug 2004 17:31:05 -0000	1.16
+++ po4a	16 Aug 2004 23:41:08 -0000	1.17
@@ -92,6 +92,16 @@
 
 Show a short help message.
 
+=item -M, --master-charset
+
+Charset of the files containing the documents to translate. Note that all
+master documents must use the same charset for now. This is a known
+limitation, and we are working on solving this.
+
+=item -A, --addendum-charset
+
+Charset of the addenda. Note that all addenda should be in the same charset.
+
 =item -V, --version
 
 Displays the version of the script and exits.
@@ -181,9 +191,14 @@
 $debug = 0;
 $split = 0;
 my ($threshold)=(80);
+my ($mastchar,$addchar);
 Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
 GetOptions(
         'help|h'        => \$help,
+    
+	'master-charset|M=s'    => \$mastchar,
+	'addendum-charset|A=s' => \$addchar,
+
         'verbose|v'     => \@verbose,
         'debug|d'       => \$debug,
         'quiet|q'       => \$quiet,
@@ -307,7 +322,9 @@
     $doc->setpoout($potfile);
     my @file_in_name;
     push @file_in_name, $master;
-    $doc->process('file_in_name' => \@file_in_name);
+    $doc->process('file_in_name'     => \@file_in_name,
+                  'file_in_charset'  => $mastchar,
+                  'addendum_charset' => $addchar);
     $potfile = $doc->getpoout();
 }
 $potfile->write($pot_filename);
@@ -385,7 +402,9 @@
 	
 	$doc->process('file_in_name'  => \@file_in_name,
 	              'file_out_name' => $document{$master}{$lang},
-	              'po_in_name'    => \@po_in_name);
+	              'po_in_name'    => \@po_in_name,
+                      'file_in_charset'  => $mastchar,
+                      'addendum_charset' => $addchar);
 	
 	my ($percent,$hit,$queries) = $doc->stats();