Skip to main content

OL Open edX Auto Select Language

An Open edX plugin to auto select the Open edX platform language based on the course language.

Purpose

Auto select the Open edX platform language based on the course language. When enabled, users will see the static site content in the course’s configured language.

Setup

For detailed installation instructions, please refer to the plugin installation guide.

Installation required in:

  • Studio (CMS)

  • LMS

Configuration

  • Add the following configuration values to the config file in Open edX. For any release after Juniper, that config file is /edx/etc/lms.yml and /edx/etc/cms.yml. If you’re using private.py, add these values to lms/envs/private.py and cms/envs/private.py. These should be added to the top level. Ask a fellow developer for these values.

    # Enable auto language selection
    ENABLE_AUTO_LANGUAGE_SELECTION: true
  • For Tutor installations, these values can also be managed through a custom Tutor plugin.

Auto Language Selection

The plugin includes an auto language selection feature that automatically sets the user’s language preference based on the course language. When enabled, users will see the static site content in the course’s configured language.

To enable auto language selection:

  1. Set ENABLE_AUTO_LANGUAGE_SELECTION to true in your settings.

  2. Set SHARED_COOKIE_DOMAIN to your domain (e.g., .local.openedx.io for local tutor setup) to allow cookies to be shared between LMS and CMS.

How it works:

  • LMS: The CourseLanguageCookieMiddleware automatically detects course URLs and sets the language preference based on the course’s configured language.

  • CMS: The CourseLanguageCookieResetMiddleware ensures Studio always uses English for the authoring interface.

  • Admin areas: Admin URLs (/admin, /sysadmin, instructor dashboards) are forced to use English regardless of course language.

MFE Integration

To make auto language selection work with Micro-Frontends (MFEs), you need to use a custom Footer component that handles language detection and switching.

Setup:

  1. Use the Footer component from src/bridge/settings/openedx/mfe/slot_config/Footer.jsx in the ol-infrastructure repository.

  2. Enable auto language selection in each MFE by adding the following to their .env.development file:

    ENABLE_AUTO_LANGUAGE_SELECTION="true"
  3. This custom Footer component: - Detects the current course context in MFEs - Automatically switches the MFE language based on the course’s configured language - Ensures consistent language experience across the platform

  4. Configure your MFE slot overrides to use this custom Footer component instead of the default one.

Note: The custom Footer is required because MFEs run as separate applications and need their own mechanism to detect and respond to course language settings. The environment variable must be set in each MFE’s configuration for the feature to work properly.

License

The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.

Please see LICENSE.txt for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ol_openedx_auto_select_language-0.1.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file ol_openedx_auto_select_language-0.1.2.tar.gz.

File metadata

File hashes

Hashes for ol_openedx_auto_select_language-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f4c79d8321d37e3e55132fa70c7755bc11921d2b315167dba0703f2aa3490947
MD5 f20bf6f4c393bc1e8a61cb526d34cc83
BLAKE2b-256 1bd1578c13c113e633f3d31a1985dccf1bde12dc9599322b16df746c7bc05ab6

See more details on using hashes here.

File details

Details for the file ol_openedx_auto_select_language-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ol_openedx_auto_select_language-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d8f35870976f1b6f0b160d8028d62950c7ea6705d2e695020f16fbeeeb8a7834
MD5 43a483425e9ddb7a4f18e33f982487eb
BLAKE2b-256 551dc007dc3da40d8e5f45922d69a44df644d848eb43d3ca5c6b4426035dcafc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page