Re: Sorting is implemented in cdebconf CVS (was Re: Countrychooser commited in CVS)

2004-01-28 Thread Christian Perrier
Quoting Joey Hess ([EMAIL PROTECTED]):

 We have 20 kilobytes free on the root floppy. Don't make me laugh..


OK, OK, I understand : I was absolutely unaware of these room
problems. So, currently, Denis proposal seems to be the only way to
get sorting properly work at least in very early packages.

THe problem is : it is quite complicated and I'm not sure all
translators will be able to make it. Moreover, it breaks the initial
idea of completely forgetting having the country list in one of our
packages, but rely on the iso-codes package.

Maybe we'd better forget about sorting in countrychooser : your region
sorting system is already enough for having people easily find their
own country.


Moreover, the ideas which float around languagechooser/countrychooser
may modify all this with the whole country list menu being showed
very rarely to users.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Sorting is implemented in cdebconf CVS (was Re: Countrychooser commited in CVS)

2004-01-27 Thread Denis Barbier
On Tue, Jan 27, 2004 at 07:37:25AM +0100, Christian Perrier wrote:
[...]
* This script should be split into 2 parts:
a. print the sorted list (ie $output) into a file sorted.$lang
b. read sorted.$lang files and add Indices fields.
  This way sorted.$lang files could be put under CVS wings and
  translators might check that countries are sorted as expected.
  Maintainer can run (b) without having locales installed.
 
 Seems to be the only way
 
 However, in the meantime, the country sorting by region has been added
 by Joey.

For English names only.

 No idea if this changes the proposed scheme. I don't really
 like having sorted.* files in CVS as this loses one advantage we had
 until then : the translations were completely outside the
 package. With this, we somewhat put them again in the package

I am afraid that there is no other solution if you want sorted entries
before the locales package is installed.

Denis


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Sorting is implemented in cdebconf CVS (was Re: Countrychooser commited in CVS)

2004-01-27 Thread Christian Perrier
Quoting Denis Barbier ([EMAIL PROTECTED]):

  However, in the meantime, the country sorting by region has been added
  by Joey.
 
 For English names only.

Hmmmwith translated names, the countries are properly distributed
in regionsOf course, inside the regions lists, the sorting is
still made with regards to English of course.

 
  No idea if this changes the proposed scheme. I don't really
  like having sorted.* files in CVS as this loses one advantage we had
  until then : the translations were completely outside the
  package. With this, we somewhat put them again in the package
 
 I am afraid that there is no other solution if you want sorted entries
 before the locales package is installed.

Any chance to get the locales package installed *before* running all
this? Maybe an udeb with only the needed stuff?


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Sorting is implemented in cdebconf CVS (was Re: Countrychooser commited in CVS)

2004-01-27 Thread Joey Hess
Christian Perrier wrote:
 Any chance to get the locales package installed *before* running all
 this? Maybe an udeb with only the needed stuff?

We have 20 kilobytes free on the root floppy. Don't make me laugh..

-- 
see shy jo


signature.asc
Description: Digital signature


Sorting is implemented in cdebconf CVS (was Re: Countrychooser commited in CVS)

2004-01-26 Thread Denis Barbier
On Fri, Jan 16, 2004 at 09:07:56PM +0100, Denis Barbier wrote:
 On Fri, Jan 16, 2004 at 07:15:28AM +0100, Christian Perrier wrote:
 [...]
  I first need to add some sorting in English.and after this, we
  will be thrown in the known problem of translations sorting (which is
  not countrychooser specific, by the way)
 
 This requires changes in cdebconf, so you should not focus on it now.

Sorting cannot be performed at run-time because locales package is not
installed.  Sorting items when building packages is painful because
the needed UTF-8 locales have to be installed.  So the only option is
to statically build sorted lists.  Thus I implemented a new field in
cdebconf to tell in which order items have to be displayed.  Consider
for instance:
  Choices: a, b, c
  Choices-ll.UTF-8: x, y, z
  Indices-ll.UTF-8: 3, 1, 2
The first 2 lines have their usual meaning, ie. 'a' is translated into
'x', 'b' into 'y' and 'c' into 'z'.  The Indices field tells that items
must be displayed as z, x, y for this language.
This has been tested on countrychooser with the help of the attached
script;
  $ sort_countries --lang=fr --locale=fr_FR.UTF-8 \
   debian/templates  debian/templates.sorted
Now if templates is replaced by templates.sorted, countries are sorted.

Remaining issues:
  * iso-codes French translation contains commas, which confuses
