Sidebar Internationalization

Hi,

I developed a sidebar in Node-Red which can control a robot. Now I would like to translate this Sidebar. However, this seems not to work the same way as it did in the custom nodes I developed.
When I try to add a translation to an element like below no text is displayed.

<script type="text/x-red" data-template-name="robot-sidebar">
    <div style="position: relative; height: 100%;">
        <div style="position: absolute; top: 1px; bottom: 2px; left: 1px; right: 1px; overflow-y: scroll; padding: 10px;">
            <form class="dialog-form">
                <div style="width:100%; background-color: darkred; height: 50px; margin-bottom: 10px">
                    <span data-i18n="robot_node.label.manufacturer"></span>
                </div>
....

Hi @Vinzenz

As the editor doesn't know who has provided the sidebar, it doesn't know which catalog to lookup your messages in.

You need to use the fully qualified name that includes the catalog identifier:

data-i18n="<npm-module-name>/<node-set-name>:robot_node.label.manufacturer"

where:

  • npm-module-name is the name of your module
  • node-set-name is the name you used in the node-red section of package.json to point at the files for this node.

For example, node-red-node-random uses node-red-node-random/random:random.label.generate

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