list the strings remaining to be translated

pull/21833/head
Matthew Hodgson 2017-05-27 19:03:26 +01:00
parent 71bc15c2fc
commit 796158422c
1 changed files with 18 additions and 0 deletions

View File

@ -42,6 +42,9 @@ foreach my $tuple (@$src_strings) {
print "\nChecking en_EN\n"; print "\nChecking en_EN\n";
my $count = 0; my $count = 0;
my $remaining_src = {};
foreach (keys %$src) { $remaining_src->{$_}++ };
foreach my $k (sort keys %$en) { foreach my $k (sort keys %$en) {
# crappy heuristic to ignore country codes for now... # crappy heuristic to ignore country codes for now...
next if ($k =~ /^(..|..-..)$/); next if ($k =~ /^(..|..-..)$/);
@ -61,9 +64,13 @@ foreach my $k (sort keys %$en) {
} }
else { else {
$count++; $count++;
delete $remaining_src->{$k};
} }
} }
printf ("$count/" . (scalar keys %$src) . " strings found in src are present in en_EN\n"); 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 $!; opendir(DIR, $i18ndir) || die $!;
my @files = readdir(DIR); 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 $map = read_i18n($i18ndir."/".$lang);
my $count = 0; my $count = 0;
my $remaining_en = {};
foreach (keys %$en) { $remaining_en->{$_}++ };
foreach my $k (sort keys %$map) { foreach my $k (sort keys %$map) {
if ($en->{$k}) { if ($en->{$k}) {
if ($map->{$k} eq $k) { if ($map->{$k} eq $k) {
printf ("%10s %24s\t%s\n", $lang, "Untranslated string?", $k); printf ("%10s %24s\t%s\n", $lang, "Untranslated string?", $k);
} }
$count++; $count++;
delete $remaining_en->{$k};
} }
else { else {
if ($en->{$k . "."}) { 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"); printf ("$count/" . (scalar keys %$en) . " strings translated\n");
} }