[Po4a-devel][CVS] po4a/lib/Locale/Po4a Po.pm,1.12,1.13

Martin Quinson po4a-devel@lists.alioth.debian.org
Mon, 19 Jul 2004 20:31:19 +0000


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv13487/lib/Locale/Po4a

Modified Files:
	Po.pm 
Log Message:
Make messages more useful; dump the result got so far on gettextization failure; fix a tiny bug

Index: Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- Po.pm	30 Apr 2004 22:47:58 -0000	1.12
+++ Po.pm	19 Jul 2004 20:31:17 -0000	1.13
@@ -274,13 +274,14 @@
     if ($poorig->count_entries() > $potrans->count_entries()) {
 	warn sprintf(dgettext("po4a",
 		"po4a gettextize: Original have more strings that the translation (%d>%d).\n".
-		"po4a gettextize: Please fix it by editing the translated version to add a dummy entry."),
+		"po4a gettextize: Please fix it by editing the translated version to add some dummy entry."),
 		    $poorig->count_entries() , $potrans->count_entries())."\n";
     } elsif ($poorig->count_entries() < $potrans->count_entries()) {
 	warn sprintf(dgettext("po4a",
 		"po4a gettextize: Original have less strings that the translation (%d<%d).\n".
-		"po4a gettextize: Please fix it by removing the extra entry from the\n".
-		"po4a gettextize: translated file. You may need an addendum, cf po4a(7)."),
+		"po4a gettextize: Please fix it by removing the extra entry from the translated file.\n".
+		"po4a gettextize: You may need an addendum (cf po4a(7)) to reput the chunk in place after gettextization.\n".
+	        "po4a gettextize: A possible cause is that a text dupplicated in the original is not translated the same way each time. Remove one of the translations, and you're fine."),
 		    $poorig->count_entries() , $potrans->count_entries())."\n";
     }
     
@@ -310,13 +311,15 @@
 	#
 	# Make sure both type are the same
 	#
-	if ($typeorig ne $potrans->{po}{$trans}{'type'}){
+	if ($typeorig ne $typetrans){
+	    $pores->write("/tmp/gettextization.failed.po");
 	    die sprintf(dgettext("po4a",
 	    	"po4a gettextization: Structure disparity between original and translated files:\n".
 		"msgid (at %s) is of type '%s' while\n".
 		"msgstr (at %s) is of type '%s'.\n".
 		"Original text: %s\n".
-		"Translated text: %s"),
+		"Translated text: %s\n".
+	        "(result so far dumped to /tmp/gettextization.failed.po)"),
 			$reforig,$typeorig,$reftrans,$typetrans,$orig,$trans)."\n";
 	}