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

Add a job to automatically update translations #1769

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented Sep 8, 2022

This job runs weekly (or explicitly manual). It lists the languages in a way that GitHub Actions can reuse it in a matrix. Then for every language it updates the translations and creates a PR in a branch for every language.

I believe it doesn't create a PR if it's up to date, but I'm not certain.

Example outputs (disregard the unrelated commits):

@ekohl ekohl requested a review from a team as a code owner September 8, 2022 12:28
@ekohl
Copy link
Collaborator Author

ekohl commented Sep 8, 2022

This job runs weekly (or explicitly manual).

I changed my mind. Let's start with explicitly manual first and then move to cron.

Comment on lines +43 to +54
- name: Open a PR
uses: peter-evans/create-pull-request@v3
with:
commit-message: "Update ${{ matrix.language }} translations from Crowdin"
branch: "update_translations/${{ matrix.language }}"
title: "Update ${{ matrix.language }} translations from Crowdin"
body: ''
delete-branch: true
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that this removes any commits in update_translations and rebases it back to master. So this isn't good if you want to work on the branch.

.github/list_languages Outdated Show resolved Hide resolved
@das-g
Copy link
Member

das-g commented Sep 8, 2022

For automatically scheduled PR, I think we'd want to only consider languages for which the translation of Crowdin is complete (=has 100% "translated" coverage). For languages not marked "(beta)" in our language overview, we might even want 100% proofread on Crowdin.

@ekohl
Copy link
Collaborator Author

ekohl commented Sep 8, 2022

I think we can use an input to select beta or non-beta. However, I have found that the codes we use do not map straight to the codes on Crowdin. For example, where we use zh, the project code on Crowdin is zh-CN. Similar, pt is pt-PT.

@ekohl
Copy link
Collaborator Author

ekohl commented Sep 8, 2022

@das-g I'm leaning to maintaining a langs.json file. We can also write a simple converted to generate LANGS.md based on it. That avoids parsing and allows the additional metadata of the exact code. Thoughts?

@das-g
Copy link
Member

das-g commented Sep 8, 2022

Similar, pt is pt-PT.

Are you sure?

* [🇧🇷 Português-brasileiro](pt/)

seems to indicate our pt corresponds to pt-BR. IIRC, the efforts to translate the tutorial to pt-PT, too, are more recent and the result hasn't been released, yet.

I'm leaning to maintaining a langs.json file. We can also write a simple converted to generate LANGS.md based on it. That avoids parsing and allows the additional metadata of the exact code. Thoughts?

As soon as we have two variants of the same language, we should probably switch to the language variant abbreviations (that's what Crowdin seems to use) instead of the language abbreviations for our directory names, anyway. But yes, it makes sense not to have to parse (beta) out of a markdown file, so having that information in JSON and generating the Markdown file might be a good idea.

@ekohl
Copy link
Collaborator Author

ekohl commented Sep 8, 2022

@matthieugouel
Copy link

Hey, I recently came across Crowdin and added some translations.

I see from Crowdin contribution page that people frequently make some translations here and there.
I'm trying to understand how the work on Crowdin is merged on the repository. Do you do manual PRs from time to time? I quickly looked at the recent commits and didn't seem to see that so I was wondering if the Crowdin project was still used (before I spend some time on it).

@ekohl
Copy link
Collaborator Author

ekohl commented Jan 16, 2024

AFAIK right now people submit PRs manually. AFAIK CrowdIn has some GitHub integration, but we don't have that enabled. The intent behind this PR was to start submitting PRs automatically so maintainers only need to press the merge button.

@fltfx
Copy link
Member

fltfx commented Oct 13, 2024

@ekohl Can this PR be closed?

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