An Open edX plugin to auto-select the language based on course language settings.
Project description
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: trueFor 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:
Set ENABLE_AUTO_LANGUAGE_SELECTION to true in your settings.
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:
Use the Footer component from src/bridge/settings/openedx/mfe/slot_config/Footer.jsx in the ol-infrastructure repository.
Enable auto language selection in each MFE by adding the following to their .env.development file:
ENABLE_AUTO_LANGUAGE_SELECTION="true"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
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.
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_auto_select_language-0.1.0.tar.gz.
File metadata
- Download URL: ol_openedx_auto_select_language-0.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff2b5901c13d00d1e39d696e63d47cf03717888b218f37253eecad04da087263
|
|
| MD5 |
27fcdc25feb0e85fa8136f12107aa62f
|
|
| BLAKE2b-256 |
4770cddaad986acec41c1de5e2eb7093f3c11ceb03c4d6f1619d2dd7f1d776c5
|
File details
Details for the file ol_openedx_auto_select_language-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ol_openedx_auto_select_language-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c30bbf2c4d5efc592f3d8a3b8fb4b47be0e599760d5ec163999d0d6bcf13ca7e
|
|
| MD5 |
f4ff626464b05a5445110243de65bc83
|
|
| BLAKE2b-256 |
37bc07d780ca280bde189db5ec42a190529e0b7992b0bcfae5ec1e1ad039c8f0
|