cdebconf.  Other languages have surely the same problem.
  * This script should be split into 2 parts:
  a. print the sorted list (ie $output) into a file sorted.$lang
  b. read sorted.$lang files and add Indices fields.
This way sorted.$lang files could be put under CVS wings and
translators might check that countries are sorted as expected.
Maintainer can run (b) without having locales installed.

Denis
#! /usr/bin/perl -w

use Getopt::Long;
use POSIX;
use locale;

binmode STDIN, ':utf8';
binmode STDOUT, ':utf8';

my $lang = '';
my $locale = '';
GetOptions (lang=s = \$lang, locale=s = \$locale);

die Usage: sort_countries --lang=langcode --locale=locale
unless length($lang)  0  length($locale)  0;
setlocale(LC_ALL, $locale);
my $cnt = 0;
while () {
print;
next unless s/Choices-$lang.UTF-8: //;
chomp;
my @list = split(/, /);
my @block = ();
my $output = '';
for my $country (@list) {
chomp $country;
if ($country =~ m/^\x{00a0}/) {
$cnt++;
push @block, $country. .$cnt;
} else {
$output .= join(\n, sort @block).\n if (@block);
@block = ();
$cnt++;
$output .= $country. .$cnt.\n;
}
}
$output .= join(\n, sort @block).\n if (@block);
$output =~ s/.*? (\d+)$/$1/mg;
$output =~ s/\n/, /g;
$output =~ s/, $//;
print Indices-$lang.UTF-8: $output\n;
}
1;


Re: Sorting is implemented in cdebconf CVS (was Re: Countrychooser commited in CVS)

2004-01-26 Thread Christian Perrier
Quoting Denis Barbier ([EMAIL PROTECTED]):

 This has been tested on countrychooser with the help of the attached
 script;
   $ sort_countries --lang=fr --locale=fr_FR.UTF-8 \
debian/templates  debian/templates.sorted
 Now if templates is replaced by templates.sorted, countries are sorted.

How do you think this could be included in countrychooser? I'm
reluctant at doing this myself as either you or someone else will
probably do it better and cleanly.

 
 Remaining issues:
   * iso-codes French translation contains commas, which confuses
 cdebconf.  Other languages have surely the same problem.

Several languages have this problem. While writing the very first
countrychooser, I took care of this for english strings but forgot to
do so for translations.

   * This script should be split into 2 parts:
   a. print the sorted list (ie $output) into a file sorted.$lang
   b. read sorted.$lang files and add Indices fields.
 This way sorted.$lang files could be put under CVS wings and
 translators might check that countries are sorted as expected.
 Maintainer can run (b) without having locales installed.

Seems to be the only way

However, in the meantime, the country sorting by region has been added
by Joey. No idea if this changes the proposed scheme. I don't really
like having sorted.* files in CVS as this loses one advantage we had
until then : the translations were completely outside the
package. With this, we somewhat put them again in the package



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-18 Thread Christian Perrier
Quoting Joey Hess ([EMAIL PROTECTED]):

 Speaking of which, someone should look into a way to make the KDE setup
 wizard be feed the debian-installer/country setting to avoid
 re-prompting for country.

And all packages using their own language selection template be fed by
debian-installer/language

Ahem...geneweb...:-)



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-17 Thread Christian Perrier
Quoting Joey Hess ([EMAIL PROTECTED]):

 I have changed tzsetup to do this in base-config's cvs. It seems pretty
 sweet, but could use some more testing.

/me compiles base-config from CVS...


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-17 Thread Christian Perrier
(Alastair, this is a discussion in -boot about countrychooser, a new
d-i package, which makes use of your iso-codes package. I need to talk
with you about some issues)

Quoting Joey Hess ([EMAIL PROTECTED]):

 That's interesting. This is a place where cdebconf deviates from the
 debconf spec, apparently; ,  is the official list delimiter.

I added the separating space, but I confirm that all works fine
without it with cdebconf

 Well I was wondering about geographical drill-down, or just geographical
 groupings/headings in the list:
 
   Europe
   Germany
   France
   Spain
   ...
   America
   US
   Canada
   Mexico
   ...
 
 But like I said, I'll reserve comment until I've seen it.

Well, the problem here is that we do not have a valuable source for
doing this. ISO code lists do no give information about such zones.

I think users in general are quite well aware of such long lists :
these country lists are what you find on each and every  form which
asks you for your address (those which continue to list French Guyane
near France).

As long as the form is sorted, any user may easily find his country by
typing the first letter of its official name which I hopê they're
aware of.

