-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39d2ed1
commit 851ba5e
Showing
6 changed files
with
318 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
Mark Transifex invalid entries as fuzzy | ||
####################################### | ||
|
||
Problem | ||
******* | ||
|
||
As part of the `OEP-58`_ Transifex GitHub App bot has now syncs Translations. | ||
Bot creates pull requests with invalid entries in the | ||
po-files. These entries are validated by `LexiQA`_, Transifex-builtin quality | ||
checks as well as human reviewers. However, some invalid translations still | ||
make it into the sync translation pull requests which breaks | ||
``django compilemessages`` command and is catchable by ``msgfmt``. | ||
|
||
If Transifex had marked the invalid entries as fuzzy, then the | ||
``django compilemessages`` command would have ignored them. However, that's | ||
not the case. Therefore, we need to perform this task ourselves. | ||
|
||
|
||
Design Decision | ||
*************** | ||
|
||
Implement a GitHub Actions workflow that will mark the invalid entries as | ||
``fuzzy``. Then create a commit -- editing the pull request -- to branch | ||
of the bot pull request. | ||
|
||
To ensure a safe and reliable workflow, the following workflows will be | ||
combined into one single workflow with multiple jobs: | ||
|
||
#. Run ``python-tests.yml`` to validate the python code | ||
#. Then, run ``validate-translation-files.yml`` which performs the following: | ||
|
||
#. Validate the po-files using ``msgfmt`` | ||
#. Mark the invalid entries as fuzzy (writes to the pofile) | ||
#. Validate the files again to ensure the files are became valid | ||
#. Commit the fixes if any | ||
|
||
#. Mark invalid entires as fuzzy therefore excluded from .mo files as well as msgfmt | ||
#. Validate the files again to ensure the files are still valid | ||
#. Commit the fixes | ||
#. Run the lint commits | ||
#. Push to the branch | ||
#. Trigger auto merge | ||
|
||
**Pros** | ||
|
||
* There's no need for manual intervention, therefor it's fast and won't | ||
create a backlog of pull requests. | ||
|
||
|
||
**Cons** | ||
|
||
* The workflow script runs and edits the pull request, which can be | ||
confusing for the reviewers. | ||
* The workflow lacks a notification mechanism to notify the reviewers | ||
that their translations are invalid. | ||
|
||
Rejected Alternatives | ||
********************* | ||
|
||
- **Create a Transifex issue:** It would be possible to identify the faulty | ||
entries and create a Transifex issue via API to the faulty entries. | ||
However, this would require attention from the translators | ||
team, which can take a rather long time therefore creating a backlog of | ||
invalid entries. Additionally, Transifex issues are not understood or used | ||
by most of the Open edX community. | ||
|
||
- **Post errors on Slack:** Post the errors on Slack and ask the translators | ||
to fix them. Same as the previous option, not all translators are on Slack. | ||
Additionally, this option would have a slow feedback loop causing the pull | ||
requests backlog to build-up. | ||
|
||
- **Mark faulty entries as unreviewed:** Use the Transifex API to mark the | ||
the invalid entires as unreviewed, then pull only reviewed entries into this | ||
repository. | ||
This option would require an extensive use the of the Transifex API, | ||
and pull again which can be complex to implement. Additionally, this option | ||
would have a slow feedback loop causing the pull requests backlog to | ||
build-up. | ||
|
||
|
||
.. _OEP-58: https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0058-arch-translations-management.html | ||
.. _LexiQA: https://help.transifex.com/en/articles/6219179-lexiqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.