]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/setup/main.c
IDS: Rename sourcefire VRT rulesets to Talos VRT rulesets
[ipfire-2.x.git] / src / setup / main.c
index 3d47f58f4636634c7259670dd0632d1636baa91a..adb98a2317e8617d2ec4459404daaab6acbfa8d1 100644 (file)
@@ -25,10 +25,10 @@ struct knic knics[20] = { { "" , "" , "" , "" } };
 int main(int argc, char *argv[])
 {
        int choice;
-       char *sections[11]; /* need to fill this out AFTER knowning lang */
+       char *sections[8]; /* need to fill this out AFTER knowning lang */
        int rc;
        struct keyvalue *kv;
-       char selectedshortlang[STRING_SIZE] = "en";
+       char lang[STRING_SIZE] = "en_US.utf8";
        char title[STRING_SIZE];
        int langcounter;
        int autook = 0;
@@ -53,46 +53,25 @@ int main(int argc, char *argv[])
        if (!setlocale(LC_CTYPE,""))
                fprintf(flog, "Locale not spezified. Check LANG, LC_CTYPE, RC_ALL.");
 
-#if 0
        kv = initkeyvalues();
        if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
        {
                printf("%s is not properly installed.\n", NAME);
                return 1;
        }
-       findkey(kv, "LANGUAGE", selectedshortlang);
+       findkey(kv, "LANGUAGE", lang);
 
-       for (langcounter = 0; langtrs[langcounter]; langcounter++)
-       {
-               if (strcmp(selectedshortlang, shortlangnames[langcounter]) == 0)
-               {
-                       ctr = langtrs[langcounter];
-                       break;
-               }
-       }
-
-       if (!ctr)
-       {
-               for (choice = 0; shortlangnames[choice]; choice++)
-               {
-                       if (strcmp(shortlangnames[choice], "en") == 0)
-                               break;
-               }
-               if (!shortlangnames[choice])
-                       goto EXIT;
-               ctr = langtrs[choice];
-       }
-#endif
+       setlocale(LC_ALL, lang);
+       setenv("LANGUAGE", lang, 1);
 
        sections[0] = _("Keyboard mapping");
        sections[1] = _("Timezone");
        sections[2] = _("Hostname");
        sections[3] = _("Domain name");
        sections[4] = _("Networking");
-       sections[5] = _("ISDN");
-       sections[6] = _("'root' password");
-       sections[7] = _("'admin' password");
-       sections[8] = NULL;
+       sections[5] = _("'root' password");
+       sections[6] = _("'admin' password");
+       sections[7] = NULL;
 
        newtInit();
        newtCls();
@@ -104,7 +83,7 @@ int main(int argc, char *argv[])
                title[strlen(title) - 1] = '\0';
            fclose (f_title);
        } else {
-           sprintf (title, "%s %s - %s", NAME, VERSION, SLOGAN);
+           sprintf (title, "%s - %s", NAME, SLOGAN);
        }
        newtDrawRootText(14, 0, title);
        newtPushHelpLine(_("              <Tab>/<Alt-Tab> between elements   |  <Space> selects"));             
@@ -144,14 +123,10 @@ int main(int argc, char *argv[])
                                        break;
                                
                                case 5:
-                                       handleisdn();
-                                       break;
-
-                               case 6:
                                        handlerootpassword();
                                        break;
                                        
-                               case 7:
+                               case 6:
                                        handleadminpassword();
                                        break;
                
@@ -174,8 +149,6 @@ int main(int argc, char *argv[])
                        goto EXIT;
                if (!(handleadminpassword()))
                        goto EXIT;
-               if (!(handleisdn()))
-                       goto EXIT;
                if (!(handlenetworking()))
                        goto EXIT;
                if (!(handledhcp()))
@@ -187,7 +160,7 @@ int main(int argc, char *argv[])
 EXIT:
        if (automode != 0)
        {
-               sprintf (title, "%s %s - %s", NAME, VERSION, SLOGAN);
+               sprintf (title, "%s - %s", NAME, SLOGAN);
                if (autook)
                        newtWinMessage(title, _("OK"), _("Setup is complete."));
                else {