As requested in #3, also adds English as the default language, while keeping the Chinese language available and auto-selected for installations with Node Red set up to Chinese.
Most of the translation strings are located in the locales/[_lang_]/common.json file, while some are within each individual node folder (only for those nodes that have specific definitions that are not common among the other nodes).
I tried to keep anything i18n specific out of the HomeAssistant.js file, since I wanted to keep this class/file language-neutral and to only be responsible for constructing and sending MQTT messages to HA, and not for sending language-specific messages back to the Node Red editor.
Please review and let me know if I should fix anything.
@emkookmer, I'm mentioning you here since you were interested in this too.
This PR adds multi-language support per this document: https://nodered.org/docs/creating-nodes/i18n
As requested in #3, also adds English as the default language, while keeping the Chinese language available and auto-selected for installations with Node Red set up to Chinese.
Most of the translation strings are located in the
locales/[_lang_]/common.json
file, while some are within each individual node folder (only for those nodes that have specific definitions that are not common among the other nodes).I tried to keep anything i18n specific out of the
HomeAssistant.js
file, since I wanted to keep this class/file language-neutral and to only be responsible for constructing and sending MQTT messages to HA, and not for sending language-specific messages back to the Node Red editor.Please review and let me know if I should fix anything.
@emkookmer, I'm mentioning you here since you were interested in this too.