- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use "zh-CN" instead of "zh_CN" as the HTML lang tag for simplified Chinese pages #10214
Labels
Milestone
Comments
Hello, I can't search Chinese in the search box on my computer, but I can search English。 |
tk0miya
added a commit
to tk0miya/sphinx
that referenced
this issue
Mar 30, 2022
So far, HTML builder output the `language` configuration as a language tag for HTML. But it takes locale string in ANSI C, not IETF language code. This converts locale string to language tag to generate valid language tag for HTML.
收到,谢谢
|
tk0miya
added a commit
to tk0miya/sphinx
that referenced
this issue
Apr 2, 2022
So far, HTML builder output the `language` configuration as a language tag for HTML. But it takes locale string in ANSI C, not IETF language code. This converts locale string to language tag to generate valid language tag for HTML.
tk0miya
added a commit
that referenced
this issue
Apr 2, 2022
Fix #10214: html: invalid language tag was generated for zh_CN
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is your feature request related to a problem? Please describe.
In Sphinx language configuration: Simplified Chinese is presented as "zh_CN". But it is not the standard HTML tag (see BCP 47 - Tags for Identifying Languages). So the auto-generated HTML lang tag will not be helpful for search engines.
sphinx/sphinx/themes/basic/layout.html
Line 107 in b8789b4
Describe the solution you'd like
When the
language
is set to "zh_CN" or "zh-CN", the HTML lang tag should be "zh-CN".Describe alternatives you've considered
Only support "zh_CN" in
language
configuration, but it would be treated as "zh-CN" while generating HTML lang tags.The text was updated successfully, but these errors were encountered: