Skip to content

feat: add translation support for user-facing strings - #92

Merged
ashwin31 merged 1 commit into
masterfrom
dev
Aug 14, 2026
Merged

feat: add translation support for user-facing strings#92
ashwin31 merged 1 commit into
masterfrom
dev

Conversation

@ashwin31

Copy link
Copy Markdown
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.
Copilot AI lite review requested due to automatic review settings August 14, 2026 02:32
@ashwin31
ashwin31 merged commit 63b0fb5 into master Aug 14, 2026
27 of 28 checks passed
@ashwin31
ashwin31 deleted the dev branch August 14, 2026 02:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Type labels) as translatable via gettext_lazy.
  • Added locale catalogs (django.pot + draft .po files) 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 thread pyproject.toml
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants