summaryrefslogtreecommitdiff
path: root/scripts/extract_translators.pl
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-02-27 16:37:57 +0100
committerGravatar waker <wakeroid@gmail.com>2011-02-27 16:37:57 +0100
commitd820e16241cb43dea174b485bf38970367d7723e (patch)
treed6b5b2f6c077b462fcf7f27bfdcaa3dbc34c7c84 /scripts/extract_translators.pl
parent5643aebece3ebba52eadbc7af3c6b5a60c1006b6 (diff)
moved extract_translators.pl to scripts folder
Diffstat (limited to 'scripts/extract_translators.pl')
-rwxr-xr-xscripts/extract_translators.pl54
1 files changed, 54 insertions, 0 deletions
diff --git a/scripts/extract_translators.pl b/scripts/extract_translators.pl
new file mode 100755
index 00000000..a3ad02a2
--- /dev/null
+++ b/scripts/extract_translators.pl
@@ -0,0 +1,54 @@
+#!/usr/bin/env perl
+
+use strict;
+use Locale::Language;
+use Locale::Country;
+
+my @files = split /\s+/, `ls po/*.po`;
+my @files = sort {$a cmp $b} @files;
+
+foreach my $f (@files) {
+ open F, "<$f";
+
+ my $code = $f;
+ $code =~ s/^po\/(.*)\.po/$1/g;
+
+ my $script;
+ if ($code =~ /(.*)@(.*)/) {
+ $code = $1;
+ $script = $2;
+ }
+
+ my $country;
+ if ($code =~ /(.*)_(.*)/) {
+ $code = $1;
+ $country = code2country ($2);
+ }
+
+ my $lang = code2language($code);
+ #print "$code\n";
+ print "$lang";
+ if ($country) {
+ print " ($country)";
+ }
+ if ($script) {
+ print " ($script)";
+ }
+ print "\n";
+ while (<F>) {
+ if (/^#/) {
+ if (/\@/ && !(/Yakovenko/) && !(/EMAIL/)) {
+ s/^#//;
+ s/, [0-9]+\.$//g;
+ chomp;
+ print "$_\n";
+ }
+ }
+ else {
+ last;
+ }
+ }
+ print "\n";
+
+ close F;
+}