-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Describe the bug
lang
attibute to language labels in the language switcher (文A) makes the shape of each han correct in all system locales.
If you vary the value of lang
, you will get:
🇯🇵简体中文 繁體中文 日本語
🇨🇳简体中文 繁體中文 日本語
🇹🇼简体中文 繁體中文 日本語
🇭🇰简体中文 繁體中文 日本語
🇰🇷简体中文 繁體中文 日本語
- The first stroke of 文 and 語
- 骨 in 體
- 糸 in 繁
Without that attribute, the forms in the system locale language are used. (e.g. If your OS is Japanese, all han where lang
is non-CJK are set to Japanese shapes)
Reproduction
Visit a site with i18n using VitePress (at least 2 of Japanese, Simplified Chinese, and Traditional Chinese exist):
- Analyze tags wrapping language labels
- Determine whether Each han in each CJK language is displayed as the expected/correct form (except for some environment, e.g. Windows + Firefox (the OS locale is prioritized))
Wrong:


Expected behavior
lang
attribute (e.g.lang=zh-CN
orlang=ja
) is added to one of ancestor tags of each language label- Each han is displayed as the correct/expected form
Correct:
Set the correct lang
attribute values to Simplified/Traditional Chinese labels:

↓Note: Japanese 文 is prioritized due to system-ui
and ui-sans-serif
, so this is not ideal:

(sans-serif
instead of them will fix the shape of 文)
System Info
N/A
Additional context
No response
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.