Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition to i18n and add English translation #6

Merged
merged 8 commits into from
Dec 7, 2021

Conversation

benfiglin
Copy link
Contributor

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.

@benfiglin benfiglin mentioned this pull request Dec 7, 2021
@shaonianzhentan shaonianzhentan merged commit f40c702 into shaonianzhentan:main Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants