Skip to content

Add a GH action to update the translation issues when .po files change - #789

Draft
flpm wants to merge 3 commits into
pyOpenSci:mainfrom
flpm:action-to-refresh-translation-issues
Draft

Add a GH action to update the translation issues when .po files change#789
flpm wants to merge 3 commits into
pyOpenSci:mainfrom
flpm:action-to-refresh-translation-issues

Conversation

@flpm

@flpm flpm commented Aug 9, 2026

Copy link
Copy Markdown
Member

This is part 4 of the work to create scripts to help maintain translations and their GH issues.

1) Create a translation maintenance issue to track of translation maintenance work and subscribe to Slack #translations #780
2) Create a GH action to monitor when the English source of the guide and post a comment on the translation maintenance issue #781
3) Split the computation of translation stats from the Sphinx extension so scripts can use it #786
4) Create a GH action to keep the translation issues used by contributors up to date when po files change
5) Create a script to create new issues when a new language (or a new .po file) is created
6) Create a simple create-new-language.py script that maintainers can call to take all actions required to add a new language to the guide: creates the po files, adds the language to the list of languages, create the GH issues, etc.
7) Document everything in TRANSLATING.md, in a section for maintainers, explaining how this all works and how to use it.

What was done

  • Added a new a GH action to check if the translation issues need to be updated and update them. Triggers every time .po files change on main. Checks all locales.
  • Added a Python script refresh_translation_issues.py, called by the action
  • Added tests for the python logic in test_refresh_translation_issues.py
  • Added a template for the parent issue parent_issue_template.md - See an example of parent issue: Help translate the Python Packaging Guide into Greek #715
  • Added a template for the sub-issue child_issue_template.md - See an example of sub-issue: Translate index.po into Greek #752
  • Modified noxfile.py so the test-translation-scripts action works with the new tests

How to test

Run nox -s test-translation-scripts

AI disclosure

Claude code help me to write this code, I reviewed everything the AI wrote and take full responsibility for how it works.

@flpm flpm self-assigned this Aug 9, 2026
@flpm flpm added translations Translation and localization of content maintenance labels Aug 9, 2026
@flpm
flpm requested review from InessaPawson and lwasser August 10, 2026 00:12
@flpm
flpm marked this pull request as draft August 10, 2026 13:02
refresh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- uses: actions/checkout@v4
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- uses: actions/setup-python@v5
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0

@lwasser lwasser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@flpm this looks good to me but i have NOT tested it locally! my big ask is to pin the ci action steps I did a few of them from our other action :)

IN a separate PR can we please document this new process / infra for others as well? i'm excited to see it in action

run: python -m pip install babel

- name: Collect the issues that track each language
uses: actions/github-script@v7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we please pin / harden this with a hash?

fi

- name: Rewrite them
uses: actions/github-script@v7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This as well please harden with a hash.


- name: Report anything that needs a maintainer
if: steps.render.outputs.report == 'true'
uses: actions/github-script@v7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One last one to harden - any others just grab the release commit and then dependabot will keep it current using a version specific hash

@flpm

flpm commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Good catch! I will pin the versions and check the other action already merged to make sure it's pinned.

I plan to make some changes so I made it a draft for now. I will add the last script and the documentation the process here too before marking PR ready for review again.

The overall goal is to make it simple to use and to understand/maintain. It will make more sense when I document the big picture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance translations Translation and localization of content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants