denysdovhan / vacuum-card

Vacuum cleaner card for Home Assistant Lovelace UI
https://denysdovhan.com/smart-home
MIT License
903 stars 529 forks source link

Chinese translation doesn't work. #722

Closed grandpignon closed 2 months ago

grandpignon commented 5 months ago

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?

github-actions[bot] commented 3 months ago

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[bot] commented 2 months ago

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.