Skip to content

feat: extract sync_and_translate_language into new ol_openedx_ai_static_translations plugin#758

Closed
Copilot wants to merge 7 commits intomainfrom
copilot/remove-sync-translate-command
Closed

feat: extract sync_and_translate_language into new ol_openedx_ai_static_translations plugin#758
Copilot wants to merge 7 commits intomainfrom
copilot/remove-sync-translate-command

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

Moves the sync_and_translate_language management command and all supporting code out of ol_openedx_course_translations into a standalone plugin within open-edx-plugins (not ol-django).

New plugin: ol_openedx_ai_static_translations

  • Follows existing plugin conventions (pyproject.toml, setup.cfg, apps.py, settings, etc.)
  • Flat module layout — no utils/ package. command_utils.py + translation_sync.py merged into a single utils.py; constants.py lives at the package root
  • CMS-only entry point with its own settings for sync-specific config (TRANSLATIONS_GITHUB_TOKEN, TRANSLATIONS_REPO_URL, TRANSLATIONS_REPO_PATH)
  • Glossary files included in the new plugin
  • Dependencies: GitPython, litellm, polib, requests

Changes to ol_openedx_course_translations

  • Removed sync-specific settings from settings/common.py (now owned by the new plugin)
  • Glossary files retained (kept in both plugins)
  • No functional changes to translate_course or any other existing code

Removed

  • ol_django_plugin/ directory from prior iteration

Import structure

# management command imports
import ol_openedx_ai_static_translations.utils as utils_module
from ol_openedx_ai_static_translations.constants import PLURAL_FORMS, ...
from ol_openedx_ai_static_translations.utils import sync_all_translations, ...

Glossary path resolution updated from .parent.parent.parent to reflect the flat layout (utils.py at package root instead of utils/translation_sync.py).


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ts, glossaries, and dependencies

Co-authored-by: asadali145 <52656433+asadali145@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove sync_and_translate_language command from open-edx-plugins Remove sync_and_translate_language command from ol_openedx_course_translations Mar 11, 2026
Copilot AI and others added 2 commits March 11, 2026 18:24
Co-authored-by: asadali145 <52656433+asadali145@users.noreply.github.com>
Co-authored-by: asadali145 <52656433+asadali145@users.noreply.github.com>
Copilot AI changed the title Remove sync_and_translate_language command from ol_openedx_course_translations Move sync_and_translate_language to ol-django, keep glossaries Mar 11, 2026
@asadali145 asadali145 force-pushed the copilot/remove-sync-translate-command branch from 65a5fef to db57172 Compare March 12, 2026 06:31
Copilot AI and others added 3 commits March 12, 2026 06:58
Combines both utility modules into a single file at the plugin root level:
- Deduplicated and merged all imports
- Updated constants import path from mitol.ol_ai_static_translations.utils.constants
  to ol_openedx_ai_static_translations.constants
- command_utils functions placed first (foundational/validation utilities)
- translation_sync functions follow (depend on simpler utils)
- All 63 functions preserved without implementation changes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move sync_and_translate_language command and related code into a new
plugin following existing patterns. Remove ol_django_plugin/ directory.

- New plugin with flat structure: constants.py and utils.py at package root
- utils.py merges command_utils.py and translation_sync.py into single file
- Glossary files included in new plugin
- Settings for sync-specific config (GITHUB_TOKEN, REPO_URL, REPO_PATH)
- Clean up course_translations settings to remove sync-specific settings

Co-authored-by: asadali145 <52656433+asadali145@users.noreply.github.com>
Co-authored-by: asadali145 <52656433+asadali145@users.noreply.github.com>
Copilot AI changed the title Move sync_and_translate_language to ol-django, keep glossaries Extract sync_and_translate_language into new ol_openedx_ai_static_translations plugin Mar 12, 2026
@asadali145 asadali145 changed the title Extract sync_and_translate_language into new ol_openedx_ai_static_translations plugin feat: extract sync_and_translate_language into new ol_openedx_ai_static_translations plugin Mar 13, 2026
Copilot AI added a commit that referenced this pull request Mar 24, 2026
@asadali145
Copy link
Copy Markdown
Contributor

Closing in favor of #769

@asadali145 asadali145 closed this Mar 27, 2026
asadali145 added a commit that referenced this pull request Apr 13, 2026
asadali145 added a commit that referenced this pull request Apr 27, 2026
…dx_course_translations (#769)

* Initial plan

* Add ol_openedx_ai_static_translations plugin from PR #758

Co-authored-by: asadali145 <52656433+asadali145@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mitodl/open-edx-plugins/sessions/eaab10e1-8468-4675-9118-cd9b1fdac54e

* Apply PR #760 glossary path changes to ol_openedx_ai_static_translations

Co-authored-by: asadali145 <52656433+asadali145@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mitodl/open-edx-plugins/sessions/eaab10e1-8468-4675-9118-cd9b1fdac54e

* cleanup: delete glossary dirs and remove moved code from ol_openedx_course_translations

Co-authored-by: asadali145 <52656433+asadali145@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mitodl/open-edx-plugins/sessions/0ad538c8-6c6c-4b49-852c-62936b165920

* more refactoring

* refactor: address review feedback on ol_openedx_ai_static_translations

Agent-Logs-Url: https://github.com/mitodl/open-edx-plugins/sessions/f770b098-565c-42d4-b11b-06957474d61f

Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#783)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.8 → v0.15.10](astral-sh/ruff-pre-commit@v0.15.8...v0.15.10)
- [github.com/pre-commit/mirrors-mypy: v1.19.1 → v1.20.1](pre-commit/mirrors-mypy@v1.19.1...v1.20.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>

* feat: add clear expired tokens task in ol-social-auth (#778)

* feat: add task

* fix: issues

* chore: bump version

* docs: update readme

* fix: issues

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: rename to CELERYBEAT_SCHEDULE

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>

* Initial plan

Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>

* docs: move sync_and_translate_language docs to ol_openedx_ai_static_translations README

Agent-Logs-Url: https://github.com/mitodl/open-edx-plugins/sessions/cf432dde-79f7-4c53-9dd0-e8aabb112dd2

Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>

* Initial plan

Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>

* Initial plan

Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>

* revert: remove spurious main commits from branch history

Reverts the changes introduced by two commits that were accidentally
included in this branch during an earlier rebase on a shallow clone:
- f71e486 (feat: add clear expired tokens task in ol-social-auth #778)
- 7226134 ([pre-commit.ci] pre-commit autoupdate #783)

These commits are already in main; including them here caused the PR
to show unrelated ol_social_auth and pre-commit changes.

Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>

* fix: remove spurious ol-openedx-course-outline-api entries from uv.lock

Agent-Logs-Url: https://github.com/mitodl/open-edx-plugins/sessions/1159269e-c5c3-4a1f-a502-df05ad32ee07

Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: asadali145 <52656433+asadali145@users.noreply.github.com>
Co-authored-by: Asad Ali <asad.ali@arbisoft.com>
Co-authored-by: arslanashraf7 <34372316+arslanashraf7@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Muhammad Anas <88967643+Anas12091101@users.noreply.github.com>
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