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

Extract Strings Github Action #129

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jermy-c
Copy link
Collaborator

@jermy-c jermy-c commented Jul 10, 2024

Changes

  • Add Github action that extracts strings and pushes the extracted strings back to the repo

Proposed workflow

  1. Trigger Github Action Extract Strings, this leaves extracted strings empty so it's safe to have them in the master branch
  2. Weblate receives changes and triggers automatic translation using desired translation engine e.g. LibreTranslate, DeepL or Google Cloud Translation Basic
  3. Translated strings are labeled Automatically translated and marked as Needs editing
  4. Translators edit translation and the Automatically translated label and Needs editing are automatically removed
  5. Changes are pushed to translations branch
  6. Check for ICU Message Format syntax errors on Weblate and create a PR
  7. Merge changes into master

@jermy-c jermy-c requested a review from benbucksch July 10, 2024 18:44
@jermy-c jermy-c self-assigned this Jul 10, 2024
.github/workflows/extract-strings.yml Outdated Show resolved Hide resolved
.github/workflows/extract-strings.yml Outdated Show resolved Hide resolved
@benbucksch
Copy link
Collaborator

benbucksch commented Jul 10, 2024

We cannot always wait for translators for every string addition. We do not have translators for all languages that are constantly standing waiting. We can hire translators only maybe once per year.

Can we instead use the following workflow?

  • Extract strings, and add them to the translation source file in the code repo (l10n:extract)
  • Push to automatic translation
  • Pull automatic translations and add them to into translated files in the code repo, in the right place
  • Commit
  • Push to Weblate
  • Release
  • Let translators double-check (typically many weeks months later)
  • Release

@benbucksch
Copy link
Collaborator

@jermy-c Can you please make a new PR which implements the above workflow? Steps 1-5 above should be a single Github action.

@benbucksch
Copy link
Collaborator

benbucksch commented Jul 16, 2024

More concretely, steps 1, 2, 3 and 5 should each have their own commands in packages.json. Then, another packages.json command should do steps 1-3 and 5 (but not the step 4 commit) together. Lastly, a github action invokes that command, and then makes the git commit, as done here in this PR.

This allows us to do things either manually on the local machine, or via GitHub Actions.

(UPDATE: Typo of step numbers corrected.)

@jermy-c
Copy link
Collaborator Author

jermy-c commented Jul 16, 2024

Sounds good, will do.

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.

2 participants