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
This commit is contained in:
xavier
2011-10-05 19:41:03 +00:00
parent f2f63edd07
commit 81dbda4f51

View File

@@ -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('<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";
}
}
}