From 796158422c4598228d08bb58e1894954c7eff728 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 27 May 2017 19:03:26 +0100 Subject: [PATCH] list the strings remaining to be translated --- scripts/check-i18n.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/check-i18n.pl b/scripts/check-i18n.pl index 6c92dae53d..2d50138788 100755 --- a/scripts/check-i18n.pl +++ b/scripts/check-i18n.pl @@ -42,6 +42,9 @@ foreach my $tuple (@$src_strings) { print "\nChecking en_EN\n"; my $count = 0; +my $remaining_src = {}; +foreach (keys %$src) { $remaining_src->{$_}++ }; + foreach my $k (sort keys %$en) { # crappy heuristic to ignore country codes for now... next if ($k =~ /^(..|..-..)$/); @@ -61,9 +64,13 @@ foreach my $k (sort keys %$en) { } else { $count++; + delete $remaining_src->{$k}; } } printf ("$count/" . (scalar keys %$src) . " strings found in src are present in en_EN\n"); +foreach (keys %$remaining_src) { + printf "remaining: $_\n"; +} opendir(DIR, $i18ndir) || die $!; my @files = readdir(DIR); @@ -74,12 +81,17 @@ foreach my $lang (grep { -f "$i18ndir/$_" && !/(basefile|en_EN)\.json/ } @files) my $map = read_i18n($i18ndir."/".$lang); my $count = 0; + my $remaining_en = {}; + foreach (keys %$en) { $remaining_en->{$_}++ }; + + foreach my $k (sort keys %$map) { if ($en->{$k}) { if ($map->{$k} eq $k) { printf ("%10s %24s\t%s\n", $lang, "Untranslated string?", $k); } $count++; + delete $remaining_en->{$k}; } else { if ($en->{$k . "."}) { @@ -97,6 +109,12 @@ foreach my $lang (grep { -f "$i18ndir/$_" && !/(basefile|en_EN)\.json/ } @files) } } + if (scalar keys %$remaining_en < 100) { + foreach (keys %$remaining_en) { + printf ("%10s %24s\t%s\n", $lang, "Not yet translated", $_); + } + } + printf ("$count/" . (scalar keys %$en) . " strings translated\n"); }