+ $new{$key} = $me{$key} if $me{$key} ne $en{$key};
+ }
+ }
+
+ ## When foo exists in this file but only foo.one, foo,other
+ ## etc in English or the original file we don't want to throw away what we have
+ my @plural_keys = qw( zero one many few other two );
+
+ while (my ($me_k, $me_v) = each %me) {
+ if (not exists $tw{ $me_k } and
+ not exists $en{ $me_k } and
+ (
+ exists $en{ $me_k . '.zero' } or
+ exists $en{ $me_k . '.one' } or
+ exists $en{ $me_k . '.many' } or
+ exists $en{ $me_k . '.few' } or
+ exists $en{ $me_k . '.other' } or
+ exists $en{ $me_k . '.two' })) {
+ #say STDERR "Bringing back nuked plural form '$me_k' Setting it to '$me{ $me_k }'";
+ $new{ $me_k } = $me{ $me_k };
+ }
+ }
+
+ # Both arrays and strings are supported in the site key. Avoid removing e.g.:
+ # -site.key.table.entry.school: 學校;大學
+ # Just because en.yml has site.key.table.entry.school.0 and site.key.table.entry.school.1
+ while (my ($me_k, $me_v) = each %me) {
+ next unless $me_k =~ /^site\.key\.table\.entry/;
+ next if $me_k =~ /\.\d+$/;
+
+ if (ref $en{ $me_k } eq 'ARRAY' and not ref $me{ $me_k }) {
+ $new{ $me_k } = $me{ $me_k };
+ }
+ }
+
+ # There are a bunch of keys on Translatewiki that are
+ # equivalent to English for some reason. Probably because they
+ # were there at import time. Nuke them.
+ while (my ($new_k, $new_v) = each %new) {
+ if (exists $en{ $new_k } and $en{ $new_k } eq $new_v) {
+ #say "Purging dupe in $rails_lang: $new_k=$new_v";
+ delete $new{ $new_k };