From cda5b055fe8399ca3565adee9a4a832fe9f489ed Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 27 Jul 2020 16:17:33 -0400 Subject: updatelang: Fix a few straggling issues Change-Id: I549a33c94c339151cf5a74f13a8ecb73454bbfd4 --- tools/updatelang | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'tools/updatelang') diff --git a/tools/updatelang b/tools/updatelang index cbeb3ff25c..df8f7e8aa4 100755 --- a/tools/updatelang +++ b/tools/updatelang @@ -295,8 +295,10 @@ foreach my $id (@langorder) { foreach my $tgt (keys(%ep)) { if (!defined($lp{$tgt})) { # If it doesn't exist in the language, copy it from English - $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is missing! Copying from english!\n"; -# print "#!! '$id:$tgt' source missing\n"; + if ($ep{$tgt} ne 'none' && $ep{$tgt} ne '' ) { + $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is missing! Copying from english!\n"; +# print "#!! '$id:$tgt' source missing\n"; + } $lang{$id}{'source'}{$tgt} = $english{$id}{'source'}{$tgt}; } elsif ($lp{$tgt} ne $ep{$tgt}) { # If the source string differs, complain, and copy from English @@ -332,22 +334,24 @@ foreach my $id (@langorder) { foreach my $tgt (keys(%ep)) { if (!defined($lp{$tgt})) { # If it doesn't exist in the language, copy it from English - $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is missing! Copying from english\n"; -# print "#!! '$id:$tgt' dest missing\n"; + if ($ep{$tgt} ne 'none' && $ep{$tgt} ne '' ) { + $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is missing! Copying from english\n"; +# print "#!! '$id:$tgt' dest missing\n"; + } $lang{$id}{'dest'}{$tgt} = $english{$id}{'dest'}{$tgt}; } elsif ($lp{$tgt} ne $ep{$tgt}) { # If the source string differs, complain, and copy from English if ($lp{$tgt} eq '' && $ep{$tgt} ne '') { $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is blank! Copying from english!\n"; # print "#!! '$id:$tgt' dest is blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; - $lang{$id}{'source'}{$tgt} = $english{$id}{'source'}{$tgt}; + $lang{$id}{'dest'}{$tgt} = $english{$id}{'dest'}{$tgt}; } elsif ($lp{$tgt} ne '' && $ep{$tgt} eq '') { # It should be kept blank! $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is not blank!\n"; $lang{$id}{'notes'} .= "### the previously used one is commented below:\n"; $lang{$id}{'notes'} .= "### $english{$id}{dest}{$tgt}\n"; # print "#!! '$id:$tgt' dest not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; - $lang{$id}{'source'}{$tgt} = $english{$id}{'source'}{$tgt}; + $lang{$id}{'dest'}{$tgt} = $english{$id}{'dest'}{$tgt}; } } elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'}) { $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is identical to english!\n"; @@ -379,22 +383,24 @@ foreach my $id (@langorder) { foreach my $tgt (keys(%ep)) { if (!defined($lp{$tgt})) { # If it doesn't exist in the language, copy it from English - $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is missing! Copying from english\n"; -# print "#!! '$id:$tgt' voice missing\n"; + if ($ep{$tgt} ne 'none' && $ep{$tgt} ne '' ) { + $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is missing! Copying from english\n"; +# print "#!! '$id:$tgt' voice missing\n"; + } $lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt}; } elsif ($lp{$tgt} ne $ep{$tgt}) { if ($lp{$tgt} eq '' && $ep{$tgt} ne '') { # If the lang voice string is blank, complain, and copy from English $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is blank! Copying from english!\n"; # print "#!! '$id:$tgt' voice is blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; - $lang{$id}{'source'}{$tgt} = $english{$id}{'source'}{$tgt}; + $lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt}; } elsif ($lp{$tgt} ne '' && $ep{$tgt} eq '') { # If it's not blank, clear it and complain! $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is not blank!\n"; $lang{$id}{'notes'} .= "### the previously used one is commented below:\n"; $lang{$id}{'notes'} .= "### $english{$id}{voice}{$tgt}\n"; # print "#!! '$id:$tgt' voice not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; - $lang{$id}{'source'}{$tgt} = $english{$id}{'source'}{$tgt}; + $lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt}; } } elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'}) { $lang{$id}{'notes'} .= "### The section for '$id:$tgt' is identical to english!\n"; -- cgit v1.2.3