Closed SEWeiTung closed 1 year ago
Yes it is not supporting in 1.x, and it is recommended to upgrade to 2.x, to use the full-localized color switcher: https://github.com/umijs/dumi/blob/de3ad27916129d0bffffad43ccceaf657c228384/src/client/theme-default/locales/zh-CN.json#L3-L5
Upgrading Guide (Chinese only): https://d.umijs.org/guide/upgrading
Versions
Steps to reproduce
Install the dumi as what was given by the torturials and enable the theme switcher (A good example is to see what's inside the “Egg”'s repository at "site" folder).
What is Expected?
As I have a Chinese and English version, the switch button's title should be with Chinese in the Chinese mode.
What is actually happening?
All are English version, not translated.
A typical example is that you can see the official site of dumi at v1.x: https://v1.d.umijs.org/zh-CN/ When in the Chinese version, move your mouse onto the button, "Default to System" should be "跟随系统设置" but actually NOT, this also happens for all the related switch buttons such as "Dark mode", "Light mode"……ect:
Reasons:
The "title" is hard-coded instead of supporting a flexible, localizable string at: https://github.com/umijs/dumi/blob/dbf20d9ae7a078d0b1b0544bb433524edd1bfa38/packages/theme-default/src/components/Dark.tsx#L33-L47