expressjs / expressjs.com

https://expressjs.com
Other
5.23k stars 1.42k forks source link

Revamp translations process #1514

Closed UlisesGascon closed 1 month ago

UlisesGascon commented 1 month ago

Main Changes

New workflow (79e274ac09065f6485886cf5a06c16e87dc860ea and 4f2d3ef6aeb34cf6c3c6df461056812892f74249)

This PR introduces a new GitHub Actions workflow, "Check Translation", which automates the process of checking and managing translations in pull requests. The workflow is triggered on pull requests to the gh-pages branch that modify files in any of the language directories (e.g., 'en/', 'es/', 'fr/', etc.).

The workflow has two jobs:

  1. Checkout code: This job checks out the code of the pull request using the actions/checkout@v4 action.

  2. Check modified files and add labels: This job uses the actions/github-script@v5 action to run a script that checks the modified files in the pull request. The script identifies the languages that have been modified by examining the first part of the filename (before the first '/'). It then adds a label for each language that has not been modified, in the format requires-translation-<language>.

The workflow also supports manual triggering via the workflow_dispatch event. In this case, the PR number to check must be provided as an input.

This workflow will help us better track and manage translation tasks, ensuring that all languages are kept up-to-date.

New translation process documented (14d22669311ecf1ef68af509cda2fa438dc6f793 and cfd449dca422c0781d5ad0d223bc1e9033fd6f69)

Updated the CONTRIBUTING.md file to reflect the new process for translations. We now highly encourage community translations and we use the tags generated in the new workflow to coordinate the work.

Context

Notes

I was not able to test this locally, so I assume that we will test it once it is merged

netlify[bot] commented 1 month ago

Deploy Preview for expressjscom-preview ready!

Name Link
Latest commit 06cf782446b73bce39603b729f8e405a39507195
Latest deploy log https://app.netlify.com/sites/expressjscom-preview/deploys/663e28695adf2f0008b018b0
Deploy Preview https://deploy-preview-1514--expressjscom-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

crandmck commented 1 month ago

If I understand correctly, once this lands, any PR that updates the en docs will automatically get tagged with labels like requires-translation-es, requires-translation-fr, and so on. How will we use those labels once a PR lands?

I'm just trying to understand how this is going to work in practice.

UlisesGascon commented 1 month ago

I'm just trying to understand how this is going to work in practice.

Let's use https://github.com/expressjs/expressjs.com/pull/1515 as an example. This GitHub Action will run on this PR and add tags like requires-translation-es, requires-translation-fr, and so on (I did this manually).

Once the PR is merged, the idea is that the community can use these tags to filter, such as Search for pending Spanish translations, and start working on PRs that can port the changes from the original #1515 or others.

Once the PR related to the translation is merged, we can remove the requires-translation-es, requires-translation-fr, and other similar tags from the original PR #1515 (manually).

UlisesGascon commented 1 month ago

I will merge it and see if works :+1:

UlisesGascon commented 1 month ago

It worked as expected! I made a manual run against https://github.com/expressjs/expressjs.com/pull/1515 (actions details) and the labels were added :partying_face:

Screenshot from 2024-05-11 11-49-10

Note: for new PRs this step is automated, but manually we can check already opened PRs.