From 81dbda4f51962d36a41472c4eeb91426d2ac9132 Mon Sep 17 00:00:00 2001 From: xavier Date: Wed, 5 Oct 2011 19:41:03 +0000 Subject: [PATCH] Improved the translation statistics script so that it displays any collection item having two identical "lang" attributes. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1358 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- misc/translations_stat.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/translations_stat.pl b/misc/translations_stat.pl index f3eb069d2..296d92a66 100755 --- a/misc/translations_stat.pl +++ b/misc/translations_stat.pl @@ -140,8 +140,11 @@ sub analyze_element_file { my $file = $_; our %languages; for my $lang_key (our @ordered_languages) { - if (get_pattern_count_in_file('file' => $file, 'pattern' => sprintf('', $lang_key, 'limit' => 1)) == 1) { + my $translations_count = get_pattern_count_in_file('file' => $file, 'pattern' => sprintf('', $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"; } } }