selector looks the same without it and Translatewiki pukes on it.
In any case this needs to be turned into a message with
parameters. But Potlatch's code is too hairy so I'm not touching it.
also [17832].
This commit can be reviewed in a sane manner by looking at
attachment🎫2305:first-translatewiki-patch.patch.gz
I've manually gone through it and searched for errors. I didn't find
any.
Fixed with:
{{{
for i in $(file *|grep ISO|awk '{print $1}'|sed s/://); do cat $i | iconv -f iso-8859-1 -t utf-8 > $i.utf8;done
for i in *yml; do mv $i.utf8 $i; done
}}}
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";
}
}}}
it easier for Translatewiki).
Here's the program I used to convert it:
{{{
#!/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";
my $file = "$lang.yml";
$lang{$lang} = LoadFile($file);
if (-f "$lang.html") {
$lang{$lang}->{"help_html"} = slurp("$lang.html")
}
DumpFile("$lang.yml.new", { $lang => $lang{$lang} }) or die "arghl";
}
}}}
The 'user.view.mapper since' message is broken. It should be done with
translation parameters. But messages can't include HTML like <b> and I
don't want to experiment with making that work or changing this into a
HTML table that doesn't look crappy.
we want to move to it (without hacking it) we're going to have to
eliminate those.
I compiled a list of them and I'm removing trailing whitespace from
those messages where the whitespace was a no-op. Mostly cases like
"<td>foo </td><td>bar</td>" or "<p>foo \n</p>"
These are the commands I ran to remove them:
perl -pi -e 's[( )(coordinates:)(\s*)"(.*?) "$][$1$2$3"$4"]g' *yml
perl -pi -e 's[( )(subject:|language:|location:|latitude:|latitude:|longitude:|coordinates:)(\s*)"(.*?) "$][$1$2$3"$4"]g' *yml
perl -pi -e 's[( )(recent_entries:)(\s*)"(.*?) "$][$1$2$3"$4"]g' *yml
perl -pi -e 's[( )(home location:|latitude:|longitude:|preferred languages:|profile description:|)(\s*)"(.*?) "$][$1$2$3"$4"]g' *yml
perl -pi -e 's[^( )(heading:)(\s*)"(.*?) "$][$1$2$3"$4"]g' *yml
perl -pi -e 's[^( )(email or username:|password:|confirm email address:|display name:|email address:|confirm password:|nearby users:)(\s*)"(.*?) "$][$1$2$3"$4"]g' *yml
perl -pi -e 's[( contact_webmaster:\s*)\x27(.*?) \x27][$1\x27$2\x27]' *yml