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

Use of translated Python Docs pages in translated Weblate Docs #5634

Closed
rffontenelle opened this issue Mar 11, 2021 · 7 comments
Closed

Use of translated Python Docs pages in translated Weblate Docs #5634

rffontenelle opened this issue Mar 11, 2021 · 7 comments

Comments

@rffontenelle
Copy link
Contributor

Python Docs has a translation project and I would like, if possible, to link its translated pages when translating strings in Weblate Docs. While it would be easy to adjust a URL in the translation string, I can't say the same of a :ref:`<name-of-a-link>` RST syntax. In the latter case, not using the correct link name would generate sphinx warnings or error (if sphinx-build's -W flag is used) messages.

For instance, Look at similar strings translated in past, see :ref:`memory`. in docs/user/translating.rst in line 269 which currently links to

https://docs.python.org/3.7/c-api/memory.html#memory

and I would change to

https://docs.python.org/pt-br/3.7/c-api/memory.html#memory

Any idea on how to allow to use translated pages of Python Docs?

nijel added a commit that referenced this issue Mar 11, 2021
@nijel
Copy link
Member

nijel commented Mar 11, 2021

Hmm, this particular link should point to the Weblate docs, that is fixed in ea77e22. This would ideally be addressed in Sphinx (such reference should fail the docs build), see sphinx-doc/sphinx#2068.

Back to your original question - the only way is to add all localized versions to our interpshinx configuration and then use these in the links. The links to Python docs currently should be done as:

:ref:`python:target`

@rffontenelle
Copy link
Contributor Author

Hmm, this particular link should point to the Weblate docs, that is fixed in ea77e22. This would ideally be addressed in Sphinx (such reference should fail the docs build), see sphinx-doc/sphinx#2068.

Sweet.

Back to your original question - the only way is to add all localized versions to our interpshinx configuration and then use these in the links. The links to Python docs currently should be done as:

:ref:`python:target`

Do you mean e.g to add "python-pt-br" to conf.py, so the pt_BR translator use "python-pt-br" instead of python in the :ref: ?

@nijel
Copy link
Member

nijel commented Mar 11, 2021

Yes, that would be needed. The problem is that this would have to be done for every language, so it doesn't really scale well...

@rffontenelle
Copy link
Contributor Author

Nah, It really doesn't. Let's leave as it is.. Thanks!

@github-actions
Copy link

The issue you have reported is resolved now. If you don’t feel it’s right, please follow it’s labels to get a clue and take further steps.

  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

@nijel
Copy link
Member

nijel commented Mar 11, 2021

Hmm, it should be possible to change the target based on the documentation language. I've tried to implement this in b953691, not sure if that will work (it needs to be built on the Read the Docs to see actual result).

@rffontenelle
Copy link
Contributor Author

A little bit late, but just for the record: I've tested and URLs for Python, Django etc. are displayed translated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants