my $fixja = Text::Iconv->new("EUC-JP", "UTF-8");
foreach my $lang (@DDTP_LANGUAGES) {
- print "Reading Translations for $lang...";
- open PKG, "zcat $TOPDIR/archive/*/*/*/i18n/Translation-$lang.gz|";
+ (my $locale = $lang) =~ s/^([a-z]{2})-([a-z]{2})$/"$1_".uc($2)/e;
+ print "Reading Translations for $lang ($locale)...";
+ open PKG, "zcat $TOPDIR/archive/*/*/*/i18n/Translation-$locale.gz|";
my $count = 0;
while (<PKG>) {
next if /^\s*$/;
# Skip double descriptions
next if exists($descriptions{$data{"description-md5"}}{$lang});
# some weirdnesses in the files
- next unless defined $data{"description-".lc($lang)};
+ next unless defined $data{"description-".lc($locale)};
if ($lang eq 'ja') {
my $fixed = $fixja->convert($data{"description-ja"});
$data{"description-ja"} = $fixed if $fixed;
}
- $descriptions{$data{"description-md5"}}{$lang} = $data{"description-".lc($lang)};
+ $descriptions{$data{"description-md5"}}{$lang} =
+ $data{"description-".lc($locale)};
$count++;
}
print "($count)\n";
# Architectures
#
polangs="de fi fr hu ja nl sv uk"
-ddtplangs="ca cs da de eo es fi fr go hu it ja km_KH ko nl pl pt pt_BR ru sk sv uk zh zh_CN zh_TW"
+ddtplangs="ca cs da de eo es fi fr go hu it ja km-kh ko nl pl pt pt-br ru sk sv uk zh zh-cn zh-tw"
archives="us security amd64 gnuab backports volatile"
sections="main contrib non-free"
parts="$sections"
test -d us/${dist}/${part}/i18n || mkdir -p us/${dist}/${part}/i18n
for lang in $ddtplangs
do
- echo retrieve translated Descs $dist/$part/$lang
+ locale=$(echo $lang|perl -p -e 's/^([a-z]{2})-([a-z]{2})$/"$1_".uc($2)/e')
+ echo "retrieve translated Descs $dist/$part/$lang ($locale)"
(cd us/${dist}/${part}/i18n &&
- wget -q -N ${ddtp_ftpsite}/dists/${dist}/${part}/i18n/Translation-$lang.gz)
+ wget -q -N ${ddtp_ftpsite}/dists/${dist}/${part}/i18n/Translation-$locale.gz)
done
done
done