-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: Updated translation key usage in change password error scenario #8113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
utkershrajvenshi
wants to merge
1
commit into
makeplane:preview
Choose a base branch
from
utkershrajvenshi:fix/password-complexity-translation-key-usage
base: preview
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Good alignment with success message pattern, but verify translation keys exist.
The change to use
change_passwordspecific error keys is consistent with the success toast pattern (lines 89-90) and is more semantically appropriate than genericpassworderror keys.However, issue #8082 indicates that translation keys were being displayed as raw text (e.g., "auth.common.password.toast.error.title"), suggesting those keys didn't exist in the translation files. This fix assumes the new keys
auth.common.password.toast.change_password.error.titleandauth.common.password.toast.change_password.error.messageare properly defined. Based on the provided context (lines 222-243 ofpackages/i18n/src/store/index.ts), if a key is not found, thet()function returns the key itself as a string, which would reproduce the same issue.Additionally, the PR objective mentions backend error types like
INVALID_NEW_PASSWORDandINVALID_PASSWORDfrom the zxcvbn complexity check. EnsureauthErrorHandler(line 97) properly maps these error codes to user-friendly messages.Run the following script to verify the translation keys exist and check for related password error handling:
🏁 Script executed:
Length of output: 22807
Length of output: 590
🏁 Script executed:
Length of output: 21517
🏁 Script executed:
Length of output: 3967
🏁 Script executed:
Length of output: 4572
🏁 Script executed:
Length of output: 848
Translation keys must be added to all locale files; fallback still risks displaying raw key strings.
The change aligns error fallback keys with the success pattern (
change_password.error.*matcheschange_password.success.*), which is good for consistency. However, critical issues remain:Missing translation definitions: The new fallback keys
auth.common.password.toast.change_password.error.titleandmessagedon't exist in any translation files. ForINVALID_NEW_PASSWORDandINVALID_PASSWORDspecifically, authErrorHandler provides hardcoded English messages (lines 136-138 and 293-295 inapps/web/helpers/authentication.helper.tsx), so those cases work. But any other password error codes not in thebannerAlertErrorCodeslist will return undefined, triggering the fallback to non-existent translation keys. Thet()function will then return the key string itself, reproducing issue [bug]: Password complexity errors not displayed #8082.Incomplete error code coverage:
authErrorHandleronly handles error codes inbannerAlertErrorCodes(which includesINVALID_NEW_PASSWORDandINVALID_PASSWORD). Verify all possible backend password error responses are covered or have translation keys defined.Required actions:
auth.common.password.toast.change_password.error.titleandauth.common.password.toast.change_password.error.messagekeys to all locale files inpackages/i18n/src/locales/*/authErrorHandlercovers all password complexity error codes from the backend or ensure translation fallbacks exist🤖 Prompt for AI Agents