-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
Chinese translation doesn't work. #722
Comments
There hasn't been any activity on this issue recently. This issue has now been marked as stale and will be closed if no further activity occurs. Please, update to the latest version and check if that solves the issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Firstly great card!
During config found that chinese translation doesn't work(seems didn't work from the beginning as there was another closed bug report without detail).
After checking code and debug I believe this is due to the wrong translation file name "cn.json", it should be "zh.json" instead as the language code is zh.
According to localize.ts L78-L86 the language could be acquired from either HA LocalStroage or Navigator config, I checked both of them and all of them were "zh"
Another point is with HA Local Storage, for chinese language, the field selectedLanguage will be "zh-Hans" but no simply “zh”. According to the code this field will be take with 1st order when parsing, and it only replace '" and -, the result will still be wrong(as there 's no a zhHans.json in translation folder, it will fallback to ENG in next code L90-L94).
Hope I clearly describe the problem, if any detail missed i'll add.
Btw, is it possible to add a param "language" so people can assign manually a specific language?
The text was updated successfully, but these errors were encountered: