[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] translation-check seems broken



Hi,
while looking for distrib/vendors, i found that
    http://www.debian.org/distrib/vendors.fr.html
is broken, and it seems due to wml::debian::translation-check
Patch attached.

Denis
Index: translation-check.wml
===================================================================
RCS file: /cvs/webwml/webwml/english/template/debian/translation-check.wml,v
retrieving revision 1.43
diff -u -r1.43 translation-check.wml
--- translation-check.wml	2001/06/02 10:39:13	1.43
+++ translation-check.wml	2001/06/13 23:24:39
@@ -60,9 +60,7 @@
 
 # This is the message that is displayed if the translation is too old.
 # (difference >= max_delta)
-<define-tag translationoutofdate whitespace=delete>
-<:
-my $slices = q{
+<define-tag translationoutofdate>
   [EN:<P><STRONG>Warning! This translation is too out of date,
       please see the <A HREF="$link">original</A>.</STRONG></P>:]
   [AR:<P><STRONG>Warning! This translation is too out of date,
@@ -109,15 +107,11 @@
       please see the <A HREF="$link">original</A>.</STRONG></P>:]
   [ZH:<p><strong>ª`·N¡I¦¹ºô­¶¤¤¤åĶ¥»¤Ó¤[¨S¦³§ó·s¤F¡A\
       ½Ð°Ñ¾\\<a href="$link">³Ì·s­ì­^¤å¥»</a>¡C</strong></p>:]
-};
-$slices =~ s/([^:][^ \]])\n/$1 \n/g;
-print $slices;
-:>
 </define-tag>
 
 # This is the message that is displayed if the referenced original file
 # no longer exists.
-<define-tag originalgone whitespace=delete>
+<define-tag originalgone>
   [EN:<P><EM>Note:</EM> The original no longer exists.</P>:]
   [AR:<P><EM>Note:</EM> The original no longer exists.</P>:]
   [DA:<P><EM>Bemærk:</EM> Originalen findes ikke længere.</P>:]
@@ -152,7 +146,7 @@
 # Input parameters:
 my ($translation, $file, $original, $mindelta, $maxdelta) = @_;
 
-my $parents, $level, $relative_dir;
+my $parents, $level, $relative_dir, $output;
 my @relative_dir = ();
 
 # This is the maximum difference between a translated
@@ -223,18 +217,27 @@
 
 print "Comparing original $version to translation version $translation\n" if ($debug >= 1);
 
+$output = '';
 if ($version eq "")
 {
-	print qq(<originalgone>)
+	$output = qq(<originalgone>)
 }
 elsif ( $major_number != $major_translated_number ) {
-	print qq(<translationoutofdate>)
+	$output = qq(<translationoutofdate>)
 }
 elsif ( $last_number - $last_translated_number >= $max_versions ) {
-	print qq(<translationoutofdate>)
+	$output = qq(<translationoutofdate>)
 }
 elsif ( $last_number - $last_translated_number >= $min_versions ) {
-	print qq(<translationaged>)
+	$output = qq(<translationaged>)
+}
+# Remove extra whitespace
+if ($output ne "") {
+	$output =~ s/^ +//m;
+	$output =~ s/ +$//m;
+	$output =~ s/:\]\n\[/:\]\[/sg;
+	$output =~ s/\n/ /sg;
+	print $output;
 }
 }
 </perl>

Reply to: