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 fix #5638

Merged
merged 3 commits into from May 13, 2019

Conversation

@saadmk11
Copy link
Member

@saadmk11 saadmk11 commented Apr 27, 2019

closes #5446

@humitos humitos requested a review from May 9, 2019
Copy link
Member

@humitos humitos left a comment

I think we need to figure out another approach to this problem since we can't change the LANGUAGES constant because it's used for URLs and Sphinx as well as language form validation.

('es-MX', 'Mexican Spanish'),
('uk-UA', 'Ukrainian'),
('zh-CN', 'Simplified Chinese'),
('zh-TW', 'Traditional Chinese'),
Copy link
Member

@humitos humitos May 9, 2019

I don't think we can change this.

LANGUAGES is used for URLs, and by changing this constant we will be breaking many URLs. Also, these constant matches the language= setting from Sphinx.

Copy link
Member Author

@saadmk11 saadmk11 May 9, 2019

@humitos we can add a method to sitemap_xml view to change the lang if its not in the correct format. somthing like if lang == 'zh_CN': return 'zh-CN'. It would be a hacky process though. What do you think we can do here?

Copy link
Member

@humitos humitos May 9, 2019

Sounds hacky, but good enough to me considering that it's what we need and it's encapsulated inside the sitemap_xml.

Is the only thing that needs to be replaced _ by -? Did you check the sitemap reference?

What about the rest of the values? are they valid?

Copy link
Member Author

@saadmk11 saadmk11 May 9, 2019

@humitos yes, we only need to replaced _ by - . Updated the PR please have a look.

@humitos
Copy link
Member

@humitos humitos commented May 13, 2019

Thanks!

@humitos humitos merged commit e0ea4a5 into readthedocs:master May 13, 2019
1 check passed
@saadmk11 saadmk11 deleted the sitemap-hreflang-syntax-fix branch May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants