Skip to content

Latest commit

 

History

History
104 lines (78 loc) · 4.21 KB

0002-mark-fuzzy-entries.rst

File metadata and controls

104 lines (78 loc) · 4.21 KB

Mark invalid entries in po files as fuzzy

Status

Rejected.

Context

As of OEP-58, the Transifex GitHub App is used to sync translations between Transifex projects and the openedx-translations repository. Within Transifex, translations are subjected to automated validation, incorporating checks from both the platform itself and the LexiQA add-on, in addition to being reviewed by human translators. During the synchronization process, the Transifex GitHub App creates pull requests to the openedx-translations repository. The pull requests trigger a CI workflow that runs msgfmt to validate the translations.

Problem

There are times when the translations being synchronized fail msgfmt validation. This prevents the pull requests from being automatically merged.

Default Workflow: Keep pull requests open

By default a failing pull request will be kept open. Once translators fix the invalid entries the Transifex GitHub App will update the pull request and merge it automatically.

Translators do not monitor pull requests to the openedx-translations repo, and have requested to be notified of invalid entries via slack. This will start as a manual process. Work to automate this in the future will be tracked in Notify translators about invalid entries.

Rejected Alternative: Mark invalid entries as fuzzy

A GitHub Actions workflow will be implemented to mark invalid entries in synchronized .po files as fuzzy. This will update pull requests created by the Transifex GitHub App.

To ensure a safe and reliable workflow, the following workflows will be combined into one single workflow with multiple jobs:

  1. Run python-tests.yml to validate the python code
  2. Then, run validate-translation-files.yml which performs the following:
    1. Validate the po-files using msgfmt
    2. Notify the translators about the invalid entries via the preferred communication channel (Slack, Transifex, GitHub)
    3. Edit the po files to mark invalid entries as fuzzy, so it's excluded from .mo files
    4. Revalidate the files
  3. Commit the updated entries and push to the PR branch
  4. Automatically merge the PR

Rejection Reasons

  • The workflow script edits the translations and effectively hide the errors, which can be confusing for the translators.
  • Writing to the pull request will not trigger the GitHub Actions workflow, therefore the pull request cannot be merged unless the commit status is overridden manually via GitHub "create a commit status" API.
  • The solution is .po file specific. And there's no similar solution for .json, .yaml, iOS, Android or other translations files.

Please refer to the original pull request which contains the rejected implementation: mark invalid entries as fuzzy | FC-0012.

Pros and Cons

Pros

  • New valid strings would make it into the .mo files
  • There's no need for manual intervention, therefore it's fast and won't create a backlog of pull requests.
  • Rejected strings are easily identifiable by looking in the code, so it's easy to fix them.
  • Translators can be notified about invalid translations via Slack, Transifex, GitHub depending on the community's preference.

Cons

  • The workflow script runs and edits the pull request, which can be confusing for the reviewers.
  • Previously valid entries are going to be overwritten with new fuzzy strings which will make those entries to be shown in source language (English).