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

Revamp translations process #1514

Merged

Conversation

UlisesGascon
Copy link
Member

@UlisesGascon UlisesGascon commented May 9, 2024

Main Changes

New workflow (79e274a and 4f2d3ef)

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 (14d2266 and cfd449d)

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

@UlisesGascon UlisesGascon added enhancement doc 5.x Docs for 5.x version labels May 9, 2024
Copy link

netlify bot commented May 9, 2024

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 06cf782
🔍 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.

@UlisesGascon UlisesGascon marked this pull request as ready for review May 9, 2024 11:21
@UlisesGascon UlisesGascon self-assigned this May 9, 2024
CONTRIBUTING.md Outdated Show resolved Hide resolved
@crandmck
Copy link
Member

crandmck commented May 9, 2024

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
Copy link
Member Author

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

Let's use #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).

@crandmck crandmck self-requested a review May 10, 2024 23:13
Copy link
Member

@crandmck crandmck left a comment

Choose a reason for hiding this comment

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

Thanks for clarifying... LGTM!

@UlisesGascon
Copy link
Member Author

I will merge it and see if works 👍

@UlisesGascon UlisesGascon merged commit f9b3563 into expressjs:gh-pages May 11, 2024
7 checks passed
@UlisesGascon UlisesGascon deleted the chore/track-translations branch May 11, 2024 09:47
@UlisesGascon
Copy link
Member Author

It worked as expected! I made a manual run against #1515 (actions details) and the labels were added 🥳

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

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

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

Successfully merging this pull request may close these issues.

2 participants