[QGIS Commit] r10294 - trunk/qgis/scripts

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Mar 19 08:02:43 EDT 2009


Author: jef
Date: 2009-03-19 08:02:43 -0400 (Thu, 19 Mar 2009)
New Revision: 10294

Added:
   trunk/qgis/scripts/tsstat.pl
Log:
add translatation statistics script

Added: trunk/qgis/scripts/tsstat.pl
===================================================================
--- trunk/qgis/scripts/tsstat.pl	                        (rev 0)
+++ trunk/qgis/scripts/tsstat.pl	2009-03-19 12:02:43 UTC (rev 10294)
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+use strict;
+use Locale::Language;
+use Locale::Country;
+
+print "Language;Count;Translated;Translated_finished;translated_unfinished;untranslated;part\n";
+
+for my $i (<i18n/qgis_*.ts>) {
+        my ($langcode) = $i =~ /i18n\/qgis_(.*).ts/;
+
+        my $name;
+        if($langcode =~ /(.*)_(.*)/) {
+                my $lang = code2language(lc $1);
+                my $country = code2country(lc $2);
+                $name = "$lang ($country)";
+        } else {
+                $name = code2language(lc $langcode);
+        }
+
+
+        open F, "lrelease $i|";
+
+        my($translations,$finished,$unfinished,$untranslated);
+
+        while(<F>) {
+                if(/Generated (\d+) translation\(s\) \((\d+) finished and (\d+) unfinished\)/) {
+                        $translations=$1;
+                        $finished=$2;
+                        $unfinished=$3;
+                } elsif(/Ignored (\d+) untranslated source text\(s\)/) {
+                        $untranslated=$1;
+                }
+        }
+
+        close F;
+
+        my $n = $translations+$untranslated;
+
+        print "$name;$n;$translations;$finished;$unfinished;$untranslated;" . sprintf("%.1f%", ($n-$untranslated)/$n*100) . "\n";
+}
+
+__END__
+Updating 'qgis_de.qm'...
+    Generated 3300 translation(s) (1217 finished and 2083 unfinished)
+    Ignored 8 untranslated source text(s)



More information about the QGIS-commit mailing list