Closed grandpignon closed 2 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!
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.
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](https://github.com/denysdovhan/vacuum-card/assets/59390612/5533a1e2-783c-4a46-9b2a-9195b1fcd11e)
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?