Skip to main content

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.

Version Compatibility

For this plugin’s compatibility with Open edX, see the Open edX Release Compatibility table.

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:

  1. Syncs translation keys from edx-platform and MFE’s to the translations repository

  2. Extracts empty translation keys that need translation

  3. Translates empty keys using the specified LLM provider and model

  4. Applies translations to JSON and PO files

  5. Commits changes to a new branch

  6. Creates a pull request with translation statistics

Usage:

  1. Go to the CMS shell

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

Metadata

Release files for ol-openedx-ai-static-translations 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ol-openedx-ai-static-translations 0.2.1
File Size Uploaded Provenance Actions
ol_openedx_ai_static_translations-0.2.1.tar.gz 44.7 kB Without provenance Details for ol_openedx_ai_static_translations-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ol-openedx-ai-static-translations 0.2.1
File Interpreter ABI Platform Actions
ol_openedx_ai_static_translations-0.2.1-py3-none-any.whl Python 3 none any Details for ol_openedx_ai_static_translations-0.2.1-py3-none-any.whl

Total release size: 93.3 kB

Release files / ol_openedx_ai_static_translations-0.2.1.tar.gz

Download URL ol_openedx_ai_static_translations-0.2.1.tar.gz
Size 44.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a29e4adcc1216bba0605950cbc19e019408a57310001e88113cbedc6c75b9964
BLAKE2b-256 checksum
How to use checksums
77df6c3e604e4818fa917e0f3c71ad2781f8d655bf2abe0a62785215c6b7e560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / ol_openedx_ai_static_translations-0.2.1-py3-none-any.whl

Download URL ol_openedx_ai_static_translations-0.2.1-py3-none-any.whl
Size 48.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb36503187ccaccfc5b94ba82ba475af7af91969218ceb3361158829db81c5ad
BLAKE2b-256 checksum
How to use checksums
5f4d5329d14d3383eb74d144bfecc72b4ec948cdbef233ed3455d4a0da0abc39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for ol-openedx-ai-static-translations 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page