Localize registration/reset email to the recipient's language - #3657
Merged
OzzieIsaacs merged 1 commit intoAug 1, 2026
Merged
Conversation
The 'Get Started with Calibre-Web' email had a hardcoded English body and a subject translated in the triggering user's locale (typically the admin), so a French user received it in English. Wrap subject+body composition in flask_babel.force_locale(recipient_locale), make the body translatable, and thread the recipient locale from reset_password and /register. French translations added; other languages fall back to English until translated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
benoitperrin
force-pushed
the
fix/registration-email-locale
branch
from
June 17, 2026 17:49
3892d78 to
7c16cfa
Compare
benoitperrin
marked this pull request as ready for review
June 17, 2026 18: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.
Problem
send_registration_mailbuilds the welcome / password-reset email with a hardcoded English body (never passed through_()), and its subject is translated using the triggering user's locale (usually an admin). A user whose account language is e.g. French therefore receives this email in English.Fix
flask_babel.force_locale(recipient_locale), so the email follows the recipient account's language.reset_password,/register); the self-service and admin reset paths need no change.messages.potand the French catalog. Other languages fall back to the English msgid until translated.Scope is intentionally limited to the registration/reset email: the SMTP test email targets the admin themselves, and send-to-eReader has no recipient locale (the sender's locale, already used, is the right one there).
Testing
Verified that a reset/welcome triggered for a French-locale account renders subject and body in French ("Bien démarrer avec Calibre-Web" + translated body), while an English-locale account is unchanged.
I kept the
.potchange minimal (manual append) to avoid a noisy full regeneration — happy to regenerate it the canonical way if you prefer.