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

Chinese translation doesn't work. #722

Open
grandpignon opened this issue Mar 19, 2024 · 1 comment
Open

Chinese translation doesn't work. #722

grandpignon opened this issue Mar 19, 2024 · 1 comment
Labels
bug Something isn't working stale

Comments

@grandpignon
Copy link

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"
image
image
image

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).
image
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?

@grandpignon grandpignon added the bug Something isn't working label Mar 19, 2024
Copy link

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.
Thank you for your contributions!

@github-actions github-actions bot added the stale label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant