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

feat: fix random and lengthy slugs and support -js suffix #1006

Merged
merged 3 commits into from
Sep 11, 2023

Conversation

OmarIthawi
Copy link
Member

@OmarIthawi OmarIthawi commented Sep 10, 2023

Changes

  • chore: add pytest-cov
  • feat: fix resource names monthly: To give some time leeway for Transifex to add new resources as opposed to expect it to add the resource immediately after a pull request is merged.
  • feat: fix random and lengthy slugs and support -js suffix

Testing

  • Added basic unit tests for the new cases
  • Tested in dry-run
  • Ran locally and updated all Transifex resources
  • Fix errors manually for duplicate slugs by hand
Test results
$ make fix_transifex_resource_names
python scripts/fix_transifex_resource_names.py
Updating openedx-translations project resource and slug names:
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:audioxblock
Resource slug: audioxblock
Resource name: AudioXBlock
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/AudioXBlock/audio/conf/locale/en/LC_MESSAGES/django.po
Skipping: "AudioXBlock" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:completion
Resource slug: completion
Resource name: completion
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/completion/completion/conf/locale/en/LC_MESSAGES/django.po
Skipping: "completion" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:course-discovery
Resource slug: course-discovery
Resource name: course-discovery
Resource categories: 
Skipping: "course-discovery" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:course-discovery-js
Resource slug: course-discovery-js
Resource name: course-discovery-js
Resource categories: 
Skipping: "course-discovery-js" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:credentials
Resource slug: credentials
Resource name: credentials
Resource categories: 
Skipping: "credentials" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:credentials-js
Resource slug: credentials-js
Resource name: credentials-js
Resource categories: 
Skipping: "credentials-js" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:donexblock
Resource slug: donexblock
Resource name: DoneXBlock
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/DoneXBlock/done/conf/locale/en/LC_MESSAGES/django.po
Skipping: "DoneXBlock" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:edx-ace
Resource slug: edx-ace
Resource name: edx-ace
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/edx-ace/edx_ace/conf/locale/en/LC_MESSAGES/django.po
Skipping: "edx-ace" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:edx-bulk-grades
Resource slug: edx-bulk-grades
Resource name: edx-bulk-grades
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/edx-bulk-grades/bulk_grades/conf/locale/en/LC_MESSAGES/django.po
Skipping: "edx-bulk-grades" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:edx-ora2
Resource slug: edx-ora2
Resource name: edx-ora2
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/edx-ora2/openassessment/conf/locale/en/LC_MESSAGES/django.po
Skipping: "edx-ora2" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:edx-ora2-js
Resource slug: edx-ora2-js
Resource name: edx-ora2-js
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/edx-ora2/openassessment/conf/locale/en/LC_MESSAGES/djangojs.po
Skipping: "edx-ora2-js" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:edx-proctoring
Resource slug: edx-proctoring
Resource name: edx-proctoring
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/edx-proctoring/edx_proctoring/conf/locale/en/LC_MESSAGES/django.po
Skipping: "edx-proctoring" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:edx-proctoring-js
Resource slug: edx-proctoring-js
Resource name: edx-proctoring-js
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/edx-proctoring/edx_proctoring/conf/locale/en/LC_MESSAGES/djangojs.po
Skipping: "edx-proctoring-js" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:feedbackxblock
Resource slug: feedbackxblock
Resource name: FeedbackXBlock
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/FeedbackXBlock/feedback/conf/locale/en/LC_MESSAGES/django.po
Skipping: "FeedbackXBlock" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-account
Resource slug: frontend-app-account
Resource name: frontend-app-account
Resource categories: 
Skipping: "frontend-app-account" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-authn
Resource slug: frontend-app-authn
Resource name: frontend-app-authn
Resource categories: 
Skipping: "frontend-app-authn" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-communications
Resource slug: frontend-app-communications
Resource name: frontend-app-communications
Resource categories: 
Skipping: "frontend-app-communications" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-course-authoring
Resource slug: frontend-app-course-authoring
Resource name: frontend-app-course-authoring
Resource categories: 
Skipping: "frontend-app-course-authoring" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-discussions
Resource slug: frontend-app-discussions
Resource name: frontend-app-discussions
Resource categories: 
Skipping: "frontend-app-discussions" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-ecommerce
Resource slug: frontend-app-ecommerce
Resource name: frontend-app-ecommerce
Resource categories: 
Skipping: "frontend-app-ecommerce" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-enterprise-public-catalog
Resource slug: frontend-app-enterprise-public-catalog
Resource name: frontend-app-enterprise-public-catalog
Resource categories: 
Skipping: "frontend-app-enterprise-public-catalog" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-gradebook
Resource slug: frontend-app-gradebook
Resource name: frontend-app-gradebook
Resource categories: 
Skipping: "frontend-app-gradebook" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-learner-dashboard
Resource slug: frontend-app-learner-dashboard
Resource name: frontend-app-learner-dashboard
Resource categories: 
Skipping: "frontend-app-learner-dashboard" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-learner-record
Resource slug: frontend-app-learner-record
Resource name: frontend-app-learner-record
Resource categories: 
Skipping: "frontend-app-learner-record" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-learning
Resource slug: frontend-app-learning
Resource name: frontend-app-learning
Resource categories: 
Skipping: "frontend-app-learning" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-library-authoring
Resource slug: frontend-app-library-authoring
Resource name: frontend-app-library-authoring
Resource categories: 
Skipping: "frontend-app-library-authoring" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-ora-grading
Resource slug: frontend-app-ora-grading
Resource name: frontend-app-ora-grading
Resource categories: 
Skipping: "frontend-app-ora-grading" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-payment
Resource slug: frontend-app-payment
Resource name: frontend-app-payment
Resource categories: 
Skipping: "frontend-app-payment" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-profile
Resource slug: frontend-app-profile
Resource name: frontend-app-profile
Resource categories: 
Skipping: "frontend-app-profile" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-program-console
Resource slug: frontend-app-program-console
Resource name: frontend-app-program-console
Resource categories: 
Skipping: "frontend-app-program-console" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-app-support-tools
Resource slug: frontend-app-support-tools
Resource name: frontend-app-support-tools
Resource categories: 
Skipping: "frontend-app-support-tools" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-component-footer
Resource slug: frontend-component-footer
Resource name: frontend-component-footer
Resource categories: 
Skipping: "frontend-component-footer" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-component-header
Resource slug: frontend-component-header
Resource name: frontend-component-header
Resource categories: 
Skipping: "frontend-component-header" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-lib-content-components
Resource slug: frontend-lib-content-components
Resource name: frontend-lib-content-components
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/frontend-lib-content-components/src/i18n/transifex_input.json
Skipping: "frontend-lib-content-components" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:frontend-lib-special-exams
Resource slug: frontend-lib-special-exams
Resource name: frontend-lib-special-exams
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/frontend-lib-special-exams/src/i18n/transifex_input.json
Skipping: "frontend-lib-special-exams" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:paragon
Resource slug: paragon
Resource name: paragon
Resource categories: 
Skipping: "paragon" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:recommenderxblock
Resource slug: recommenderxblock
Resource name: RecommenderXBlock
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/RecommenderXBlock/recommender/conf/locale/en/LC_MESSAGES/django.po
Skipping: "RecommenderXBlock" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:studio-frontend
Resource slug: studio-frontend
Resource name: studio-frontend
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/studio-frontend/src/i18n/transifex_input.json
Skipping: "studio-frontend" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:xblock-drag-and-drop-v2
Resource slug: xblock-drag-and-drop-v2
Resource name: xblock-drag-and-drop-v2
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/xblock-drag-and-drop-v2/drag_and_drop_v2/conf/locale/en/LC_MESSAGES/django.po
Skipping: "xblock-drag-and-drop-v2" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:xblock-free-text-response
Resource slug: xblock-free-text-response
Resource name: xblock-free-text-response
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/xblock-free-text-response/freetextresponse/conf/locale/en/LC_MESSAGES/django.po
Skipping: "xblock-free-text-response" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:xblock-google-drive
Resource slug: xblock-google-drive
Resource name: xblock-google-drive
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/xblock-google-drive/google_drive/conf/locale/en/LC_MESSAGES/django.po
Skipping: "xblock-google-drive" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:xblock-image-explorer
Resource slug: xblock-image-explorer
Resource name: xblock-image-explorer
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/xblock-image-explorer/image_explorer/conf/locale/en/LC_MESSAGES/django.po
Skipping: "xblock-image-explorer" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:xblock-image-modal
Resource slug: xblock-image-modal
Resource name: xblock-image-modal
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/xblock-image-modal/imagemodal/conf/locale/en/LC_MESSAGES/django.po
Skipping: "xblock-image-modal" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:xblock-lti-consumer
Resource slug: xblock-lti-consumer
Resource name: xblock-lti-consumer
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/xblock-lti-consumer/lti_consumer/conf/locale/en/LC_MESSAGES/django.po
Skipping: "xblock-lti-consumer" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:xblock-qualtrics-survey
Resource slug: xblock-qualtrics-survey
Resource name: xblock-qualtrics-survey
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/xblock-qualtrics-survey/qualtricssurvey/conf/locale/en/LC_MESSAGES/django.po
Skipping: "xblock-qualtrics-survey" because it seems to have a proper attributes
------------
Updating:
Resource id: o:open-edx:p:openedx-translations:r:xblock-sql-grader
Resource slug: xblock-sql-grader
Resource name: xblock-sql-grader
Resource categories: github#repository:openedx/openedx-translations#branch:main#path:translations/xblock-sql-grader/sql_grader/conf/locale/en/LC_MESSAGES/django.po
Skipping: "xblock-sql-grader" because it seems to have a proper attributes

This contribution is part of the FC-0012 project which is sparked by the Translation Infrastructure update OEP-58.

To give some time leeway for Transifex to add new resources
as opposed to expect it to add the resource immediately after a pull
request is merged.
@openedx-webhooks
Copy link

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:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Sep 10, 2023
@brian-smith-tcril brian-smith-tcril merged commit 8a24431 into openedx:main Sep 11, 2023
@openedx-webhooks
Copy link

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

@brian-smith-tcril
Copy link
Contributor

I did this as a merge commit but that seems to have not kicked off the CI. I figured since there were multiple commits in this PR that made sense to have as individual commits that'd be better than a squash, but I probably should have done a rebase & merge instead.

@OmarIthawi
Copy link
Member Author

Thanks for the triage @brian-smith-tcril.

The CI kicks off in three cases including push on main only if the Transifex configs are changed:

https://github.com/Zeit-Labs/openedx-translations/blob/b8eef966dc45849d2c2200df9f4d05234c4398ab/.github/workflows/fix-transifex-resource-names.yml#L6-L13

So, it's functioning as intended. To ensure all is well, I've kicked it off manually and it seems to be working pretty well:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants