I used this script:
{{{
#!/usr/bin/env perl
use feature ':5.10';
use strict;
use warnings;
use YAML::Syck qw(Load LoadFile Dump DumpFile);
use File::Slurp qw(slurp);
use Data::Dump 'dump';
use Encode qw(decode);
use autodie;
$YAML::Syck::Headless = 1;
$YAML::Syck::SortKeys = 1;
$YAML::Syck::ImplicitUnicode = 1;
my %lang;
chdir 'locales';
my @yml = glob "*.yml";
my @lang = map { s/\.yml//; $_ } @yml;
for my $lang (@lang) {
say "Loading $lang";
$lang{$lang} = LoadFile("$lang.yml")->{$lang};
}
for my $lang (grep { $_ ne 'en' } @lang) {
while (my ($k, $v) = each %{ $lang{ $lang } }) {
if ($lang{ $lang }->{$k} eq $lang{ en }->{$k}
or (exists $lang{ $lang }->{$k} and not exists $lang{ en }->{$k})) {
delete $lang{ $lang }->{$k};
}
}
}
for my $lang (@lang) {
DumpFile("$lang.yml", { $lang => $lang{$lang} }) or die "arghl";
}
}}}