A fast Rust alternative to Django's makemessages command
Project description
django-makemessages-rs
A fast Rust alternative to Django's makemessages command. Produces byte-identical .po file output compared to django-extended-makemessages.
Tested against a ~2000 file Django project with ~3000 translatable strings across 5 locales:
| Tool | Time |
|---|---|
django-extended-makemessages |
~21s |
django-makemessages-rs |
~0.3s |
Install
pip install django-makemessages-rs
Platform wheels are available for macOS (arm64, x86_64) and Linux (x86_64, aarch64).
Usage
django-makemessages-rs \
-l en -l zh_Hant -l zh_Hans -l ko -l ja \
--ignore .venv --ignore node_modules \
--no-location --no-flags --sort-output \
--no-fuzzy-matching --keep-header \
--locale-dir locale
CI check mode
Use --check to verify translation files are in sync with source code. Exits with code 1 if any .po file would change:
django-makemessages-rs \
-l en -l zh_Hant \
--ignore .venv --ignore node_modules \
--no-location --no-flags --sort-output \
--no-fuzzy-matching --keep-header \
--locale-dir locale \
--check
Options
-l, --locale <LOCALES> Locales to generate (required, repeatable)
-i, --ignore <PATTERNS> Patterns to ignore (directories/files)
-d, --domain <DOMAIN> Domain name [default: django]
-e, --extension <EXTS> File extensions to examine [default: html txt py]
--root <PATH> Root directory to scan [default: .]
--locale-dir <PATH> Locale directory [default: locale]
--no-location Don't write #: filename:line lines
--no-flags Don't write #, flags lines
--sort-output Generate sorted output
--no-fuzzy-matching Do not use fuzzy matching
--keep-header Keep the existing .po file header
--no-obsolete Remove obsolete message strings
--no-wrap Don't break long message lines
--check Exit with error if .po files would change (dry-run)
--timing Show timing information
How it works
- Walks the project tree using ignore (same engine as ripgrep)
- Extracts translatable strings from
.pyand.html/.txttemplates in parallel using rayon - Merges extracted strings with existing
.pofiles, preserving translations - Writes updated
.pofiles
The extractor handles:
- Python
gettext(),ngettext(),pgettext(),npgettext()and the_()alias - Django template tags:
{% trans %},{% translate %},{% blocktrans %},{% blocktranslate %} {% blocktrans trimmed %}whitespace collapsing{% blocktrans %}...{% plural %}...{% endblocktrans %}plural forms- Python implicit string concatenation (
_("foo" "bar")) - Template variable substitution (
{{ var }}to%(var)s) - Literal
%escaping to%%
No Django settings or DJANGO_SETTINGS_MODULE required — runs as a standalone CLI.
Pre-commit / Git hooks integration
Add to your pyproject.toml dev dependencies:
"django-makemessages-rs"
Then in your pre-commit script:
uv run django-makemessages-rs \
-l en -l zh_Hant \
--ignore .venv --ignore node_modules \
--no-location --no-flags --sort-output \
--no-fuzzy-matching --keep-header \
--locale-dir locale
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 django_makemessages_rs-0.3.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: django_makemessages_rs-0.3.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65c1ea04f2950c207caf4a366c9b923d2f791814ca49f946c6fd1bed98dac2cc
|
|
| MD5 |
61685630da58c0f27fa6f458bce7795f
|
|
| BLAKE2b-256 |
30d34ab8a5842462745766d1738eb6534bbba685d5391c614f5cb855d38194fe
|
Provenance
The following attestation bundles were made for django_makemessages_rs-0.3.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on zxzinn/django-makemessages-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_makemessages_rs-0.3.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
65c1ea04f2950c207caf4a366c9b923d2f791814ca49f946c6fd1bed98dac2cc - Sigstore transparency entry: 1732491161
- Sigstore integration time:
-
Permalink:
zxzinn/django-makemessages-rs@0e9916437dfe2a4d577fa6491bda4a53d2af0f4e -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/zxzinn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e9916437dfe2a4d577fa6491bda4a53d2af0f4e -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_makemessages_rs-0.3.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: django_makemessages_rs-0.3.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29ccd04aa72709f2ce1fc2e81b067a22d8e0c51f6a5e615f8c0751632f22970a
|
|
| MD5 |
22133ef4ee98d5e840923ed5a9a96ecf
|
|
| BLAKE2b-256 |
c36c8ef3de5e8707b736f4c9cfa8d48fbb9fa091b529368bce8f4052e6921348
|
Provenance
The following attestation bundles were made for django_makemessages_rs-0.3.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on zxzinn/django-makemessages-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_makemessages_rs-0.3.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
29ccd04aa72709f2ce1fc2e81b067a22d8e0c51f6a5e615f8c0751632f22970a - Sigstore transparency entry: 1732491248
- Sigstore integration time:
-
Permalink:
zxzinn/django-makemessages-rs@0e9916437dfe2a4d577fa6491bda4a53d2af0f4e -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/zxzinn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e9916437dfe2a4d577fa6491bda4a53d2af0f4e -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_makemessages_rs-0.3.2-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: django_makemessages_rs-0.3.2-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29be7062aff06a39b76d30332dc3ff133f57fda7ef8210ba171ea233847fa4aa
|
|
| MD5 |
37ea1623e9187ddbeb3a4b0ca6a10f27
|
|
| BLAKE2b-256 |
f376a7420b4f24ddf9a62c861f388fb6ee8c74c0bb62fd4714891fbb9bffea9f
|
Provenance
The following attestation bundles were made for django_makemessages_rs-0.3.2-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on zxzinn/django-makemessages-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_makemessages_rs-0.3.2-py3-none-macosx_11_0_arm64.whl -
Subject digest:
29be7062aff06a39b76d30332dc3ff133f57fda7ef8210ba171ea233847fa4aa - Sigstore transparency entry: 1732491205
- Sigstore integration time:
-
Permalink:
zxzinn/django-makemessages-rs@0e9916437dfe2a4d577fa6491bda4a53d2af0f4e -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/zxzinn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e9916437dfe2a4d577fa6491bda4a53d2af0f4e -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_makemessages_rs-0.3.2-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: django_makemessages_rs-0.3.2-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d06183a8b0f5d5fd9428a59828b922d0ea44d1f9111eac7e131608ad30cf678c
|
|
| MD5 |
69ea2cbda4b6d6fe1397ad86c0084ce6
|
|
| BLAKE2b-256 |
25e6a863bbefed90f3d0aacfa218a085b807eab3325ab3de0a422f90b5261878
|
Provenance
The following attestation bundles were made for django_makemessages_rs-0.3.2-py3-none-macosx_10_12_x86_64.whl:
Publisher:
release.yml on zxzinn/django-makemessages-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_makemessages_rs-0.3.2-py3-none-macosx_10_12_x86_64.whl -
Subject digest:
d06183a8b0f5d5fd9428a59828b922d0ea44d1f9111eac7e131608ad30cf678c - Sigstore transparency entry: 1732491289
- Sigstore integration time:
-
Permalink:
zxzinn/django-makemessages-rs@0e9916437dfe2a4d577fa6491bda4a53d2af0f4e -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/zxzinn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e9916437dfe2a4d577fa6491bda4a53d2af0f4e -
Trigger Event:
push
-
Statement type: