gettext.js
Localized/customized support for JavaScript user-visible text (i.e. strings not contained in text.dat)
Usage
Customized text strings go in the [JS]
section of ctrl/text.ini
.
Localized (translated to non-default locale) text strings go in the [JS]
section of ctrl/text.<lang>.ini
By load()
ing or require()
ing gettext.js
, a JavaScript module can gain localization/customization support by simply wrapping strings (words, terms) in calls to gettext()
. For example:
load("gettext.js"); print(getttext("This string is now localizable."));
For easier localization, it's recommended that Ctrl-A codes/sequences are contained in separate strings from words/terms that can be translated for other locales.