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
In translated docs, sort glossaries by translated terms #10091
Conversation
(CC @Fipaddict @JulienPalard.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits.
Thanks for the review @tk0miya, I'll address your comments soon. Do you have an idea why the CI is failing? All GitHub seems to tell me is just "this check failed" for a bunch of jobs without a log; did I miss it somewhere? Tests pass locally for me. |
Oh, and the "Summaries" are “GitHub Actions has encountered an internal error when running your job.” |
Now I restarted CI jobs manually. I hope it goes well. |
This is done by moving the sorting from the glossary directive to a transform operating after the i18n transform. Closes sphinx-doc#9827
9714677
to
0269bec
Compare
Yes, it went a lot better. I've pushed an update addressing your comments and fixing flake8 as well as mypy checks. |
Thank you for your quick update! I'll merge this after CI passed. |
Thank you for your contribution! |
Thanks a lot for the review! |
This is done by moving the sorting from the glossary directive to a
transform operating after the i18n transform.
Closes #9827
Feature or Bugfix
Purpose
Translated glossaries were sorted according to alphabetical order of English terms, which makes no sense to a reader of the native language. An example can be found here: https://docs.python.org/fr/3/glossary.html. This sorts them according to translated terms instead. To this end, the glossary directive no longer sorts the entries itself. Instead, it sets a boolean attribute on the glossary node, and a transform happening after the i18n transform takes care of sorting glossaries with this attribute.
This is my first contribution to Sphinx and I'm still new to the code; please let me know if I've missed something.
Relates
#9827