# \[Feature Request\] Node Status translation context

**URL:** https://discourse.nodered.org/t/feature-request-node-status-translation-context/80368
**Category:** Feature Requests
**Created:** [7 August 2023 09:24 UTC](https://discourse.nodered.org/t/feature-request-node-status-translation-context/80368 "2023-08-07T09:24:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lutz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lutz/32/81814_2.png) [@lutz](https://discourse.nodered.org/u/lutz)
#### Post date: [7 August 2023 09:24 UTC](https://discourse.nodered.org/t/feature-request-node-status-translation-context/80368/1 "2023-08-07T09:24:15Z")

</div>

Hi all,  
I'm trying to use translation with context on a node's status. Due to the fact that `RED._('translate-text', context)` is getting evaluated in backend without information about the clients languages, the `translate-text` is sent to the frontend for translation (like described in "creating-nodes" documentation).

Unfortunately, with this implementation, we lose the ability to pass context information. Would it be possible to adjust status object and [this code](https://github.com/node-red/node-red/blob/877aa75e4e8b3d780d16a484537f8bb8342ec4d5/packages/node_modules/%40node-red/editor-client/src/js/red.js#L491C19-L491C19) to allow parsing translation context?

I would suggest something like this:

```javascript
// node implementation
node.status({
    fill: "green",
    shape: "dot",
    text: "node-red:common.status.connected",
    translationContext: {
        time: (new Date()).toLocaleTimeString()
    },
});

```

```javascript
// @node-red editor-client red.js
RED.comms.subscribe("status/#", function (topic, msg) {
    var parts = topic.split("/");
    var node = RED.nodes.node(parts[1]);
    if (node) {
        if (msg.hasOwnProperty("text") && msg.text !== null && /^[@a-zA-Z]/.test(msg.text)) {
            // change here
            msg.text = node._(msg.text.toString(), { ...msg.translationContext, defaultValue: msg.text.toString() });
        }
        node.status = msg;
        node.dirtyStatus = true;
        node.dirty = true;
        RED.view.redrawStatus(node);
    }
});

```

This solution would also solve [an existing request](https://discourse.nodered.org/t/node-status-translation/49907).

Thanks in advance!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [6 October 2023 09:25 UTC](https://discourse.nodered.org/t/feature-request-node-status-translation-context/80368/2 "2023-10-06T09:25:06Z")

</div>

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