mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
setup: Fix languages
This commit is contained in:
@@ -28,7 +28,7 @@ int main(int argc, char *argv[])
|
|||||||
char *sections[11]; /* need to fill this out AFTER knowning lang */
|
char *sections[11]; /* need to fill this out AFTER knowning lang */
|
||||||
int rc;
|
int rc;
|
||||||
struct keyvalue *kv;
|
struct keyvalue *kv;
|
||||||
char selectedshortlang[STRING_SIZE] = "en";
|
char lang[STRING_SIZE] = "en_US.utf8";
|
||||||
char title[STRING_SIZE];
|
char title[STRING_SIZE];
|
||||||
int langcounter;
|
int langcounter;
|
||||||
int autook = 0;
|
int autook = 0;
|
||||||
@@ -53,36 +53,16 @@ int main(int argc, char *argv[])
|
|||||||
if (!setlocale(LC_CTYPE,""))
|
if (!setlocale(LC_CTYPE,""))
|
||||||
fprintf(flog, "Locale not spezified. Check LANG, LC_CTYPE, RC_ALL.");
|
fprintf(flog, "Locale not spezified. Check LANG, LC_CTYPE, RC_ALL.");
|
||||||
|
|
||||||
#if 0
|
|
||||||
kv = initkeyvalues();
|
kv = initkeyvalues();
|
||||||
if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
|
if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
|
||||||
{
|
{
|
||||||
printf("%s is not properly installed.\n", NAME);
|
printf("%s is not properly installed.\n", NAME);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
findkey(kv, "LANGUAGE", selectedshortlang);
|
findkey(kv, "LANGUAGE", lang);
|
||||||
|
|
||||||
for (langcounter = 0; langtrs[langcounter]; langcounter++)
|
setlocale(LC_ALL, lang);
|
||||||
{
|
setenv("LANGUAGE", lang, 1);
|
||||||
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
|
|
||||||
|
|
||||||
sections[0] = _("Keyboard mapping");
|
sections[0] = _("Keyboard mapping");
|
||||||
sections[1] = _("Timezone");
|
sections[1] = _("Timezone");
|
||||||
|
|||||||
@@ -264,8 +264,7 @@ int firstmenu(void)
|
|||||||
x--;
|
x--;
|
||||||
if (x < 0 || x > 4) x = 0;
|
if (x < 0 || x > 4) x = 0;
|
||||||
/* Format heading bit. */
|
/* Format heading bit. */
|
||||||
snprintf(message, 1000, _("Current config: %s%s"), configtypenames[x],
|
snprintf(message, 1000, _("Current config: %s\n\n%s"), configtypenames[x], networkrestart);
|
||||||
networkrestart);
|
|
||||||
rc = newtWinMenu(_("Network configuration menu"), message, 50, 5, 5, 6,
|
rc = newtWinMenu(_("Network configuration menu"), message, 50, 5, 5, 6,
|
||||||
sections, &choice, _("OK"), _("Done"), NULL);
|
sections, &choice, _("OK"), _("Done"), NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user