From 5c33381b6dcbcb9e879e1938ba383caa4fd494b8 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Debian Linux)" <rob@synchro.net>
Date: Mon, 14 Oct 2024 19:11:54 -0700
Subject: [PATCH] Allow more shell prmopt text to be configured vi
 ctrl/text[.lang].ini file

Using the new load/gettext.js:
A sysop can override these additional strings (that contain Ctrl-A sequences)
now by assigning to the following keys:
- shell_prompt_begin
- shell_prompt_middle
- shell_main_prompt_end
- shell_file_prompt_end

Also, a sysop can now put these keys in the [default.js] section of the file
(rather than [js]) if desired, to avoid conflict with other scripts/shells.

Added for vela025 and their BBC Micro Acron mode 7 language support mod.
There are other strings still hard-coded in default.js and notably, in
load/shell_lib.js that are not (yet) customizable. Let's try this change first.
---
 exec/default.js | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/exec/default.js b/exec/default.js
index e609dd8f28..f8e3c40172 100644
--- a/exec/default.js
+++ b/exec/default.js
@@ -23,8 +23,11 @@ const main_menu = {
 	file: "main",
 	eval: 'bbs.main_cmds++',
 	node_action: NODE_MAIN,
-	prompt: "\x01-\x01c\xfe \x01b\x01h" + gettext("Main") + " \x01n\x01c\xfe \x01h" + time_code +
-		" \x01n\x01c[\x01h@GN@\x01n\x01c] @GRP@\x01\\ [\x01h@SN@\x01n\x01c] @SUB@: \x01n",
+	prompt: gettext("\x01-\x01c\xfe \x01b\x01h", "shell_prompt_begin")
+		+ gettext("Main")
+		+ gettext(" \x01n\x01c\xfe \x01h", "shell_prompt_middle")
+		+ time_code
+		+ gettext(" \x01n\x01c[\x01h@GN@\x01n\x01c] @GRP@\x01\\ [\x01h@SN@\x01n\x01c] @SUB@: \x01n", "shell_main_prompt_end"),
 	num_input: shell.get_sub_num,
 	slash_num_input: shell.get_grp_num,
 	command: {
@@ -102,8 +105,11 @@ const file_menu = {
 	file: "transfer",
 	eval: 'bbs.file_cmds++',
 	node_action: NODE_XFER,
-	prompt: "\x01-\x01c\xfe \x01b\x01h" + gettext("File") + " \x01n\x01c\xfe \x01h" + time_code +
-		" \x01n\x01c(\x01h@LN@\x01n\x01c) @LIB@\x01\\ (\x01h@DN@\x01n\x01c) @DIR@: \x01n",
+	prompt: gettext("\x01-\x01c\xfe \x01b\x01h", "shell_prompt_begin")
+		+ gettext("File")
+		+ gettext(" \x01n\x01c\xfe \x01h", "shell_prompt_middle")
+		+ time_code
+		+ gettext(" \x01n\x01c(\x01h@LN@\x01n\x01c) @LIB@\x01\\ (\x01h@DN@\x01n\x01c) @DIR@: \x01n", "shell_file_prompt_end"),
 	num_input: shell.get_dir_num,
 	slash_num_input: shell.get_lib_num,
 	command: {
-- 
GitLab