A collection of XBlocks for the Open edX platform that preserve their original package paths for drop-in replacement
Project description
xblocks-extra
A collection of XBlocks for the Open edX platform.
Purpose
This repository serves as the consolidated home for several previously standalone XBlock packages, brought together to streamline maintenance and simplify dependency management. These XBlocks are not installed by default in the Open edX platform but can be added as needed. Each XBlock preserves its original package path to serve as a drop-in replacement when migrating from the standalone packages.
The following XBlocks have been migrated here from their respective repositories:
- AudioXBlock migrated from
- FeedbackXBlock migrated from
- xblock-image-modal migrated from
- xblock-qualtrics-survey migrated from
- xblock-sql-grader migrated from
- xblock-submit-and-compare migrated from
Migrating from Standalone Packages
If you currently have any of the standalone packages listed above
installed, you should migrate to xblocks-extra.
See the Migration Guide for the instructions.
Installation
pip install xblocks-extra
Development
Prerequisites
- Python 3.12+
- Django 4.2 or 5.2
Setup
# Clone the repository
git clone https://github.com/openedx/xblocks-extra.git
cd xblocks-extra
# Install in development mode
pip install -e ".[dev]"
Running Tests
make test
Linting
make lint
make format # Auto-fix formatting issues
Translating
Internationalization (i18n) is when a program is made aware of multiple languages. Localization (l10n) is adapting a program to local language and cultural habits.
This project follows OEP-58 for centralized
translation management via the openedx-translations repository.
The daily extraction workflow in openedx-translations clones this repo, runs make extract_translations, and pushes
the combined source .po file to Transifex for the translation community to translate.
Prerequisites
edx-i18n-tools(included in[dev]dependencies)gettextsystem package (brew install gettexton macOS,sudo apt install gettexton Ubuntu)
Translation Workflow
- Mark translatable strings in Python and JavaScript using
gettext/ugettext. - Extract source strings:
make extract_translations - Compile translations:
make compile_translations
Make Targets
| Target | Description |
|---|---|
extract_translations |
Extract translatable strings from all XBlocks into per-xblock text.po files, then merge into a combined conf/locale/en/LC_MESSAGES/django.po for OEP-58 |
compile_translations |
Compile .po files into .mo message files for each XBlock |
dummy_translations |
Generate dummy (Esperanto) .po files for testing |
build_dummy_translations |
Extract, generate dummy, and compile translations |
validate_translations |
Build dummy translations and detect changed source files |
detect_changed_source_translations |
Check if source .po files are up-to-date |
pull_translations |
Pull translations from Transifex |
push_translations |
Extract and push source translations to Transifex |
install_transifex_client |
Install the Transifex CLI client |
How It Works
Each XBlock in src/ has its own conf/locale/ directory with a config.yaml and .tx/config.
During extraction:
i18n_tool extractruns in each XBlock directory, producingdjango.po(and optionallydjangojs.po).- If
djangojs.poexists, it is merged intodjango.pousingmsgcat. - The merged file is renamed to
text.po. - All per-xblock
text.pofiles are combined viamsgcat --use-firstinto a singleconf/locale/en/LC_MESSAGES/django.poat the repository root for the openedx-translations pipeline.
Verifying Translations
# Dry-run extraction
make extract_translations
# Check the combined output
cat conf/locale/en/LC_MESSAGES/django.po
# Build and test with dummy translations
make build_dummy_translations
# Verify Transifex config (requires tx CLI)
cd src/<xblock_name> && tx status
Note: The
.gitignoreignores*.poand*.mofiles. This is expected — translation source files are managed in the openedx-translations repository, not committed here.
Contributing
Contributions are welcome! Please read our contributing guidelines before submitting a pull request.
License
This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.
Project details
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 xblocks_extra-1.5.1.tar.gz.
File metadata
- Download URL: xblocks_extra-1.5.1.tar.gz
- Upload date:
- Size: 719.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d979d747add2e7831f9082d86fd74fe09aa876c8136f6fbdbacd96b40c597432
|
|
| MD5 |
9fcad5239609f9dc60c497d1c23dc8cd
|
|
| BLAKE2b-256 |
014c8411392f32401987f0ed954882200bd012abb0615cf88002a687747817d2
|
File details
Details for the file xblocks_extra-1.5.1-py3-none-any.whl.
File metadata
- Download URL: xblocks_extra-1.5.1-py3-none-any.whl
- Upload date:
- Size: 714.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5330b3a35a32fb4a7a3d498f05e3b737f57d5f7cdbf6e5fcb4f716a73578ee9d
|
|
| MD5 |
44a31edaeae1dc061f34f2eda339b004
|
|
| BLAKE2b-256 |
99d6dfa5f1d4941a0f8ee56d450db89c753be43d2e6df21834ee397c4dd45378
|