From 4ad1cd693be9be5dc7677bba24c8036f5c19f908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 30 Sep 2013 11:53:46 +0200 Subject: [PATCH] Add debug information to check the completeness of the translation. re #37 --- tools/updateLang.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/updateLang.pl b/tools/updateLang.pl index e8deddc..efac02e 100644 --- a/tools/updateLang.pl +++ b/tools/updateLang.pl @@ -60,6 +60,8 @@ sub handleLanguageFile { my ($file) = @_; (my $lang = $file) =~ s/Localization_(\w\w)\.json/$1/; my $file = "../lang/" . $file; + my $total = 0; + my $translated = 0; debug ("language file: $file / $lang \n"); @@ -80,12 +82,16 @@ sub handleLanguageFile { print OUTPUT "{\n"; foreach my $name (@strings) { + $total++ if ($name !~ /^languages\.\w{3}$/); if (not exists ($values{$lang}{$name})) { print OUTPUT "\"##TODO##$name\":\"$values{en}{$name}\",\n"; } else { + $translated++ if ($name !~ /^languages\.\w{3}$/); print OUTPUT "\"$name\":\"$values{$lang}{$name}\",\n"; } } + my $percentage = ($translated * 100) / $total; + debug (" $translated / $total ($percentage %) \n"); print OUTPUT "\"DO_NOT_TRANSLATE\":\"end\"\n"; print OUTPUT "}\n";