From f40c054b4a92cfde04e6b49a427b5709cc7d9647 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Mon, 1 Dec 2008 12:28:50 +0000 Subject: [PATCH] simple tool to check the translations git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@214 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/check_translation.pl | 54 ++++++++++++++++++++++++++++++ src/messenger/pack.pl | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100755 src/messenger/check_translation.pl diff --git a/src/messenger/check_translation.pl b/src/messenger/check_translation.pl new file mode 100755 index 00000000..8e2d51d5 --- /dev/null +++ b/src/messenger/check_translation.pl @@ -0,0 +1,54 @@ +#!/usr/bin/perl + +sub read_transl($) { + my($from) = @_; + my %translation = (); + open(IN, "webim/locales/$from/properties"); + while() { + chomp; + if(/^([\w\.]+)=(.*)$/) { + if($1 ne "encoding" && $1 ne "output_charset" && $1 ne "output_encoding") { + $translation{$1} = $2; + } + } else { + die "wrong line in $from: $_\n"; + } + } + close(IN); + return %translation; +} + +%tr_en = read_transl("en"); +%tr_ru = read_transl("ru"); +%tr_fr = read_transl("fr"); +%tr_sp = read_transl("sp"); + +@all_keys = keys %tr_en; + +sub check_transl($%) { + my($name,%tr) = @_; + print "checking $name...\n"; + my @totransl = (); + for $key (@all_keys) { + unless(exists $tr{$key}) { + push @totransl, "$key=".$tr_en{$key}; + } + } + for $key(keys %tr) { + unless(exists $tr_en{$key}) { + print "unknown key in $name: $key\n"; + } + } + if($#totransl >= 0) { + print "@{[$#totransl+1]} lines absent in locales/$name/properties\n"; + open(OUT, "> absent_$name"); + for(sort @totransl) { + print OUT "$_\n"; + } + close(OUT); + } +} + +check_transl("ru", %tr_ru); +check_transl("fr", %tr_fr); +check_transl("sp", %tr_sp); diff --git a/src/messenger/pack.pl b/src/messenger/pack.pl index 868ce38a..13eb5202 100755 --- a/src/messenger/pack.pl +++ b/src/messenger/pack.pl @@ -5,7 +5,7 @@ ################################################################## $targetFolder = "deploy"; -$suffix = "143"; +$suffix = "150b1"; ################################################################## # Copies tree into target folder, preprocess .phps