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

Patch to check_trans.pl



So, here is a patch to check_trans.pl to support those wml style
translation checking on page generation. (#use
wml::debian::translation-check ...)

Index: check_trans.pl
===================================================================
RCS file: /cvs/webwml/webwml/check_trans.pl,v
retrieving revision 1.8
diff -u -r1.8 check_trans.pl
--- check_trans.pl	2000/07/09 01:09:08	1.8
+++ check_trans.pl	2000/07/13 08:42:46
@@ -2,6 +2,12 @@
 
 # This is GPL'ed code, copyright 1998 Paolo Molaro <lupus@debian.org>.
 
+# 2000-07-06 Tommi Vainikainen <thv@iki.fi>
+
+# I modified regexp to match current revision of file to also match
+# strings '#use wml::debian::translation-check.wml
+# translation="R.rr"'. Now it's much more generic regexp.
+
 # Little utility to keep track of translations in the debian CVS repo.
 # Invoke as check_trans.pl [-v] [-d] [-s subtree] [language] 
 # from the webwml directory, eg:
@@ -109,9 +115,9 @@
 	}
 	open(F, $name) || die $!;
 	while(<F>) {
-		if (/<!--\s*translation\s+(.*)?\s*-->\s*$/oi) {
-			warn "Found revision $1\n" if $opt_v;
-			$oldr = $1;
+		if (/translation(\s+|=")([.0-9]+)("|\s*-->)\s*$/oi) {
+			warn "Found revision $2\n" if $opt_v;
+			$oldr = $2;
 			if ($oldr eq $revision) {
 				close(F);
 				return;
Index: english/template/debian/translation-check.wml
===================================================================
RCS file: /cvs/webwml/webwml/english/template/debian/translation-check.wml,v
retrieving revision 1.2
diff -u -r1.2 translation-check.wml
--- english/template/debian/translation-check.wml	2000/02/03 18:00:51	1.2
+++ english/template/debian/translation-check.wml	2000/07/13 08:42:49
@@ -11,8 +11,6 @@
 # Use it this way 
 # #use wml::debian::translation-check translation="X.xx"
 # instead of  <!--translation X.xx-->
-# 
-# TODO: modify check_trans.pl to recognize also this call
 
 my ($translation, $file) = @_;
 
So, if you think this is good, you can merge it to cvs. I don't have
write access to cvs, I'm not even developer.

-- 
Tommi Vainikainen

Reply to: