Skip to content

Commit 66d4068

Browse files
author
jef
committed
add translatation statistics script
git-svn-id: http://svn.osgeo.org/qgis/trunk@10294 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 125b822 commit 66d4068

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

scripts/tsstat.pl

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/perl
2+
3+
use strict;
4+
use Locale::Language;
5+
use Locale::Country;
6+
7+
print "Language;Count;Translated;Translated_finished;translated_unfinished;untranslated;part\n";
8+
9+
for my $i (<i18n/qgis_*.ts>) {
10+
my ($langcode) = $i =~ /i18n\/qgis_(.*).ts/;
11+
12+
my $name;
13+
if($langcode =~ /(.*)_(.*)/) {
14+
my $lang = code2language(lc $1);
15+
my $country = code2country(lc $2);
16+
$name = "$lang ($country)";
17+
} else {
18+
$name = code2language(lc $langcode);
19+
}
20+
21+
22+
open F, "lrelease $i|";
23+
24+
my($translations,$finished,$unfinished,$untranslated);
25+
26+
while(<F>) {
27+
if(/Generated (\d+) translation\(s\) \((\d+) finished and (\d+) unfinished\)/) {
28+
$translations=$1;
29+
$finished=$2;
30+
$unfinished=$3;
31+
} elsif(/Ignored (\d+) untranslated source text\(s\)/) {
32+
$untranslated=$1;
33+
}
34+
}
35+
36+
close F;
37+
38+
my $n = $translations+$untranslated;
39+
40+
print "$name;$n;$translations;$finished;$unfinished;$untranslated;" . sprintf("%.1f%", ($n-$untranslated)/$n*100) . "\n";
41+
}
42+
43+
__END__
44+
Updating 'qgis_de.qm'...
45+
Generated 3300 translation(s) (1217 finished and 2083 unfinished)
46+
Ignored 8 untranslated source text(s)

0 commit comments

Comments
 (0)