* Christian Perrier [2004-09-02 15:40:22+0200] > A first test shows the patch works and does not seem to break any of > lang/country choosers. > > The only glitch is that when countrychooser is run the second time, > after changing the language, it is run from languagechooser and thus > the country choice window mentions "Choose language"...while the user > is choosing the country...:-) I've revised my patch. The new patch displays a "Choose country" title at least, but unfortunately it can't be displayed in the selected language and I wasn't able to find a solution. Should we consider the situation as "good than nothing"? > Another strange behaviour I had with this. I used the following > sequence: > > boot: linux > At languagechooser, choose French > At countrychooser, choose France > At kbd-config, use Go Back > At main menu, Choose language > At languagechooser, choose English > At countrychooser (launched from languagechooser there), choose India > > Then I was no more prompted for the keyboard even though this step > wasn't completed at the first run. Fixed in the revised patch. I set the title as "Select a keyboard layout" for the kbd-chooser screen (in English). Another change in the revised patch is that, it logs a failure case rather than just returning true. -- roktas
diff -ru languagechooser.orig/languagechooser languagechooser/languagechooser
--- languagechooser.orig/languagechooser 2004-07-25 00:47:11.000000000 +0300
+++ languagechooser/languagechooser 2004-09-02 20:03:14.000000000 +0300
@@ -15,6 +15,12 @@
logger -t languagechooser "info: $@"
}
+# Any other sane way to detect if this is the first run?
+db_get "$languagechooserlocalecode"
+if [ -z "$RET" ]; then
+ is_firsttime="yes"
+fi
+
# debconf/language is an alias for debian-installer/language
db_register "$languagecode" "debconf/language"
@@ -94,6 +100,33 @@
;;
esac
+# FIXME: If the user changes his/her mind for the language later, we
+# should call countrychooser to resolve the languagecode, so that the
+# selected language can be used in the second stage installation.
+# This is just a workaround until we find a better solution.
+if [ ! "$is_firsttime" ]; then
+ (
+ db_get debconf/priority
+ save_priority="$RET"
+
+ # Note that the title will be displayed in English (workaround?).
+ db_title "Choose country"
+ db_set debconf/priority critical
+ countrychooser
+
+ # If keyboard has not been configured yet, configure it.
+ db_get debian-installer/keymap
+ if [ -z "$RET" ]; then
+ db_title "Select a keyboard layout"
+ db_reset console-tools/archs
+ db_set debconf/priority high
+ kbd-chooser
+ fi
+
+ db_set debconf/priority $save_priority
+ ) || log "language reselection failed!"
+fi
+
log "$localecode = '$LOCALE'"
log "$fallbacklocalecode = '$FALLBACKLOCALE'"
log "$languagechooserlocalecode = '$LOCALE'"
Attachment:
signature.asc
Description: Digital signature