Language selection

Sorry in advance if this is a stupid question but I couldn’t find an answer in the docs…
Where do you select the display language for the editor ?

It uses the browser’s language preference - it isn’t something you can override within node-red itself.

We currently only have support for English (obvs), Japanese and Chinese.

Nick

Thanks for the answer. Is it planned to allow this change via the Settings panel ?

No it isn't - there hasn't been any demand. For the languages we have today, a user will typically already have their locale correctly set in the browser so it all just works.

If we had more languages available and there was demand to use the Node-RED UI in a language different to the one the browser is configured to use, then we could consider it.

If anyone wants to help out and do some translation(s)… please step forwards - would be a great Pull Request for someone to get started with.

1 Like

Well, I found 3 locations where there are languages files:

  • /red/runtime/locales
  • /nodes/core/locales
  • /red/api/editor/locales

Are there any other ?

I could help with french translation. Translating is not a problem but I suppose I have to test every message and make sure it’s not displayed in a weird way (I don’t know, for example make sure that it does not disrupt the HTML/CSS layout) … How could one test every message ? How does one know where/when a message is used ?

Also, I suppose you regularly add new messages in those files. What if a token is not present in the french file ? Will it fallback to the en-US file ?

Well ideally yes - but it is just text replacement so as long as the files load at all then it should be ok. The main thing to check will be if the words replaced are a lot different in length. Maybe start with the nodes ones as they are fairly obvious which corresponds to which node as they are in a tree like structure.

Yes we do change the messages but only when they need it - so hopefully the core ones are fairly stable - but yes they do fall back to en-US if the translation isn’t found.

Note: words surrounded by double underscores (eg __project__ ) are variables that get substituted during execution so should NOT be translated.

OK, I started translating in french the messages.json file for the nodes …

So far, I have not translated the following properties/items, because they are used “as-is” in the msg transferred in the flow:

  • payload: french translation is “charge utile” (literally “useful load”) but I think that leaving it as “payload” makes it more clear/obvious that we are referring to msg.payload
  • topic: should be translated as “sujet” (literally “subject”) … but same remark as above…

Does it make sense or should I translate those two terms as well ?

Good thought. Yes they, and any others that may be msg.properties that are referred to ought to be left.

ok the messages.json file for the nodes has been translated in french and tested as far as I can (I don’t have a RPI – or linux – to use with NR so I wasn’t able to test the GPIO/Tail nodes for instance).

All in all, apart from a few times where labels have a fixed size, the CSS layout is not disrupted. French translation can be quite verbose because we don’t have “simple” words for some IT/technical stuff.

For example, I had to look how we say “timestamp” in french and decided that the french translation was NOT practical (“horodatage” means nothing to programmers/developers I think – at least it means nothing to me). Another basic example is that we don’t really have different words for “upload” and “download”. Both are translated by “télécharger” (which is already longer than any of its english-counterparts). So whenever there was an “upload” term, I used the word “envoyer” (means “to send”) while I used “recevoir” (“to receive”) when “download” was used.

Ok, so for now, the “core” nodes config panels are translated … I noticed that some nodes are not in that file (the twitter node for instance) … I have to find where it is … also the nodes’ help was not in that file … I noticed that the Japanese translation added a bunch of html files … I guess these might be where they’re located (as for any “custom” node: in a html file) … and then I suppose the other .json files I have identified include the text for the main interface and for the console messages …

Man, translation is boring ! I’m glad I didn’t make it my trade ! :rofl:

Ah yes. A couple of the nodes are in the node-red-nodes project
By yes well done!

It uses the browser’s language preference

That is for the Editor.

What is with the runtime, when used RED._("myNode.message1");?

Where comes the Language setting in the runtime from (there is no "Browser" :slightly_smiling_face:).

Is the Settings in the Node-Red also affecting the Backend?
image

I have done some tests, but It was not clear to me when this language settings takes effect to the runtime.

2 Likes

Hi,
so Tilleul did you progress in French translation?
I'm very interested by testing it in schools.
Thanks a lot for answering.

sorry for the late reply ... unfortunately, no ... I began but had to stop because I don't have enough free time to work on it ...

Dommage....comme nous tous, trop peu de temps pour contribuer sur les projets libres.
Et du coup tu as stocké quelque part ce début de travail pour qu'il puisse être continué ?
Merci.