-
Notifications
You must be signed in to change notification settings - Fork 322
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
ENH - Update translations workflows #1959
Conversation
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.
this is great progress! Some comments on the doc changes
docs/community/topics/i18n.rst
Outdated
tox run -e i18n-extract | ||
|
||
pybabel extract . -F babel.cfg -o src/pydata_sphinx_theme/locale/sphinx.pot -k '_ __ l_ lazy_gettext' | ||
|
||
**To run this in ``.nox``**: ``nox -s translate -- extract``. | ||
|
||
#. Update the message catalogs (``PO`` files) with `the PyBabel update command <https://babel.pocoo.org/en/latest/cmdline.html#update>`__: | ||
#. Update the message catalogs (``PO`` files) for the existing locales: | ||
|
||
.. code-block:: bash | ||
|
||
pybabel update -i src/pydata_sphinx_theme/locale/sphinx.pot -d src/pydata_sphinx_theme/locale -D sphinx | ||
|
||
**To run this in ``.nox``**: ``nox -s translate -- update``. | ||
tox run -e i18n-update |
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.
since the workflow is
tox run -e i18n-extract
tox run -e i18n-update
...with apparently no steps in between, I find myself wondering why these are two separate steps (from the contributor perspective). Why not a single tox command to do both things?
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.
🤔 all the sources and projects I surveyed to get an idea of the workflow treat these as a separate step... will have another thought and it might make sense to merge
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.
IIUC, I guess it makes sense sometimes to do update
without doing extract
(i.e., if only non-translatable stuff changed, and you just want to update the line numbers)? But even so it would still be possible to have a single recipe to do both, and a sub-recipe that only did the update part.
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.
ok I just merged extract and update so this is now part of the same command/step
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.
That makes total sense to me based on the workflow I followed.
docs/community/topics/i18n.rst
Outdated
Translation files | ||
------------------ |
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.
some of the info in this section (e.g., "there are 3 types of files, here's what they are") would have been useful context at the beginning of the page... but some of it (e.g., details about #:
vs #,
) might be too "in the weeds" to come right at the beginning. Consider splitting up?
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.
This is a section I struggled with -- content and position -- so perhaps splitting would be good.
I think the too detailed bits can go under the "Tips" section...
189de0e
to
b3dacbd
Compare
This is a piece of the puzzle I am not sure about. @12rambau since you have been managing this can you help clarify this? Have you been manually updating the files?
Yes. Once the PO files are up any contributor/community member can join the team and translate the theme in Transifex directly
We have a GH integration for this. Once translations are updated we get an automatic PR like #1936 that we then review and merge |
Thanks for the explanation/clarification :) |
It also seems that the Transifex integration can be configured to automatically pull changes from our repo https://help.transifex.com/en/articles/6265125-github-installation-and-configuration That is the only question remaining for @12rambau and I don't think that is a blocker as we could in any case update the files manually later. So aside from that the PR is ready now I believe |
docs-live-theme: stb serve docs --open-browser --re-ignore=locale|api|_build|\.jupyterlite\.doit\.db | ||
docs-live: sphinx-autobuild docs/ docs/_build/html --open-browser --re-ignore=locale|api|_build|\.jupyterlite\.doit\.db |
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.
Got annoyed at the docs live
command rebuilding also the JS/CSS assets when working only in docs so I split it here.
Co-authored-by: Daniel McCloy <[email protected]>
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.
I noticed something that looks off
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.
I noticed something that looks off
#. Sign up for a `Transifex account <https://www.transifex.com/signup/>`__. | ||
#. Join the `PyData Sphinx Theme project <https://explore.transifex.com/12rambau/pydata-sphinx-theme/>`__. | ||
#. Select the language you want to localize. If the language you are looking for is not listed, you can `open an issue on GitHub to request it <https://github.com/pydata/pydata-sphinx-theme/issues>`__. Then you can open a pull request | ||
to add the new language following the steps outlined in :ref:`adding-new-language`. |
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.
Had to revert as the previous one was making the docs build fail
Thanks ! |
This PR supersedes #1294 and is the last missing piece to get rid of
nox
and the `noxfile.Summary:
tox.ini
fileQuestions:
sphinx.pot
tomessages.pot
which I agree with and aligns best with best practices but I did not change it here since I do not know what the implications are for Transifex @12rambau you might be able to give more insights.mo
files at the same time with compile our other JS assets (see https://github.com/trallard/pydata-sphinx-theme/blob/e9b8d72b6d2d9412f878d3ffd10915a0d23f9e65/webpack.config.js#L22) so perhaps this should be decoupled? And we'd just need to ensure that the files are accordingly updated (maybe through CI) - Edit: I have now removed thePO
compilation fromwebpack.config