Cannot get translation in .html file

Hi all, I am working through a node I maintain and adding i18n to the html and JS

So far, I have ...

  • replacing static text with spans - :white_check_mark:
    • <span data-i18n="mssql.node.label.connection">
  • replacing titles and placeholders - :white_check_mark:
    • <input data-i18n="[placeholder]"> </input>
    • <div data-i18n="[placeholder]"> </div>
  • Accessing translations in html script - :x:
    • RED._("mssql.common.query") not working


         var modeField = $("#node-input-modeOpt").typedInput(
                        { value:"query", label: RED._("mssql.common.query"),  hasValue:false },
                        { value:"execute", label: RED._("mssql.common.execute_procedure"),  hasValue:false },
                        'msg', 'flow', 'global', 'env'            
                    typeField: $("#node-input-modeOptType"),


    "mssql": {
        "common": {
            "editor": "Editor",
            "query": "Query",
            "execute_procedure": "Execute Procedure"            

I get this (first two items in the dropdown should be "Query" and "Execute Query" - instead, they are the path to the i18n value)...

File layout...

  • src
    • locales
      • en-US
        • mssql.json
      • mssql.html
      • mssql.js

False alarm - I have solved it - i missed it at the bottom of this page...

As well as the data-i18n attribute for html elements, all node definition functions (for example, oneditprepare ) can use this._() to retrieve messages.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.