Skip to content
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

Sitemap hreflang syntax invalid for regional language variants #5446

Closed
strophy opened this issue Mar 13, 2019 · 3 comments · Fixed by #5638
Closed

Sitemap hreflang syntax invalid for regional language variants #5446

strophy opened this issue Mar 13, 2019 · 3 comments · Fixed by #5638
Labels
Bug A bug Good First Issue Good for new contributors

Comments

@strophy
Copy link

strophy commented Mar 13, 2019

The hreflang for regional variations in sitemap.xml follows the format of the URL language slug generated by Sphinx, e.g. zh_CN for Chinese (China). This is invalid syntax for hreflang in a sitemap (reference), where a hyphen must be used instead, e.g. zh-CN. Alternatively, it is also valid to define the script of the language instead, e.g. zh-Hans for Simplified Chinese. Some sort of library to perform this conversion, a lookup table or a user-facing option could help fix this.

Example from: https://docs.dash.org/sitemap.xml

<xhtml:link rel="alternate" hreflang="zh_CN" href="http://docs.dash.org/zh_CN/latest/"/>
@stsewd stsewd added the Bug A bug label Mar 13, 2019
@stsewd
Copy link
Member

stsewd commented Mar 13, 2019

The fact that we rely on sphinx for this make it hard to follow the standard way, there are other parts of the code that we should take care of too.

@saadmk11
Copy link
Member

Hey @humitos can you tell me how should this be approached? And what needs to be changed to fix this?

@humitos
Copy link
Member

humitos commented Apr 27, 2019

@saadmk11 the hreflang label from the sitemap uses some incorrect codes. Those incorrect ones (for example, zh_CN) should be replaced for the correct ones (zh-CN). The linked document from the description has more detailed information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Good First Issue Good for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants