diff --git a/exec/bullseye.js b/exec/bullseye.js index a5f3e65dd74bf4ec6c025f2eda2117deba139906..c3de0da67eeb91520b85e19e45f2922fad9241f1 100644 --- a/exec/bullseye.js +++ b/exec/bullseye.js @@ -7,6 +7,7 @@ // @format.tab-size 4, @format.use-tabs true require("sbbsdefs.js", "P_NOERROR"); +require("gettext.js", 'gettext'); "use strict"; @@ -48,7 +49,7 @@ if(bull.length < 1) { while(bbs.online && !js.terminated) { if(bbs.menu("../bullseye", P_NOERROR)) { - console.mnemonics("\r\nEnter number of bulletin or [~Quit]: "); + console.mnemonics(gettext("\r\nEnter number of bulletin or [~Quit]: ")); b = console.getnum(bull.length); } else { for(i = 0; i < bull.length; ++i) diff --git a/exec/login.js b/exec/login.js index 347eb97e9e827ceef7ce6c816685adec43091ba6..e97e2ce6ea01ba976b6f2af868cf34b4b024fbb9 100644 --- a/exec/login.js +++ b/exec/login.js @@ -67,11 +67,12 @@ for(var c=0; c < options.login_prompts; c++) { if(!str.length) // blank continue; + // New user application? if(str.toUpperCase()=="NEW") { if(bbs.newuser()) { - bbs.logon(); - exit(); + bbs.logon(); + exit(); } continue; } diff --git a/exec/logon.js b/exec/logon.js index 5be63f02994fa98b2ab9719c7121d9b4bb4cecc5..0b7feadc3813859d23a4e7b48a72bd27d23ded5b 100644 --- a/exec/logon.js +++ b/exec/logon.js @@ -12,10 +12,6 @@ require("sbbsdefs.js", 'SS_RLOGIN'); require("nodedefs.js", 'NODE_QUIET'); -if(console.term_supports(USER_MODE7)) { - log(LOG_DEBUG, "Setting users language to m7"); - user.lang = "m7"; -} if(!bbs.mods.avatar_lib) bbs.mods.avatar_lib = load({}, 'avatar_lib.js'); diff --git a/exec/logonlist.js b/exec/logonlist.js index 63b174aa0bf3b2b83703160021847124744283e9..da7f527347b8b0bb68f0ad7a8bf86c1e58d83f4f 100644 --- a/exec/logonlist.js +++ b/exec/logonlist.js @@ -45,13 +45,6 @@ if(!js.global.bbs) { if(!bbs.mods.logonlist_lib) bbs.mods.logonlist_lib = load({}, 'logonlist_lib.js'); var options = load("modopts.js", "logonlist"); -function dump_objs(obj) { - Object.keys(obj).forEach(function (e) { - writeln(e + ': ' + JSON.stringify(obj[e])); - }); -} -dump_objs(options); -writeln("lang: " + user.lang); if(!options) options = {}; if(options.last_few_callers === undefined) diff --git a/exec/noyesbar.js b/exec/noyesbar.js index 7855eb7c434bf192d5e875d07560f56265849948..bd97f405396617adf238f1144ef82484e0c4f83d 100644 --- a/exec/noyesbar.js +++ b/exec/noyesbar.js @@ -8,6 +8,10 @@ const yes_key = yes_str[0]; const no_str = bbs.text(bbs.text.No); const no_key = no_str[0]; +var options = load("modopts.js", "noyesbar"); +if(!options) + options = {}; + while(console.question.substring(0, 2) == "\r\n") { console.crlf(); console.question = console.question.substring(2); @@ -18,18 +22,21 @@ if(console.question.substring(0, 2) == "\x01\?") { console.question = console.question.substring(2); } -console.putmsg("\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@", P_NOABORT); +console.putmsg(options.noyes_question || "\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@", P_NOABORT); var affirm = false; while(bbs.online && !js.terminated) { var str; if(affirm) - str = format("\x01n\x01b\x01h \x01~%s \x014\x01w\x01e[\x01~%s]", no_str, yes_str); + str = format(options.highlight_yes_fmt || "\x01n\x01b\x01h \x01~%s \x014\x01w\x01e[\x01~%s]", no_str, yes_str); else - str = format("\x01h\x014\x01w\x01e[\x01~%s]\x01n\x01b\x01h \x01~%s ", no_str, yes_str); + str = format(options.highlight_no_fmt || "\x01h\x014\x01w\x01e[\x01~%s]\x01n\x01b\x01h \x01~%s ", no_str, yes_str); console.print(str); var key = console.getkey(0).toUpperCase(); console.backspace(console.strlen(str)); - console.print("\x01n\x01h\x01>"); + if(console.term_supports(USER_MODE7)) + console.print(" "); + else + console.print("\x01n\x01h\x01>"); if(console.aborted) break; if(key == '\r') diff --git a/exec/yesnobar.js b/exec/yesnobar.js index 6b64c4a4ec27358821639318a3b1e7b120374260..1b7f454cedc61cb1291fbeb9f4d8d3392d4dee2b 100644 --- a/exec/yesnobar.js +++ b/exec/yesnobar.js @@ -1,5 +1,4 @@ // JS version of yesnobar.src - require("sbbsdefs.js", "P_NOABORT"); "use strict"; @@ -9,6 +8,10 @@ const yes_key = yes_str[0]; const no_str = bbs.text(bbs.text.No); const no_key = no_str[0]; +var options = load("modopts.js", "yesnobar"); +if(!options) + options = {}; + while(console.question.substring(0, 2) == "\r\n") { console.crlf(); console.question = console.question.substring(2); @@ -19,18 +22,22 @@ if(console.question.substring(0, 2) == "\x01\?") { console.question = console.question.substring(2); } -console.putmsg("\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@", P_NOABORT); +console.putmsg(options.yesno_question || "\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@", P_NOABORT); var affirm = true; while(bbs.online && !js.terminated) { var str; if(affirm) - str = format("\x01h\x014\x01w\x01e[\x01~%s]\x01n\x01b\x01h \x01~%s ", yes_str, no_str); + str = format(options.highlight_yes_fmt || "\x01n\x01b\x01h \x01~%s \x014\x01w\x01e[\x01~%s]", no_str, yes_str); else - str = format("\x01n\x01b\x01h \x01~%s \x014\x01w\x01e[\x01~%s]", yes_str, no_str); + str = format(options.highlight_no_fmt || "\x01h\x014\x01w\x01e[\x01~%s]\x01n\x01b\x01h \x01~%s ", no_str, yes_str); console.print(str); var key = console.getkey(0).toUpperCase(); console.backspace(console.strlen(str)); - console.print("\x01n\x01h\x01>"); + if(console.term_supports(USER_MODE7)) + console.print(" "); + else + console.print("\x01n\x01h\x01>"); + if(console.aborted) break; if(key == '\r')