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

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.0
File Size Uploaded Provenance Actions
ol_openedx_ai_static_translations-0.2.0.tar.gz 44.2 kB Without provenance Details for ol_openedx_ai_static_translations-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 92.8 kB

Release files / ol_openedx_ai_static_translations-0.2.0.tar.gz

Download URL ol_openedx_ai_static_translations-0.2.0.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9e025d88e1158091d13d109ddc75e0822d0394dc9531a30ef6b250f184f6b791
BLAKE2b-256 checksum
How to use checksums
8a8f8d59cd46b0793f48693458ae8ea320304f2cfeb7f9331bf49b8e64c311ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

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

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

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

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