summaryrefslogtreecommitdiffstats
path: root/loader2/lang.c
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2002-12-17 03:47:55 +0000
committerMatt Wilson <msw@redhat.com>2002-12-17 03:47:55 +0000
commit5cf18d1e83b4a27e91f5b5ab0293f3d57c4f30e4 (patch)
treeb2a67acc290620af1ccfe4615d1411b0d4da78a6 /loader2/lang.c
parent8db4f8841ae0c9a01e0dc8088e09242cd086874a (diff)
downloadanaconda-5cf18d1e83b4a27e91f5b5ab0293f3d57c4f30e4.tar.gz
anaconda-5cf18d1e83b4a27e91f5b5ab0293f3d57c4f30e4.tar.xz
anaconda-5cf18d1e83b4a27e91f5b5ab0293f3d57c4f30e4.zip
clean up lang.c, remove duplicate codew
fix the Welcome to Red Hat Linux redraw problem eradicate kon2 references, pull in bterm files for initrd/loader stuff use -Os for loader misc. cleanups
Diffstat (limited to 'loader2/lang.c')
-rw-r--r--loader2/lang.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/loader2/lang.c b/loader2/lang.c
index 44b7df48c..4b5d9879e 100644
--- a/loader2/lang.c
+++ b/loader2/lang.c
@@ -133,7 +133,7 @@ void loadLanguage (char * file, int flags) {
int fd, hash, rc;
char * key = getenv("LANGKEY");
- if (!key || !strcmp(key, "en_US.UTF-8")) {
+ if (!key || !strcmp(key, "en")) {
if (strings) {
free(strings), strings = NULL;
numStrings = allocedStrings = 0;
@@ -218,13 +218,18 @@ void setLanguage (char * key, int flags) {
/* returns 0 on success, 1 on failure */
extern int bterm_main(int argc, char **argv);
+
int startBterm(int flags) {
- char *args[4] = { "bterm", "-s", "-f", "/usr/lib/bogl/font.bgf.gz" };
+ char *args[4] = { "bterm", "-s", "-f", NULL };
int rc;
+
+ if (FL_TESTING(flags))
+ args[3] = "font.bgf.gz";
+ else
+ args[3] = "/etc/font.bgf.gz";
stopNewt();
rc = bterm_main(4, args);
- logMessage("returning, rc is %d", rc);
startNewt(flags);
return rc;
}
@@ -278,27 +283,7 @@ int chooseLanguage(char ** lang, int flags) {
/* this can't happen */
if (i == numLanguages) abort();
- if (!strncmp(languages[choice].key, "en", 2)) {
- char *buf;
- /* stick with the default (English) */
- unsetenv("LANG");
- unsetenv("LANGKEY");
- unsetenv("LC_ALL");
- unsetenv("LINGUAS");
- if (strings) {
- free(strings), strings = NULL;
- numStrings = allocedStrings = 0;
- }
- buf = sdupprintf(_(topLineWelcome), PRODUCTNAME);
- newtDrawRootText(0, 0, buf);
- free(buf);
- newtPushHelpLine(_(bottomHelpLine));
-
- return 0;
- }
-
/* load the language only if it is displayable */
- /* disable until working */
if (!strcmp(languages[choice].font, "bterm") && startBterm(flags)) {
newtWinMessage("Language Unavailable", "OK",
"%s display is unavailable in text mode. The "
@@ -308,9 +293,14 @@ int chooseLanguage(char ** lang, int flags) {
return 0;
} else {
setLanguage (languages[choice].key, flags);
- loadLanguage (NULL, flags);
}
-
+
+ /* clear out top line */
+ buf = alloca(80);
+ for (i=0; i < 80; i++)
+ buf[i] = ' ';
+ newtDrawRootText(0, 0, buf);
+
buf = sdupprintf(_(topLineWelcome), PRODUCTNAME);
newtDrawRootText(0, 0, buf);
free(buf);