The *current* list is a bt broken, according to Alastair (who
maintains the iso-codes packages it's taken from). For instance,
Great-Britain is listed there as Britain which is obviously
bugguy.

I'm waiting for Alastair to release a new version of iso-codes with
updated codes and translations.

I will also ask him for a iso-3166-udeb package as countrychooser
needs the iso-3166.tab file as reference.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-17 Thread Christian Perrier
Dia is Muire duit,

(freelang is my friend..:-))

Am Sath, 2004-01-17 ag 08:47, scríobh Alastair McKinstry:

  I will also ask him for a iso-3166-udeb package as countrychooser
  needs the iso-3166.tab file as reference.
 
 Ok, that I can do. Should it just contain the .tab file, or the .po
 files too?

I just need the tab file in /usr/share/iso-codes.

The translations are used at build-time. I msgunformat them from *.mo
files. This is why countrychooser build-depends on iso-codes.

You mentioned me that you're working on translations updates. Can you
notify me before uploading the new iso-codes so that I update french.

Countrychooser build needs 100% translations for iso-3166.tab so that
its own templates are completely translated. This is because
po2debconf uses __Choices translation only when all choices are
translated and unfuzzied.

This will probably lead some input for you as iso-codes maintainer,
because I will ask d-i translation teams to have a look at iso-codes
translations for their own languages.

If needed, and if this is too much overhead for you, I offer
co-maintaining the package.



(switch to IRC if needed)




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-17 Thread Alastair McKinstry
Am Sath, 2004-01-17 ag 08:03, scrobh Christian Perrier:
 (Alastair, this is a discussion in -boot about countrychooser, a new
 d-i package, which makes use of your iso-codes package. I need to talk
 with you about some issues)
 
 Quoting Joey Hess ([EMAIL PROTECTED]):
 
  That's interesting. This is a place where cdebconf deviates from the
  debconf spec, apparently; ,  is the official list delimiter.
 
 I added the separating space, but I confirm that all works fine
 without it with cdebconf
 
  Well I was wondering about geographical drill-down, or just geographical
  groupings/headings in the list:
  
  Europe
  Germany
  France
  Spain
  ...
  America
  US
  Canada
  Mexico
  ...
  
  But like I said, I'll reserve comment until I've seen it.
 
 Well, the problem here is that we do not have a valuable source for
 doing this. ISO code lists do no give information about such zones.

