https://gitlab.synchro.net/main/sbbs/-/commit/4f9f226a4e3b109d1bf1f20e
Added Files:
exec/load/gettext.js
Modified Files:
exec/default.js exec/load/shell_lib.js
Log Message:
Start of localization support for JS modules/shells/etc.
Similar to GNU gettext(), by loading gettext.js and enclosing all user-visible strings in gettext(), a script can get easy/easier support for non-default (i.e. US-English) locales by loading translated strings from the [JS] section of ctrl/text.<locale>.ini (if it exists), or customized strings from the [JS] section of ctrl/text.ini (if it exists).
Results are cached for fast subsequent uses of the same string.
What's *not* supported is different translations (e.g. colorization or whatever) for the same string used in a different scripts. That could be
added (e.g. use a different section name for script-specific translations), pretty easily, if desired.