An Open edX plugin for AI-powered static translation management
Project description
OL Open edX AI Static Translations
An Open edX plugin that provides AI-powered static translation management. It syncs translation keys, translates them using LLM providers, and creates pull requests with translated content.
Purpose
This plugin provides the sync_and_translate_language management command for syncing and translating Open edX static strings (frontend JSON and backend PO files) using LLM providers (OpenAI, Gemini, Mistral) with optional glossary support.
Setup
For detailed installation instructions, please refer to the plugin installation guide.
Installation required in:
Studio (CMS)
Configuration
This plugin shares settings with ol_openedx_course_translations. Ensure the following settings are configured:
TRANSLATIONS_PROVIDERS: {
"default_provider": "mistral",
"openai": {"api_key": "", "default_model": "gpt-5.2"},
"gemini": {"api_key": "", "default_model": "gemini-3-pro-preview"},
"mistral": {"api_key": "", "default_model": "mistral-large-latest"},
}
TRANSLATIONS_GITHUB_TOKEN: <YOUR_GITHUB_TOKEN> # Personal access token with repo write permissions for creating PRs
TRANSLATIONS_REPO_PATH: "" # Local filesystem path where the translations repo will be cloned/checked out
TRANSLATIONS_REPO_URL: "https://github.com/mitodl/mitxonline-translations.git" # URL of the remote translations repository
Generating static content translations
This command synchronizes translation keys from edx-platform and MFE’s, translates empty keys using LLM, and automatically creates a pull request in the translations repository.
What it does:
Syncs translation keys from edx-platform and MFE’s to the translations repository
Extracts empty translation keys that need translation
Translates empty keys using the specified LLM provider and model
Applies translations to JSON and PO files
Commits changes to a new branch
Creates a pull request with translation statistics
Usage:
Go to the CMS shell
Run the management command:
./manage.py cms sync_and_translate_language <LANGUAGE_CODE> [OPTIONS]
Required arguments:
LANGUAGE_CODE: Language code (e.g., el, fr, es_ES)
Optional arguments:
--iso-code: ISO code for JSON files (default: same as language code)
--provider: Translation provider (openai, gemini, mistral). Default is taken from TRANSLATIONS_PROVIDERS['default_provider'] setting
--model: LLM model name. If not specified, uses the default_model for the selected provider from TRANSLATIONS_PROVIDERS. Examples: gpt-5.2, gemini-3-pro-preview, mistral-large-latest
--repo-path: Path to mitxonline-translations repository (can also be set via TRANSLATIONS_REPO_PATH setting or environment variable)
--repo-url: GitHub repository URL (default: https://github.com/mitodl/mitxonline-translations.git, can also be set via TRANSLATIONS_REPO_URL setting or environment variable)
--glossary: Path to glossary directory (optional). Should contain language-specific files (e.g. {iso_code}.txt).
--batch-size: Number of keys to translate per API request (default: 200, recommended: 200-300 for most models)
--mfe: Filter by specific MFE(s). Use edx-platform for backend translations
--dry-run: Run without committing or creating PR
Examples:
# Use default provider (from TRANSLATIONS_PROVIDERS['default_provider']) with its default model ./manage.py cms sync_and_translate_language el # Use OpenAI provider with its default model (gpt-5.2) ./manage.py cms sync_and_translate_language el --provider openai # Use OpenAI provider with a specific model ./manage.py cms sync_and_translate_language el --provider openai --model gpt-5.2 # Use Mistral provider with a specific model and glossary ./manage.py cms sync_and_translate_language el --provider mistral --model mistral-large-latest --glossary /path/to/glossary --batch-size 250
License
The code in this repository is licensed under the BSD 3-Clause license unless otherwise noted.
Please see LICENSE.txt for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ol_openedx_ai_static_translations-0.1.1.tar.gz.
File metadata
- Download URL: ol_openedx_ai_static_translations-0.1.1.tar.gz
- Upload date:
- Size: 44.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
893c7dc5214cc00b477619d2dce78f1341ab53b4f16074d941128685ec725210
|
|
| MD5 |
26a4d12fb2ff51794804480be43b8f5b
|
|
| BLAKE2b-256 |
38c8dd2470560704a9dc3e1d59f8a01b866f0782d342374b19bce34649a6a2bf
|
File details
Details for the file ol_openedx_ai_static_translations-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ol_openedx_ai_static_translations-0.1.1-py3-none-any.whl
- Upload date:
- Size: 48.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddde670eca6dde752d8cabe22fa25b169f94b492a8d2f021d3f64404aca0e3d3
|
|
| MD5 |
9565d9bf92731c860bdb6f5e5c67f7e0
|
|
| BLAKE2b-256 |
fc719677120fe74a6467675b91dc99efbe5d2a5dfa0d998bc848e37e523c7d6c
|