• Gettext - what am I doing wrong?

    From nelgin@nelgin@EOTLBBS.remove-11g8-this to Digital Man on Thu Jan 22 23:37:35 2026
    From Newsgroup: alt.bbs.synchronet

    To: Digital Man
    In user_settings.js there's this string:

    console.print(gettext("Choose a default file transfer protocol (or [ENTER] for None):"));

    It displays in gray so I thought since it's using gettext, I would put the string in the [JS] section of text.ini

    Choose a default file transfer protocol (or [ENTER] for None): = \1n\1h\1yChoose a default file transfer protocol (or [ENTER] for None):

    Should we be adding localization keys to all gettext strings to make it easier to change them or am I doing something wrong? Maybe the () or [] are interfering with the regex?

    Thanks

    ---
    þ Synchronet þ End Of The Line BBS - endofthelinebbs.com
    --- Synchronet 3.21b-Linux NewsLink 1.2
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Digital Man@digital.man@vert.synchro.net.remove-cbb-this to nelgin on Thu Jan 22 21:49:27 2026
    From Newsgroup: alt.bbs.synchronet

    To: nelgin
    Re: Gettext - what am I doing wrong?
    By: nelgin to Digital Man on Thu Jan 22 2026 11:37 pm

    In user_settings.js there's this string:

    console.print(gettext("Choose a default file transfer protocol (or [ENTER] for None):"));

    It displays in gray so I thought since it's using gettext, I would put the string in the [JS] section of text.ini

    Choose a default file transfer protocol (or [ENTER] for None): = \1n\1h\1yChoose a default file transfer protocol (or [ENTER] for None):

    Should we be adding localization keys to all gettext strings to make it easier to change them or am I doing something wrong? Maybe the () or [] are interfering with the regex?

    There's no regex involved. To put control characters (e.g. those literal \1's) in a .ini key value, you need to use string literal syntax:
    https://wiki.synchro.net/config:ini_files#string_literals

    That's even how's done in the examples at: https://wiki.synchro.net/custom:text.ini

    A shorter gettext() look name/key is an option and a good idea for those long gettext() strings. For strictly colorization, I'd hope we have a better/easier knob to fiddle than using text.ini.
    --
    digital man (rob)

    Synchronet/BBS Terminology Definition #86:
    Telenet = Proprietary packet switched network (variant on X.75)
    Norco, CA WX: 54.0øF, 91.0% humidity, 1 mph NNW wind, 0.06 inches rain/24hrs --- Synchronet 3.21b-Linux NewsLink 1.2
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net
    --- Synchronet 3.21b-Linux NewsLink 1.2