navidrome / navidrome

🎧☁️ Your Personal Streaming Service
https://www.navidrome.org
GNU General Public License v3.0
11.8k stars 883 forks source link

`DefaultLanguage` config doesn't work when set to Chinese #1946

Closed cnRuanYF closed 2 years ago

cnRuanYF commented 2 years ago

Description

DefaultLanguage config doesn't work when set to Chinese.

Expected Behaviour

Default language can be change to Chinese.

Steps to reproduce

  1. According to configuration-options doc

    Sets the default language used by the UI when logging in from a new browser. This value must match the 2 letter ISO code for the language set DefaultLanguage to zh in navidrome.toml

  2. Restart server
  3. Clear browser cache, LocalStorage and Cookie
  4. Open WebUI, language is still English (Also doesn't work when set to zh-Hans or zh-Hant)

Platform information

Additional information

I think the legal configuration value should be the same as i18n/xx.json, Chinese needs to be set to zh-Hans or zh-Hant, but due to the processing in this commit https://github.com/navidrome/navidrome/commit/bfeb8ef6b3e5756d72b230abdbb96f8a31b2e2fa zh-Hans / zh-Hant will be converted to zh-hans / zh-hant, causing the language file cannot be loaded

I have tried to fix this bug and will create a PR later

(Sorry for my bad English)

deluan commented 2 years ago

Thanks for looking into this, but I think the best to do here is to revert https://github.com/navidrome/navidrome/commit/bfeb8ef6b3e5756d72b230abdbb96f8a31b2e2fa, as the language code is clearly case-sensitive. I'll revert it for next release.

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.