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

Re: cdebconf always falling back to English?



On Sun, Apr 06, 2003 at 07:21:31PM +0200, Petter Reinholdtsen wrote:
> [Denis Barbier]
> > But it does work in languagechooser, doesn't it?  Changing language
> > takes effect immediately.
> 
> When languagechooser is finished, main-menu detect that it is a
> package providing language-selected, and HUPs cdebconf to tell it to
> check the language.  It isn't languagechooser bug main-menu that
> signals cdebconf to switch to another language.

Oh yes. you are right.

> > I don't understand, appending 'en' to LANGUAGE is harmful.
> 
> It would not append, it would replace.  The current language is
> unknown at that point in /sbin/debian-installer.

Ok I had boot parameters in mind, but maybe you are thinking about
pre-existing answers in debconf databases.

> I'll try to think of a way to fix it.

Well cdebconf should certainly have some '#ifdef DEBIAN_INSTALLER'
because there are always special cases.  Here is a patch against
template.c (not tested), but finding a better solution might be
a good idea.

Denis
Index: template.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/tools/cdebconf/src/template.c,v
retrieving revision 1.21
diff -u -r1.21 template.c
--- template.c	19 Dec 2002 00:38:44 -0000	1.21
+++ template.c	6 Apr 2003 20:39:47 -0000
@@ -54,26 +54,29 @@
 			free(p);
 			p = q;
 		}
-		cache_list_lang_ptr = NULL;
-		if (envlang == NULL)
-			return NULL;
-
 		cache_list_lang_ptr = (struct cache_list_lang *)
 			malloc(sizeof(struct cache_list_lang));
 		memset(cache_list_lang_ptr, 0, sizeof(struct cache_list_lang *));
 
 		p = cache_list_lang_ptr;
-		cache_cur_lang = strdup(envlang);
-		cpb = cache_cur_lang;
-		while((cpe = strchr(cpb, ':')) != NULL)
+		if (envlang != NULL)
 		{
-			p->lang = strndup(cpb, (int) (cpe - cpb));
+			cpb = cache_cur_lang;
+			while((cpe = strchr(cpb, ':')) != NULL)
+			{
+				p->lang = strndup(cpb, (int) (cpe - cpb));
+				p->next = (struct cache_list_lang *)
+						malloc(sizeof(struct cache_list_lang));
+				cpb = cpe + 1;
+				p = p->next;
+			}
+			p->lang = strdup(cpb);
 			p->next = (struct cache_list_lang *)
 					malloc(sizeof(struct cache_list_lang));
-			cpb = cpe + 1;
 			p = p->next;
 		}
-		p->lang = strdup(cpb);
+		/*  In debian-installer always fall back to en.UTF-8  */
+		p->lang = strdup("en");
 		p->next = NULL;
 	}
 

Reply to: