asvrada / chrome-ext-app-store-spending

A chrome extension that summarizes how much you have spent on App Store in total.
https://chromewebstore.google.com/detail/how-much-did-i-spent-on-a/bgdecjabbhjkhenadhghpkkabmjdhhag?hl=en
2 stars 0 forks source link

Language setting defaults to English not matter what #9

Open asvrada opened 10 months ago

asvrada commented 10 months ago

The top-right dropdown menu always displays "English" as selected, even if the i18n language detector changes language.

asvrada commented 10 months ago
<select value={i18n.language} onChange={handleLanguageChange}>
        <option value="en">English</option>
        <option value="zh">中文-简体</option>
</select>

For the Chinese language, there are 4 options for a website:

If the i18n language detector returns zh-CN, the dropdown options currently don't have it, so English remains selected. But somehow i18n would fall back to zh correctly and display the page in Chinese as expected. Thus causing this issue.

Proposed fix

If i18n language detector returns zh, change to zh-CN