TIP: Click on subject to list as thread! ANSI
echo: synchronet
to: ALL
from: vela025
date: 2024-10-13 14:20:00
subject: Help using gettext.js

Hey all,

A while ago I was creating BeeBS II the successor to BeeBS (beebs.ddns.net) a
BBS which supports Acorn mode 7 (teletext graphics) as well as ANSI and ASCII
running on my BBC Micro. I've recently found my backup of BeeBSII (the
synchronet successor) and would like to complete the project but this time
"legally" i.e. still keeping a 40 col ascii mode rather than sending teletext
control codes via that. Instead I've decided to create a localisation language
(bbcmicro) and store the menu files in /text/menu/bbcmicro. Using
text.bbcmicro.ini will allow me to create the Mode 7 prompts, but I'm
struggling to use gettext.js to customise yesnobar.js  I would like to replace
"\x01h\x014\x01w\x01e[\x01~%s]\x01n\x01b\x01h \x01~%s" with "\x82(%s)\x81%s".

To yesnobar.js I have added/amended:
load("gettext.js");
str = format(gettext("\x01h\x014\x01w\x01e[\x01~%s]\x01n\x01b\x01h \x01~%s"),
yes_str, no_str);

To the end of text.bbcmicro.ini I have added:
[JS]
\x01h\x014\x01w\x01e[\x01~%s]\x01n\x01b\x01h \x01~%s = \x82(%s)\x81%s

I get no errors, however the prompts appear as they originally did.

I can replace the string in yesnobar.js which works fine, but then
(understandably) doesn't look great in ASCII/ANSI clients.

There is also a small typo in the example given here:
http://wiki.synchro.net/custom:javascript:lib:gettext.js 

print(getttext - should be - print(gettext
--- SBBSecho 3.20-Linux
                                                           
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.