Conversation
ashwin31
commented
Aug 14, 2026
Member
- Translated factor type labels in Authenticator model using gettext_lazy.
- Introduced i18n extraction support in tests to ensure translatable strings are accounted for.
- Added tests to verify translation catalogs and ensure no unreviewed translations are shipped.
- Updated views to use translated error messages for passkey failures and generic errors.
- Documented translation process and guidelines for adding new languages in translations.md.
- Updated project metadata to reflect support for Django 6.1 and Python 3.12+.
- Bumped version to 4.3.0 and adjusted development status to Production/Stable.
- Translated factor type labels in Authenticator model using gettext_lazy. - Introduced i18n extraction support in tests to ensure translatable strings are accounted for. - Added tests to verify translation catalogs and ensure no unreviewed translations are shipped. - Updated views to use translated error messages for passkey failures and generic errors. - Documented translation process and guidelines for adding new languages in translations.md. - Updated project metadata to reflect support for Django 6.1 and Python 3.12+. - Bumped version to 4.3.0 and adjusted development status to Production/Stable.
There was a problem hiding this comment.
Pull request overview
This PR introduces end-to-end i18n support for django-mfa’s user-facing strings, adding translation catalogs plus automated guards to keep catalogs in sync and prevent unreviewed machine translations from going live. It also updates documentation, CI, and project metadata for the new release and Django 6.1 support.
Changes:
- Marked user-facing Python strings (view errors, adapter labels,
Authenticator.Typelabels) as translatable viagettext_lazy. - Added locale catalogs (
django.pot+ draft.pofiles) and test utilities/tests to verify extraction parity, placeholder safety, and packaging inclusion. - Updated docs/CI/release metadata for translations guidance, Django 6.1 matrix coverage, and version bump to 4.3.0.
Reviewed changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Bumps locked project version to 4.3.0. |
| README.md | Documents Django 6.1 support and clarifies CI matrix exclusions. |
| pyproject.toml | Version bump to 4.3.0; classifiers updated to Production/Stable and Django 6.1. |
| docs/upgrading.md | Updates upgrade notes to include Django 6.1 support constraints. |
| docs/translations.md | New documentation describing translation model, review workflow, and safety rules. |
| docs/installation_setup.md | Adds Django 6.1 to supported versions and notes Python 3.12+ requirement for Django 6.1. |
| docs/index.md | Adds translations page to docs navigation. |
| docs/contributing.md | Updates CI grid description to include Django 6.1 and excluded combos. |
| django_mfa/views/verify.py | Makes user-facing errors translatable; translates passkey failure JSON error message. |
| django_mfa/tests/test_packaging.py | Ensures translation catalogs are included in the built wheel. |
| django_mfa/tests/test_i18n.py | New tests guarding catalog freshness, fuzzy-only drafts, placeholder integrity, and lazy-string behavior. |
| django_mfa/tests/support/i18n.py | New pure-Python extractor and PO parser used by i18n tests (no gettext dependency). |
| django_mfa/models.py | Translates Authenticator.Type choice labels with gettext_lazy. |
| django_mfa/locale/django.pot | Adds translation template catalog. |
| django_mfa/locale/de/LC_MESSAGES/django.po | Adds draft German catalog (all entries fuzzy). |
| django_mfa/locale/es/LC_MESSAGES/django.po | Adds draft Spanish catalog (all entries fuzzy). |
| django_mfa/locale/fr/LC_MESSAGES/django.po | Adds draft French catalog (all entries fuzzy). |
| django_mfa/locale/pt_BR/LC_MESSAGES/django.po | Adds draft Brazilian Portuguese catalog (all entries fuzzy). |
| django_mfa/locale/ja/LC_MESSAGES/django.po | Adds draft Japanese catalog (all entries fuzzy). |
| django_mfa/locale/zh_Hans/LC_MESSAGES/django.po | Adds draft Simplified Chinese catalog (all entries fuzzy). |
| django_mfa/adapters/webauthn.py | Translates WebAuthnAdapter.verbose_name. |
| django_mfa/adapters/totp.py | Translates TOTPAdapter.verbose_name. |
| django_mfa/adapters/recovery_codes.py | Translates RecoveryCodesAdapter.verbose_name. |
| django_mfa/adapters/email.py | Translates EmailAdapter.verbose_name. |
| CHANGELOG.md | Adds 4.3.0 release notes covering translations and Django 6.1 support. |
| .gitignore | Ensures package catalogs aren’t ignored (so they ship in wheels); prepares for future .mo shipping. |
| .github/workflows/publish.yml | Updates release smoke matrix newest corner to Python 3.13 + Django 6.1. |
| .github/workflows/ci.yml | Expands CI matrix to include Django 6.1 with Python 3.12/3.13 and excludes unsupported combos. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+7
to
10
| version = "4.3.0" | ||
| description = "Second-factor authentication for Django: authenticator apps (TOTP), security keys and passkeys (WebAuthn), and recovery codes." | ||
| readme = "README.md" | ||
| requires-python = ">=3.10" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.