stages/email: fix ungrammatical expiry time in password reset templates#22758
Open
lwillek wants to merge 1 commit into
Open
stages/email: fix ungrammatical expiry time in password reset templates#22758lwillek wants to merge 1 commit into
lwillek wants to merge 1 commit into
Conversation
Django's naturaltime filter outputs a prepositional phrase like "in 23 hours". When interpolated into the existing sentence "The above link is valid for ...", the prepositions clash, producing broken grammar in English and all localized languages. Replace naturaltime with timeuntil in both the HTML and plain-text password reset templates so the interpolated value is a bare duration string. Fixes goauthentik#22757
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Details
Django's
naturaltimefilter outputs a prepositional phrase (e.g., "in 23 hours"). When embedded in the existing sentence "The above link is valid for {{ expires }}", the prepositions clash, producing ungrammatical output in English ("valid for in 23 hours") as well as in translations (e.g., German: "gültig für in 23 Stunden").This PR replaces
naturaltimewithtimeuntilin the default password reset email templates.timeuntilreturns a bare duration string (e.g., "23 hours"), which fits correctly into the existing sentence structure across all locales.Changes
authentik/stages/email/templates/email/password_reset.txtauthentik/stages/email/templates/email/password_reset.htmlRelated issues
This is my first contribution to authentik — please let me know if anything needs adjustment.