Yes.  I want to avoid expanding the role of iso-codes at the moment, as
it is designed to be a small component for many packages: its hard to
convince a developer to bloat their package by making it depend on
yours if you keep expanding your package to include new things.
So I think the information about zones should stay in countrychooser for
the moment.

 I think users in general are quite well aware of such long lists :
 these country lists are what you find on each and every  form which
 asks you for your address (those which continue to list French Guyane
 near France).
 
 As long as the form is sorted, any user may easily find his country by
 typing the first letter of its official name which I hop they're
 aware of.
 
 The *current* list is a bt broken, according to Alastair (who
 maintains the iso-codes packages it's taken from). For instance,
 Great-Britain is listed there as Britain which is obviously
 bugguy.

Yes.  It should match the Great Britain returned from the locale, eg.
that returned by nl_langinfo(), so you could do 
localised_ctryname = dgettext(iso_3166,
nl_langinfo(_NL_IDENTIFICATION_TERRITORY));

I would also like iso_3166.tab to match /usr/share/zoneinfo/iso3166.tab
(and so replace it later), but at the moment iso3166.tab uses Britain
(UK), so at the moment these two goals conflict. Working on it.

 I'm waiting for Alastair to release a new version of iso-codes with
 updated codes and translations.
 
 I will also ask him for a iso-3166-udeb package as countrychooser
 needs the iso-3166.tab file as reference.

Ok, that I can do. Should it just contain the .tab file, or the .po
files too?

- Alastair

-- 
Sln agus Beannacht,
Alastair

Alastair McKinstry [EMAIL PROTECTED]
GPG Key fingerprint = 9E64 E714 8E08 81F9 F3DC  1020 FA8E 3790 9051 38F4

He that would make his own liberty secure must guard even his enemy from
oppression; for if he violates this duty he establishes a precedent that
will reach to himself.

- --Thomas Paine


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-17 Thread Matt Kraai
On Fri, Jan 16, 2004 at 11:44:20AM -0500, Joey Hess wrote:
 Well I was wondering about geographical drill-down, or just geographical
 groupings/headings in the list:
 
   Europe
   Germany
   France
   Spain
   ...
   America
   US
   Canada
   Mexico
   ...
 
 But like I said, I'll reserve comment until I've seen it.

This regional scheme is used by KDE when I start it for the first
time.  If we decide to use it, we may be able to reuse some of
their work.

-- 
Matt Kraai [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-17 Thread Joey Hess
Matt Kraai wrote:
 On Fri, Jan 16, 2004 at 11:44:20AM -0500, Joey Hess wrote:
  Well I was wondering about geographical drill-down, or just geographical
  groupings/headings in the list:
  
  Europe
  Germany
  France
  Spain
  ...
  America
  US
  Canada
  Mexico
  ...
  
  But like I said, I'll reserve comment until I've seen it.
 
 This regional scheme is used by KDE when I start it for the first
 time.  If we decide to use it, we may be able to reuse some of
 their work.

Speaking of which, someone should look into a way to make the KDE setup
wizard be feed the debian-installer/country setting to avoid
re-prompting for country.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Countrychooser commited in CVS

2004-01-16 Thread Christian Perrier
Quoting Joey Hess ([EMAIL PROTECTED]):
 Shouldn't there be spaces between the country names in the Choices list?

Well, as this is automatically generated, I figured that this wasn't a
problem. The file is only processed by cdebconf which is very happy
with it as it is...

 I'm also concerned that this is a _very_ long list of countries to
 scroll through, but I have not actually ran the program yet.


Well, for sure it is long, but this is the Official List of Countries
in the World.removing some of these would throw us into  very bad
political problems. So let's be very politically correct and use all
of them, including French Southern Territories... I'm pretty sure
Debian is used in Terre Adélie or Kerguelen Islands by the folks of
Météo French there...:-)

So, our only hope is a world becoming a bit less crazy and stopping to
create new countries monthly.

Seriously speaking, the list sorting is more of a concern. 

I first need to add some sorting in English.and after this, we
will be thrown in the known problem of translations sorting (which is
not countrychooser specific, by the way)


 
  -look at other places which ask for a country (mirror location,
   timezone configuration) and adapt these for using
   debian-installer/country. However, the country list there is probably
   shorter than the world country list..:-)
 
 I wish we could somehow eliminate one of those other questions entirely,
 so the total number of questions asked by the installer remains the
 same.

I wish so too. The choose-mirror country list is a first good
target. The time zone configuraiton dialogs are not, probably because
of the multiple timezones in some exotic countries..:-)



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-16 Thread Christian Perrier
 The mirror question, based on the wording and intent (pick someone
 topologically close to you, even if they're across the border), will
 need to stay, I think.

I personnaly doubt that several users will choose something else than
their own country. How many people in the world are able to know that,
say, ftp.de.debian.org is topologically closer to them than
ftp.fr.debian.org?

Maybe, the mirror country question should have a lower priority. This
would allow experts to use any mirror and common users to have one
less question.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-16 Thread Joey Hess
Steve Langasek wrote:
 I believe it should be possible to eliminate the extra timezone question
 for users in most countries, but this will take some work to script
 sanely.

You're thinking about making it look at the country and boil that down
to a list of timezones inside the country, I suppose. Using zone.tab for
the mapping. Unfortunalty, some people will want GMT, and since someone
could be doing something strange, I will probably need an other that
falls back to the current drill down behavior. 

So that's a minimum of three entries in the list (many more for US,
thank you Indiana), so debconf will still always display the question.
But we do save one question overall this way, which nicely balances out
the question added by splitting languagechooser. And I think time zone
selection this way will be much less confusing -- I can never remember
whether to choose America or US with the current system (the US's
entries are actually split between them for maximum confusion); and when
I want GMT, I often forget where it's hidden.

Well this will be a nice little project.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Countrychooser commited in CVS

2004-01-16 Thread Joey Hess
Christian Perrier wrote:
 I personnaly doubt that several users will choose something else than
 their own country. How many people in the world are able to know that,
 say, ftp.de.debian.org is topologically closer to them than
 ftp.fr.debian.org?
 
 Maybe, the mirror country question should have a lower priority. This
 would allow experts to use any mirror and common users to have one
 less question.

Maybe it should be smarter somehow -- do some basic testing of the
route, if it seems excessively long/lossy, then re-ask with the full
list. And yes, always ask with the full list in expert mode.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Countrychooser commited in CVS

2004-01-16 Thread Joey Hess
Christian Perrier wrote:
 Quoting Joey Hess ([EMAIL PROTECTED]):
  Shouldn't there be spaces between the country names in the Choices list?
 
 Well, as this is automatically generated, I figured that this wasn't a
 problem. The file is only processed by cdebconf which is very happy
 with it as it is...

That's interesting. This is a place where cdebconf deviates from the
debconf spec, apparently; ,  is the official list delimiter.

 Well, for sure it is long, but this is the Official List of Countries
 in the World.removing some of these would throw us into  very bad
 political problems. So let's be very politically correct and use all
 of them, including French Southern Territories... I'm pretty sure
 Debian is used in Terre Adélie or Kerguelen Islands by the folks of
 Météo French there...:-)
 
 So, our only hope is a world becoming a bit less crazy and stopping to
 create new countries monthly.
 
 Seriously speaking, the list sorting is more of a concern. 
 
 I first need to add some sorting in English.and after this, we
 will be thrown in the known problem of translations sorting (which is
 not countrychooser specific, by the way)

Well I was wondering about geographical drill-down, or just geographical
groupings/headings in the list:

Europe
Germany
France
Spain
...
America
US
Canada
Mexico
...

But like I said, I'll reserve comment until I've seen it.


This is, to my mind, one of the few places where a GUI can really
benefit an installer. Although those clicky world maps must be annoying
for those who live in very small countries.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Countrychooser commited in CVS

2004-01-16 Thread Steve Langasek
On Fri, Jan 16, 2004 at 09:42:34AM +0100, Christian Perrier wrote:
  The mirror question, based on the wording and intent (pick someone
  topologically close to you, even if they're across the border), will
  need to stay, I think.

 I personnaly doubt that several users will choose something else than
 their own country. How many people in the world are able to know that,
 say, ftp.de.debian.org is topologically closer to them than
 ftp.fr.debian.org?

I gather that this is the sort of thing that's passed word-of-mouth
among Debian users in the affected countries.

 Maybe, the mirror country question should have a lower priority. This
 would allow experts to use any mirror and common users to have one
 less question.

Agreed.

Cheers,
-- 
Steve Langasek
postmodern programmer


pgp0.pgp
Description: PGP signature


Re: Countrychooser commited in CVS

2004-01-16 Thread Denis Barbier
On Fri, Jan 16, 2004 at 07:15:28AM +0100, Christian Perrier wrote:
[...]
 I first need to add some sorting in English.and after this, we
 will be thrown in the known problem of translations sorting (which is
 not countrychooser specific, by the way)

This requires changes in cdebconf, so you should not focus on it now.

Denis


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Countrychooser commited in CVS

2004-01-16 Thread Joey Hess
I wrote:
 You're thinking about making it look at the country and boil that down
 to a list of timezones inside the country, I suppose. Using zone.tab for
 the mapping. Unfortunalty, some people will want GMT, and since someone
 could be doing something strange, I will probably need an other that
 falls back to the current drill down behavior. 
 
I have changed tzsetup to do this in base-config's cvs. It seems pretty
sweet, but could use some more testing.
 
-- 
see shy jo


signature.asc
Description: Digital signature


Re: Countrychooser commited in CVS

2004-01-15 Thread Joey Hess
Shouldn't there be spaces between the country names in the Choices list?
I'm also concerned that this is a _very_ long list of countries to
scroll through, but I have not actually ran the program yet.

 -look at other places which ask for a country (mirror location,
  timezone configuration) and adapt these for using
  debian-installer/country. However, the country list there is probably
  shorter than the world country list..:-)

I wish we could somehow eliminate one of those other questions entirely,
so the total number of questions asked by the installer remains the
same.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: Countrychooser commited in CVS

2004-01-15 Thread Steve Langasek
On Thu, Jan 15, 2004 at 01:54:25PM -0500, Joey Hess wrote:
 Shouldn't there be spaces between the country names in the Choices list?
 I'm also concerned that this is a _very_ long list of countries to
 scroll through, but I have not actually ran the program yet.

  -look at other places which ask for a country (mirror location,
   timezone configuration) and adapt these for using
   debian-installer/country. However, the country list there is probably
   shorter than the world country list..:-)

 I wish we could somehow eliminate one of those other questions entirely,
 so the total number of questions asked by the installer remains the
 same.

I believe it should be possible to eliminate the extra timezone question
for users in most countries, but this will take some work to script
sanely.

The mirror question, based on the wording and intent (pick someone
topologically close to you, even if they're across the border), will
need to stay, I think.

Cheers,
-- 
Steve Langasek
postmodern programmer


pgp0.pgp
Description: PGP signature