Skip to content

Missing i18n for footer and warning banner #3561

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

Closed
stsewd opened this issue Jan 28, 2018 · 5 comments · Fixed by #6144
Closed

Missing i18n for footer and warning banner #3561

stsewd opened this issue Jan 28, 2018 · 5 comments · Fixed by #6144
Labels
Accepted Accepted issue on our roadmap Good First Issue Good for new contributors Improvement Minor improvement to code

Comments

@stsewd
Copy link
Member

stsewd commented Jan 28, 2018

Details

The text displayed on the warning banner (when using an old version of the documentation) right now is hard coded on the js code.

https://github.com/rtfd/readthedocs.org/blob/b12e1885dc7f6da6b9719054e3654019b1e0fe65/readthedocs/core/static-src/core/js/doc-embed/version-compare.js#L18

Also the footer response from the API

https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/restapi/templates/restapi/footer.html

Related comment #3547 (comment)

Expected Result

Warning message and footer are translated according to the current language of the docs.

Actual Result

The warning message and footer always display English text.

@stsewd
Copy link
Member Author

stsewd commented Jan 28, 2018

We could for instance parse the current url /en/latest/ and pass the lang to the API, or use the language from the current session.

@stale
Copy link

stale bot commented Jan 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jan 10, 2019
@stsewd stsewd added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Jan 10, 2019
@stale stale bot removed the Status: stale Issue will be considered inactive soon label Jan 10, 2019
@humitos
Copy link
Member

humitos commented Jan 10, 2019

We are already not using the banner by default on new projects. I think we should deprecate it, write docs suggesting https://github.com/humitos/sphinx-version-warning/ which is more configurable and finally remove our own banner.

In case we need something extra, we can add those features to that extension which will be easier and we could support different setups instead of hardcode only one into our codebase.

@stsewd stsewd added the Good First Issue Good for new contributors label Mar 27, 2019
@stsewd
Copy link
Member Author

stsewd commented Mar 27, 2019

Yeah, we can ignore translating the warning banner for now, footer api still needs translation

@saadmk11
Copy link
Member

@stsewd We can use something like this to use django translation on the javascript code.
https://docs.djangoproject.com/en/1.11/topics/i18n/translation/#internationalization-in-javascript-code

but what needs to be translated on the footer API response?
do you means texts on the footer.html template like: Languages Versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Good First Issue Good for new contributors Improvement Minor improvement to code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants