[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#453041: Country Liechtenstein not in country list when selecting German as language in installer



reassign 453041 locales
retitle 453041 Please provide a locale for German/Liechtenstein
severity 453041 wishlist
thanks

Quoting Josef Vogt (josef.vogt@li-life.li):
> Package: installation-reports
> Version:
>
> When installing debian, when choosing German as language, the country 
> Liechtenstein isn't in the list for German speaking countries. It would be 
> nice also Liechtenstein having in this list, because German is the only 
> official language in Liechtenstein.

Countries that are displayed after the language selection are
countries for which a locale with the given language exists in the
locales package. Not countries for which the given language is an
official language. This is often the same list because, of course,
locales have been written for language/country combinations that make
sense.

The solution to this problem is writing a de_LI locale, which would
definitely make sense.

Writing locales is not that hard: pick up a similar locale on your
system (/usr/share/i18n/locales/de_DE) and modify the
country-dependent parts to fit the new country. Then name it
appropriately (here de_LI).

It of course needs some knwoledge of the said country and the said language.

The only tricky part is that locales files use "Uxxxx" notations which
makes writing them quite tricky. Thankfully, Denis Barbier wrote the
attached scripts, in the past, that help converting file back and
forth from UTF-8 to Uxxxx notation.



-- 


#! /usr/bin/perl -C1

use encoding 'utf8';

sub c {
	my $text = shift;
	my $ret = '';
	my $lastpos = 0;
	while ($text =~ m/\G(.*?)<U(....)>/g) {
		$lastpos = pos($text);
		$ret .= $1;
		my $n = hex($2);
		if ($n < 0x80) {
			$ret .= pack("U", $n);
		} elsif ($n < 0xc0) {
			$ret .= pack("UU", 0xc2, $n);
		} elsif ($n < 0x100) {
			$ret .= pack("UU", 0xc3, $n & 0xbf);
		} else {
			$ret .= pack("U", $n);
		}
	}
	return $ret.substr($text, $lastpos);
}

my $last = '';
while (<>) {
	if ($last ne '') {
		$_ = $last . $_;
		$last = '';
	}
	if (m/\/\s*$/s) {
		s/\/\s*$//s;
		$last = $_;
		next;
	}
	s/"([^"]*)"/'"'.c($1).'"'/eg;
	s/";\s*"/";"/g;
	print;
}

#! /usr/bin/perl -C1

sub c {
	my $text = shift;
	my $convert_ascii = shift;
	my $ret = '';
	while ($text =~ s/(.)//) {
		$l = unpack("U", $1);
		if ($convert_ascii == 0 && $l < 0x80) {
			$ret .= $1;
		} else {
			$ret .= sprintf "<U%04X>", $l;
		}
	}
	return $ret;
}

my $convert_ascii = 1;
while (<>) {
	if (/^LC_IDENTIFICATION/) {
		$convert_ascii = 0;
	} elsif (/^END LC_IDENTIFICATION/) {
		$convert_ascii = 1;
	}
	my $conv = $convert_ascii;
	$conv = 0 if (/^(copy|include)/);
	s/"([^"]*)"/'"'.c($1, $conv).'"'/eg;
	print;
}

Attachment: signature.asc
Description: Digital signature


Reply to: