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