Skip to content
Snippets Groups Projects
  • Rob Swindell's avatar
    4f9f226a
    Start of localization support for JS modules/shells/etc. · 4f9f226a
    Rob Swindell authored
    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.
    4f9f226a
    History
    Start of localization support for JS modules/shells/etc.
    Rob Swindell authored
    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.