[qet] [1358] Improved the translation statistics script so that it displays any collection item having two identical "lang" attributes.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 1358
Author:   xavier
Date:     2011-10-05 21:41:03 +0200 (Wed, 05 Oct 2011)
Log Message:
-----------
Improved the translation statistics script so that it displays any collection item having two identical "lang" attributes.

Modified Paths:
--------------
    branches/0.3/misc/translations_stat.pl

Modified: branches/0.3/misc/translations_stat.pl
===================================================================
--- branches/0.3/misc/translations_stat.pl	2011-10-05 19:38:08 UTC (rev 1357)
+++ branches/0.3/misc/translations_stat.pl	2011-10-05 19:41:03 UTC (rev 1358)
@@ -140,8 +140,11 @@
 	my $file = $_;
 	our %languages;
 	for my $lang_key (our @ordered_languages) {
-		if (get_pattern_count_in_file('file' => $file, 'pattern' => sprintf('<name\s+lang="%s"\s*>', $lang_key, 'limit' => 1)) == 1) {
+		my $translations_count = get_pattern_count_in_file('file' => $file, 'pattern' => sprintf('<name\s+lang="%s"\s*>', $lang_key));
+		if ($translations_count == 1) {
 			++ $languages{$lang_key}{'translated_elements_count'};
+		} elsif ($translations_count > 1) {
+			print STDERR "Multiple translation in $File::Find::name\n";
 		}
 	}
 }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/