tutorial icon indicating copy to clipboard operation
tutorial copied to clipboard

Add a job to automatically update translations

Open ekohl opened this issue 2 years ago • 9 comments

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):

  • https://github.com/ekohl/tutorial/runs/8251377015?check_suite_focus=true (the actual run)
  • https://github.com/ekohl/tutorial/pull/3
  • https://github.com/ekohl/tutorial/pull/4

ekohl avatar Sep 08 '22 12:09 ekohl

This job runs weekly (or explicitly manual).

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

ekohl avatar Sep 08 '22 12:09 ekohl

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.

das-g avatar Sep 08 '22 13:09 das-g

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 avatar Sep 08 '22 14:09 ekohl

@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?

ekohl avatar Sep 08 '22 14:09 ekohl

Similar, pt is pt-PT.

Are you sure? https://github.com/DjangoGirls/tutorial/blob/50d6da3352f0ee116aa329b6b39f7d2f79cf317c/LANGS.md?plain=1#L15 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.

das-g avatar Sep 08 '22 16:09 das-g

I found that https://crowdin.com/backend/download/project/django-girls-tutorial/pt.zip is a 404. See https://github.com/ekohl/tutorial/runs/8251377015?check_suite_focus=true (ignore en, I skipped that explicitly).

ekohl avatar Sep 08 '22 16:09 ekohl

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).

matthieugouel avatar Jan 15 '24 20:01 matthieugouel

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.

ekohl avatar Jan 16 '24 18:01 ekohl