-
Notifications
You must be signed in to change notification settings - Fork 49
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
fix: avoid overriding manual edits for newer entries #2177
Conversation
Thanks for the pull request, @OmarIthawi! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
9d41f4b
to
d5fed36
Compare
Status: I'll pause working on this pull request until we're done with the edx platform backend work. |
@@ -44,10 +44,6 @@ jobs: | |||
old_slug: course_discovery | |||
old_project_slug: edx-platform | |||
|
|||
- new_slug: course-discovery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate, removed
@@ -181,7 +217,7 @@ def run_from_workflow_yaml_file(self, workflow_configs): | |||
""" | |||
Run the script from a GitHub Actions migrate-from-transifex-old-project.yml workflow file. | |||
""" | |||
pairs_list = workflow_configs['jobs']['migrate-translations']['strategy']['matrix']['batch'] | |||
pairs_list = workflow_configs['jobs']['migrate-translations']['strategy']['matrix']['resource'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the key name has changed, the sync is broken otherwise due to KeyError
if __name__ == '__main__': | ||
command = Command(sys.argv, environ=os.environ, tx_api=transifex_api) | ||
def main(): # pragma: no cover | ||
parser = argparse.ArgumentParser(description=__doc__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added argparse to protect against argv typos.
8209b9c
to
537b62c
Compare
537b62c
to
39975db
Compare
39975db
to
bd896e1
Compare
@brian-smith-tcril @shadinaif this pull request is now ready for review. |
current_translation_time = parse_tx_date(current_translation.datetime_translated) | ||
|
||
if old_project_translation_time and current_translation_time: | ||
newer_translation_found = current_translation_time > old_project_translation_time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the gist of the pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Thank you so much for this!
@OmarIthawi 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Problem
We've done about 200 manual fix on the https://app.transifex.com/open-edx/openedx-translations/ to fix translation validation issues in PRs such as d1ddaa7.
Those changes would be overridden on the next sync and needs to be fixed again.
For more information, please check this Slack Thread about the problem.
Solution
This pull request will only update the translation string if new translation is found:
TODO
$ make SYNC_ARGS=--dry-run TX_NEW_SLUG=course-discovery TX_OLD_SLUG=course_discovery TX_OLD_PROJECT_SLUG=edx-platform TX_LANGUAGES=es_419 sync_translations
This pull request is part of the FC-0012 project which implements the Translation Infrastructure update OEP-58.