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

refactor: update babel build #1294

Closed
wants to merge 14 commits into from
Closed

refactor: update babel build #1294

wants to merge 14 commits into from

Conversation

12rambau
Copy link
Collaborator

As discussed in #1292 the test and build structure is becoming heavier and heavier. This is a proposal change to deal with the specific case of translations.

  • Edition of the i18n page (typo + nox commands + titles)
  • split of the translation commands in noxfile:
    • translate is running the .pot and .po update
    • add_language is run with compulsory posargs to add a language folder/.po file
  • following suggestion from the nox repository I extended the session function to make some session non-compulsory (i.e. they will not be run in a simple nox command). from now on "doc-live" and "add_language" will only be run with nox -s

This modification is required to "free" the nox command. I would like to make some demo of consistent use in local/actions but this need to be done first.

If you like this implementation I would like to create a github action cron job that refresh .pot/.po files on regular basis.

Let me know if I should move forward.

Copy link
Collaborator

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The i18n docs changes look good in code (I didn't check rendered version). I don't understand why the translated strings are being removed from the .po files though; is this related to the recent transifex integration?

The noxfile.py changes look reasonable. Personally I never used nox to run all sessions (because why would I want to run tests, do static doc build, and then live server doc build all at once?) But if you or other devs are in the habit of running nox without -s session_name then I can see why these changes would be wanted.

What this doesn't address is the fact that our CI configs don't make use of our noxfile, so the simplification of .github/workflows/tests.yml that I was hoping for isn't happening here... I guess though that if you add the CRON job then at least the .PO compilation step gets removed from tests.yml right?

noxfile.py Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
noxfile.py Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
babel.cfg Outdated Show resolved Hide resolved
.github/workflows/translate.yml Outdated Show resolved Hide resolved
src/pydata_sphinx_theme/locale/es/LC_MESSAGES/sphinx.po Outdated Show resolved Hide resolved
@choldgraf
Copy link
Collaborator

This seems like a reasonable step forward to me, so generally +1. I haven't looked in depth at the implementation but i don't understand translations infrastructure super well so may not be helpful. I'll hold off on a closer look for when this is marked as ready for review (i have very limited time for open source right now, sure to having a 7 week old!)

@trallard
Copy link
Collaborator

This was superseded by #1606, will close this PR

@trallard trallard closed this Sep 11, 2024
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

Successfully merging this pull request may close these issues.

4 participants