[Po4a-commits] "po4a NEWS, 1.65, 1.66 changelog, 1.378, 1.379 po4a-normalize, 1.29, 1.30"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sat Oct 4 17:56:48 UTC 2008


Update of /cvsroot/po4a/po4a
In directory alioth:/tmp/cvs-serv2175

Modified Files:
	NEWS changelog po4a-normalize 
Log Message:
 * Added option -b, --blank to check which parts of a document are not
   translated.


Index: NEWS
===================================================================
RCS file: /cvsroot/po4a/po4a/NEWS,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- NEWS	23 Aug 2008 01:37:06 -0000	1.65
+++ NEWS	4 Oct 2008 17:56:46 -0000	1.66
@@ -1,7 +1,11 @@
 po4a NEWS
 
 ===============================================================================
-* Major changes in release 0.34 (UNRELEASED)
+* Major changes in release 0.35 (UNRELEASED)
+
+po4a-normalize:
+ * Added option -b, --blank to check which parts of a document are not
+   translated.
 
 docbook:
  * The <option> tag is now in the inline section (used to be in the tags

Index: po4a-normalize
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-normalize,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- po4a-normalize	7 Oct 2006 21:15:10 -0000	1.29
+++ po4a-normalize	4 Oct 2008 17:56:46 -0000	1.30
@@ -42,6 +42,14 @@
 'name=value' format. See the documentation of each plugin for more
 information about the valid options and their meanings.
 
+=item -b, --blank
+
+Create an blank translated document.
+The generated translated document will be generated assuming all messages
+are translated by a space or new line.
+
+This is useful to check what parts of the document cannot be translated.
+
 =item -h, --help
 
 Show a short help message.
@@ -102,7 +110,7 @@
     exit 0;
 }
 
-my ($help_fmt,$help,$type,$debug,$verbose, at options);
+my ($blank,$help_fmt,$help,$type,$debug,$verbose, at options);
 my ($mastchar);
 Getopt::Long::Configure('no_auto_abbrev','no_ignore_case');
 GetOptions(
@@ -110,6 +118,8 @@
 	'help-format'  => \$help_fmt,
 	'format|f=s'   => \$type,
 
+	'blank|b'      => \$blank,
+
 	'master-charset|M=s'    => \$mastchar,
 
 	'option|o=s'   => \@options,
@@ -143,6 +153,22 @@
 $parser->{TT}{utf_mode} = 1;
 $parser->{TT}{file_in_charset} = $mastchar;
 $parser->parse();
+if ($blank) {
+	foreach my $msgid (keys %{$parser->{TT}{po_out}{po}}) {
+		if ($msgid =~ m/\n$/s) {
+			$parser->{TT}{po_out}{po}{$msgid}{'msgstr'} = "\n";
+		} else {
+			$parser->{TT}{po_out}{po}{$msgid}{'msgstr'} = " ";
+		}
+	}
+	my $empty_po = $parser->{TT}{po_out};
+	$parser = Locale::Po4a::Chooser::new($type,%options);
+	$parser->{TT}{po_in} = $empty_po;
+	$parser->read($filename);
+	$parser->{TT}{utf_mode} = 1;
+	$parser->{TT}{file_in_charset} = $mastchar;
+	$parser->parse();
+}
 $parser->write('po4a-normalize.output');
 $parser->writepo('po4a-normalize.po');
 

Index: changelog
===================================================================
RCS file: /cvsroot/po4a/po4a/changelog,v
retrieving revision 1.378
retrieving revision 1.379
diff -u -d -r1.378 -r1.379
--- changelog	4 Oct 2008 12:41:31 -0000	1.378
+++ changelog	4 Oct 2008 17:56:46 -0000	1.379
@@ -1,5 +1,10 @@
 2008-10-04  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* po4a-normalize: Added option -b, --blank to check which parts of
+	a document are not translated.
+
+2008-10-04  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* lib/Locale/Po4a/Xhtml.pm: Add <u> to the list of inline tags.
 
 2008-10-04  Nicolas François  <nicolas.francois at centraliens.net>




More information about the Po4a-commits mailing list