Bug#260887: Untranslated country names and hang in apt-config and korean locale.
Hi,
At Fri, 23 Jul 2004 15:33:17 +0200,
Christian Perrier wrote:
> Quoting Changwoo Ryu (cwryu@debian.org):
> > Hmm I think changing "Korea, Republic of" to "South Korea" or
> > "Korea (South)" would be fine (Same for North Korea). Anyway most
> > ordinary people can't know these official Korean names, ROK/DPRK. ;)
> > "South Korea" to South Korean, or "North Korea" to North Korean people
> > may sound offensive... But I can "translate" these to non-offensive
> > ones
> > for Korean language users.
>
> I would object to this as iso-codes contains official names for
> countries and in that case, using non official names is very likely to
> trigger political problems while official names are accepted.
>
> We have to find a way to handle these commas, imho. Usually the method
> is escaping them in the templates file.
OK, I create a patch.
Are you ready to vomit? :-)
This patch provides:
- Take country name from iso-codes instead of libc6 zoneinfo when
iso-codes is installed.
- If iso-codes can't use, simply do fallback to zoneinfo.
- "," trick is too hard... but we can avoid by removing space after
",". Oops.
I've already test with:
- on ja_JP: with iso-codes, choice UK, Korean, Japan
- on ja_JP: without iso-codes, choice UK, Korean, Japan
- on C: with iso-codes, choice UK, Korean, Japan
- on C: without iso-codes, choice UK, Korean, Japan
I don't believe this is just in time to base-config freeze, but could
you test this, reporters?
Thanks,
--
Kenshi Muto
kmuto@debian.org
Index: apt-setup
===================================================================
--- apt-setup (revision 1175)
+++ apt-setup (working copy)
@@ -40,8 +40,10 @@
use Locale::gettext;
use POSIX;
textdomain("iso_3166");
- print gettext(shift);
- ' $2
+ $s = shift;
+ $s =~ s/,/, /go;
+ print gettext($s);
+ ' $2 | sed -e 's/, /,/g'
;;
C)
perl -e '
@@ -51,13 +53,14 @@
$country=shift;
$ret= "";
- open (T, "/usr/share/zoneinfo/iso3166.tab");
+ open (T, "/usr/share/iso-codes/iso_3166.tab") || open(T, "/usr/share/zoneinfo/iso3166.tab");
while (<T>) {
next if /^#/;
chomp;
($code, $long)=split(/\t/, $_);
if (gettext($long) eq $country) {
$ret = $long;
+ $ret =~ s/, /,/go;
close T;
}
}
@@ -78,7 +81,7 @@
use POSIX;
textdomain("iso_3166");
$type=shift;
- open (T, "/usr/share/zoneinfo/iso3166.tab");
+ open (T, "/usr/share/iso-codes/iso_3166.tab") || open(T, "/usr/share/zoneinfo/iso3166.tab");
while (<T>) {
next if /^#/;
chomp;
@@ -90,7 +93,9 @@
}
if (/Archive-$type:/) {
($c)=/Country: (.*?)\s+.*\n/;
- $countries{gettext($co{$c})}=1 if $c;
+ ($s)=gettext($co{$c});
+ $s =~ s/, /,/go;
+ $countries{$s}=1 if $c;
}
END { print join(", ", sort(keys %countries)) }
' $1 $MIRRORLIST
@@ -105,11 +110,12 @@
BEGIN {
$type=shift;
$country=shift;
- open (T, "/usr/share/zoneinfo/iso3166.tab");
+ open (T, "/usr/share/iso-codes/iso_3166.tab") || open(T, "/usr/share/zoneinfo/iso3166.tab");
while (<T>) {
next if /^#/;
chomp;
($code, $long)=split(/\t/, $_);
+ $long =~ s/, /,/go;
if ($long eq $country) {
$country=$code;
close T;
@@ -318,11 +324,12 @@
db_get debian-installer/country
COUNTRY=$(perl -e '
$countrycode=shift;
- open (T, "/usr/share/zoneinfo/iso3166.tab");
+ open (T, "/usr/share/iso-codes/iso_3166.tab") || open(T, "/usr/share/zoneinfo/iso3166.tab");
while (<T>) {
next if /^#/;
chomp;
($code, $long)=split(/\t/, $_);
+ $long =~ s/, /,/go;
if ($code eq $countrycode) {
print "$long";
close T;
@@ -335,17 +342,17 @@
fi
fi
db_get apt-setup/country
- IFS=","
+ IFS=""
db_set apt-setup/country $(country_i18n local "$RET")
+ db_get apt-setup/country
unset IFS
- db_get apt-setup/country
db_fset apt-setup/country seen false
db_input critical apt-setup/country || true
db_go || continue
db_get apt-setup/country
if [ "$RET, " != "$(gettext 'enter information manually, ')" ]; then
- IFS=","
+ IFS=""
db_set apt-setup/country $(country_i18n C "$RET")
unset IFS
else
Reply to: