Re: [patch] cdebconf and i18n

2002-11-12 Thread Martin Quinson
On Mon, Nov 11, 2002 at 06:40:02PM +0100, Denis Barbier wrote:
 On Tue, Nov 12, 2002 at 02:39:44AM +0900, Junichi Uekawa wrote:
They are in
language_country.codeset format.
ja_JP is Japan,
pt_BR is Brazil.

What is the problem?
   [...]
   
   Do you really think that there are no Japanese people outside of Japan?
 
  Then they should use ja_CA or whatever they want.

This is not related to what we're speaking about. ja_CA doesn't mean I
speak japanese and live in canada, but I speak the variant of japanese as
spoken in canada.
 
 No, this locale does not exist.

Well, I would say that gettext fallback to ja if ja_CA does not exist.

But I agree that it's a bad idea to use the country part of the local to
guess the place where I live. This field is meant for dialects. For example,
if I speak the brazillian variant of portuguese, I'll use pt_BR. Even if I
live currently in france. Or, if I want to see colour instead of color,
I'll set my local to en_GB (or en_US, I can't remember what is said where ;).

But it does not give you any information on my actual geographical location,
just the language variant I want to use.

Thanks, Mt.

-- 
J'admets que ces nouvelles technologies nous ouvrent d'autres perspectives,
mais je refuse que cela soit au détriment des possibilités anciennes comme
le livre. L'interaction ne doit pas être le tout de la communication. Car,
si elle le devenait, nous ne communiquerions plus qu'entre vivants, ce qui
serait barbare.  
  --- Alain Finkielkraut


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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Junichi Uekawa
 Are you talking about language names?  They are either ll or ll_LL.
 As everything will be UTF-8 encoded, there is no need to add encoding.

There is probably a need to add a UTF-8 encoding something,
but there probably isn't really a need.

Why does it have to be char something[] when
char * something will perfectly work ?




regards,
junichi


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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Junichi Uekawa
  
  I was thinking more of
  if (locale == C) 
  question user;
  else
  get country from locale.
 
 It doesn't work, you can't get country from locale, you must always ask
 user to tell where he lives.  

Huh?

They are in
language_country.codeset format.
ja_JP is Japan,
pt_BR is Brazil.

What is the problem?

 Moreover where does this locale come from?
 IMO we should at the very beginning ask
   a. which language to use for installation
   b. geographic location (a la tzselect/tzconfig)

That is the right direction.
Introducing different locale variable is a wrong thing to do,
however.


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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Denis Barbier
On Sun, Nov 10, 2002 at 10:08:12AM +0900, Junichi Uekawa wrote:
  Are you talking about language names?  They are either ll or ll_LL.
  As everything will be UTF-8 encoded, there is no need to add encoding.
 
 There is probably a need to add a UTF-8 encoding something,
 but there probably isn't really a need.

Huh???

 Why does it have to be char something[] when
 char * something will perfectly work ?

I did not say it has to be a char[6], I do not care if someone wants to
malloc it.

Denis


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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Denis Barbier
On Sun, Nov 10, 2002 at 10:06:51AM +0900, Junichi Uekawa wrote:
   
   I was thinking more of
 if (locale == C) 
 question user;
 else
 get country from locale.
  
  It doesn't work, you can't get country from locale, you must always ask
  user to tell where he lives.  
 
 Huh?
 
 They are in
 language_country.codeset format.
 ja_JP is Japan,
 pt_BR is Brazil.
 
 What is the problem?
[...]

Do you really think that there are no Japanese people outside of Japan?

Denis


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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Martin Sjögren
mån 2002-11-11 klockan 17.17 skrev Denis Barbier:
   It doesn't work, you can't get country from locale, you must always ask
   user to tell where he lives.  
  They are in
  language_country.codeset format.
  ja_JP is Japan,
  pt_BR is Brazil.
  
  What is the problem?
 Do you really think that there are no Japanese people outside of Japan?

I think you're talking past each other. ;-) I think that Junichi means
that we should use the LC_* ll_CC format for the information, while I
think Denis means that there is no way to get this information without
*asking* the user at least *once*

Am I right? Same same, but different...


/Martin



signature.asc
Description: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signeradmeddelandedel


Re: [patch] cdebconf and i18n

2002-11-11 Thread Denis Barbier
On Mon, Nov 11, 2002 at 05:51:49PM +0100, Martin Sjögren wrote:
 mån 2002-11-11 klockan 17.17 skrev Denis Barbier:
It doesn't work, you can't get country from locale, you must always ask
user to tell where he lives.  
   They are in
   language_country.codeset format.
   ja_JP is Japan,
   pt_BR is Brazil.
   
   What is the problem?
  Do you really think that there are no Japanese people outside of Japan?
 
 I think you're talking past each other. ;-) I think that Junichi means
 that we should use the LC_* ll_CC format for the information,

The problem is that CC does not tell where the user is living, it is only
meaningful to distinguish between language variants.  For many reasons, CC
could be different from your country code (e.g. try to set locales to sv_US
or ja_US).

 while I think Denis means that there is no way to get this information
 without *asking* the user at least *once*

Right.

Denis


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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Junichi Uekawa
  They are in
  language_country.codeset format.
  ja_JP is Japan,
  pt_BR is Brazil.
  
  What is the problem?
 [...]
 
 Do you really think that there are no Japanese people outside of Japan?

Then they should use
ja_CA or whatever they want.


regards,
junichi


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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Junichi Uekawa
 
  Why does it have to be char something[] when
  char * something will perfectly work ?
 
 I did not say it has to be a char[6], I do not care if someone wants to
 malloc it.
 

Please use strdup and friends, or asprintf, or other kind of 
things that are less prone to break.



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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Denis Barbier
On Tue, Nov 12, 2002 at 02:39:44AM +0900, Junichi Uekawa wrote:
   They are in
   language_country.codeset format.
   ja_JP is Japan,
   pt_BR is Brazil.
   
   What is the problem?
  [...]
  
  Do you really think that there are no Japanese people outside of Japan?
 
 Then they should use ja_CA or whatever they want.

No, this locale does not exist.

Denis


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




Return values of malloc/strdup/... not checked (was Re: [patch] cdebconf and i18n)

2002-11-11 Thread Denis Barbier
On Tue, Nov 12, 2002 at 02:41:23AM +0900, Junichi Uekawa wrote:
  
   Why does it have to be char something[] when
   char * something will perfectly work ?
  
  I did not say it has to be a char[6], I do not care if someone wants to
  malloc it.
  
 
 Please use strdup and friends, or asprintf, or other kind of 
 things that are less prone to break.

Ok, I will use strdup.  While we are on it, why are return values of
allocation routines never checked?

Denis


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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Junichi Uekawa
   Do you really think that there are no Japanese people outside of Japan?
  
  Then they should use ja_CA or whatever they want.
 
 No, this locale does not exist.

That doesn't really matter if it doesn't currently exist on 
your system. You can always make one.


regards,
junichi


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




Re: Return values of malloc/strdup/... not checked (was Re: [patch] cdebconf and i18n)

2002-11-11 Thread Junichi Uekawa
  Please use strdup and friends, or asprintf, or other kind of 
  things that are less prone to break.
 
 Ok, I will use strdup.  While we are on it, why are return values of
 allocation routines never checked?

You could add checks, or use/define xstrdup to give some
useful error message.

They will cause problem sometime in the future, I suspect,
so fixing them whenever you notice would be a good start.


regards,
junichi


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




Re: [patch] cdebconf and i18n

2002-11-11 Thread Denis Barbier
On Tue, Nov 12, 2002 at 05:13:15AM +0900, Junichi Uekawa wrote:
Do you really think that there are no Japanese people outside of Japan?
   
   Then they should use ja_CA or whatever they want.
  
  No, this locale does not exist.
 
 That doesn't really matter if it doesn't currently exist on 
 your system. You can always make one.

And of course all Japanese people living in Canada did their own, so
you can detect where they live from their locale?  Come on, it does
not work that way, the territory part of locales cannot be reliably
used.

Denis


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




Re: [patch] cdebconf and i18n

2002-11-10 Thread Alastair McKinstry
On Sat, 2002-11-09 at 22:47, Denis Barbier wrote:
 On Sat, Nov 09, 2002 at 05:57:12PM +0100, Alastair McKinstry wrote:
 [...]
Similarly, in some parts of the installer, there is a need to find the
Country. Shouldn't that be found from LC_ALL as well?
   
   No, user must provide this information, it cannot be guessed.
   
  
  I was thinking more of
  if (locale == C) 
  question user;
  else
  get country from locale.
 
 It doesn't work, you can't get country from locale, you must always ask
 user to tell where he lives.  Moreover where does this locale come from?
 IMO we should at the very beginning ask
   a. which language to use for installation
   b. geographic location (a la tzselect/tzconfig)
 
 Denis
 

This is what I expected (and meant). At the start of installation, get
the language and location, and then _store_them_in_the_locale,
ie. set LC_ALL=fr_BE (for French in Belgium, for example).
[ Again, on certain hardware we can help by making intelligent
autodetects of language, and preset the default option, but we would
still ask the question].
Then other parts of the install could read the locale / env. variable.


 
 -- 
 To UNSUBSCRIBE, email to [EMAIL PROTECTED]
 with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
-- 
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



signature.asc
Description: This is a digitally signed message part


Re: [patch] cdebconf and i18n

2002-11-09 Thread Alastair McKinstry
Hi, 

[ Just lurking on d-i for a while, to get up to speed on the design
before contributing].

Why do you use DEBCONF_LANG rather than LANG or LC_ALL ?

Similarly, in some parts of the installer, there is a need to find the
Country. Shouldn't that be found from LC_ALL as well?

Regards,
Alastair McKinstry


On Sat, 2002-11-09 at 03:05, Denis Barbier wrote:
 Here is an improved patch, it has been tested and looks fine.
 Currently language choice is performed by a DEBCONF_LANG environment
 variable.
 In src/modules/db/textdb/textdb.c, the textdb_template_get_real needs
 more work.
 
 Denis
 
 

 Index: debian/changelog
 ===
 RCS file: /cvs/debian-boot/debian-installer/tools/cdebconf/debian/changelog,v
 retrieving revision 1.40
 diff -u -r1.40 changelog
 --- debian/changelog  6 Nov 2002 10:11:37 -   1.40
 +++ debian/changelog  9 Nov 2002 01:21:18 -
 @@ -29,6 +29,13 @@
  - fix confmodule.c and commands.c to not use fixed-size
buffers. (closes: #167312)
* Denis Barbier:
 +- change internal template structure in src/template.h in order
 +  to help managing localized fields, and fix doc/modules.txt
 +  accordingly
 +- define accessors to get and set template values, should be used
 +  everywhere instead of direct access to structure members
 +- partially handle localized fields, only UTF-8 templates files
 +  are considered
  - convert to po-debconf, set Build-Depends: debhelper (= 4.1.13)
to ensure that generated templates are right, and set output encoding
to UTF-8.
 Index: doc/modules.txt
 ===
 RCS file: /cvs/debian-boot/debian-installer/tools/cdebconf/doc/modules.txt,v
 retrieving revision 1.7
 diff -u -r1.7 modules.txt
 --- doc/modules.txt   1 Jul 2002 06:58:37 -   1.7
 +++ doc/modules.txt   9 Nov 2002 01:21:18 -
 @@ -36,20 +36,37 @@
  A template has the following publically accessible fields:
  
  - char *tag: the template's tag
 -- char *type: the template's type XXX can be one of ...
 -- char *defaultval: the template's default value, as a string
 -- char *choices: if the template's type is choices based, here the choices
 - are listed in a single string, seperated by commas XXX right?
 -- char *description: a description of the template XXX must be under ... chars?
 -- char *extended_description: a longer description 
 -- struct language_description *localized descriptions - has following fields:
 -  - struct language_description *next: NULL or another localized description
 -  - char *language: ISO tag for language XXX right?
 -  - char *choices, char *description, char *extended_description: as above,
 -only in specified language
 -  
 +- char *type: the template's type, can be one of select, multiselect,
 +  string, boolean, note, text and password
 +- struct template_l10n_fields *fields - has following fields:
 +  - struct template_l10n_fields *next: NULL or another localized field
 +   structure
 +  - char *language: ISO code for language (ll or ll_LL)
 +  - char *defaultval: the template's default value, as a string
 +  - char *choices: if the template's type is choices based, here the choices
 +   are listed in a single string, seperated by commas
 +  - char *description: a description of the template XXX must be under ... chars?
 +  - char *extended_description: a longer description 
 +
 +The first template_l10n_fields structure must always be in English, and
 +its ISO code is set to C.
 +
  XXX not covering next, I assume it is private
  XXX not covering memory management or deletion
 +
 +Publically accessible methods:
 +
 +const char *lget(struct template *, const char *lang, const char *field):
 +   Return a string value for given field in a language, or NULL if not found
 +
 +void lset(struct template *, const char *lang, const char *field, const char 
*value):
 +   Save string value at field for a given language
 +
 +const char *get(struct template *, const char *field):
 +   Return a string value for given field in English
 +
 +void set(struct template *, const char *field, const char *value):
 +   Save string value at English field
  
  question API
  
 Index: src/commands.c
 ===
 RCS file: /cvs/debian-boot/debian-installer/tools/cdebconf/src/commands.c,v
 retrieving revision 1.24
 diff -u -r1.24 commands.c
 --- src/commands.c5 Nov 2002 02:55:13 -   1.24
 +++ src/commands.c9 Nov 2002 01:21:18 -
 @@ -614,14 +614,14 @@
   if (strcmp(field, value) == 0)
   snprintf(out, outsize, %u %s, CMDSTATUS_SUCCESS, q-value);
   else if (strcmp(field, description) == 0)
 - snprintf(out, outsize, %u %s, CMDSTATUS_SUCCESS, 

Re: [patch] cdebconf and i18n

2002-11-09 Thread Junichi Uekawa

There are two points I am unconfortable with this patch:

Why not use locale information ? (it is needed for some frontend and
other things)

and why is the country information 6-chars long?


regards,
junichi


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




Re: [patch] cdebconf and i18n

2002-11-09 Thread Denis Barbier
On Sat, Nov 09, 2002 at 11:37:07AM +0100, Alastair McKinstry wrote:
 Hi, 
 
 [ Just lurking on d-i for a while, to get up to speed on the design
 before contributing].
 
 Why do you use DEBCONF_LANG rather than LANG or LC_ALL ?

No good reason.  This is just a temporary workaround until a better
solution is provided (via a debconf template), so I did not carefully
think about it.

 Similarly, in some parts of the installer, there is a need to find the
 Country. Shouldn't that be found from LC_ALL as well?

No, user must provide this information, it cannot be guessed.

Denis


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




Re: [patch] cdebconf and i18n

2002-11-09 Thread Denis Barbier
On Sat, Nov 09, 2002 at 11:58:35PM +0900, Junichi Uekawa wrote:
 
 There are two points I am unconfortable with this patch:
 
 Why not use locale information ? (it is needed for some frontend and
 other things)

[I replied in another message]

 and why is the country information 6-chars long?

Are you talking about language names?  They are either ll or ll_LL.
As everything will be UTF-8 encoded, there is no need to add encoding.

Denis


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




Re: [patch] cdebconf and i18n

2002-11-09 Thread Alastair McKinstry
On Sat, 2002-11-09 at 16:17, Denis Barbier wrote:
 On Sat, Nov 09, 2002 at 11:37:07AM +0100, Alastair McKinstry wrote:
  Hi, 
  
  [ Just lurking on d-i for a while, to get up to speed on the design
  before contributing].
  
  Why do you use DEBCONF_LANG rather than LANG or LC_ALL ?
 
 No good reason.  This is just a temporary workaround until a better
 solution is provided (via a debconf template), so I did not carefully
 think about it.
 
  Similarly, in some parts of the installer, there is a need to find the
  Country. Shouldn't that be found from LC_ALL as well?
 
 No, user must provide this information, it cannot be guessed.
 

I was thinking more of
if (locale == C) 
question user;
else
get country from locale.

(This being done early in the install, I suppose. It is even possible in
some places to get this automatically. I know some Compaq Alphaservers
for example have the country setting in the BIOS equivalent; its
possible to autodetect country there. (and correct as necessary).

I am reworking the debconf questions for console-* (of which I'm
maintainer) and need to know the country for the keyboard setting.
It seems to be available in debconf and, due to POSIX, the locale, and
was wondering why 
(1) its in debconf
(2) why can't we get it from the system locale / store it there



 Denis
 
 
 -- 
 To UNSUBSCRIBE, email to [EMAIL PROTECTED]
 with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
-- 
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



signature.asc
Description: This is a digitally signed message part


Re: [patch] cdebconf and i18n

2002-11-09 Thread Denis Barbier
On Sat, Nov 09, 2002 at 05:57:12PM +0100, Alastair McKinstry wrote:
[...]
   Similarly, in some parts of the installer, there is a need to find the
   Country. Shouldn't that be found from LC_ALL as well?
  
  No, user must provide this information, it cannot be guessed.
  
 
 I was thinking more of
   if (locale == C) 
   question user;
   else
   get country from locale.

It doesn't work, you can't get country from locale, you must always ask
user to tell where he lives.  Moreover where does this locale come from?
IMO we should at the very beginning ask
  a. which language to use for installation
  b. geographic location (a la tzselect/tzconfig)

Denis


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