Fix auth key casing for multi-word translated labels#5836
Open
wwenrr wants to merge 2 commits intoheartcombo:mainfrom
Open
Fix auth key casing for multi-word translated labels#5836wwenrr wants to merge 2 commits intoheartcombo:mainfrom
wwenrr wants to merge 2 commits intoheartcombo:mainfrom
Conversation
Member
carlosantoniodasilva
left a comment
There was a problem hiding this comment.
Thanks! This may fix the immediate problem (and I'll probably apply it soon), but I'm afraid we're going to be playing whack-a-mole with this translation thing 😅
Anyway, let's give it another try before I decide to revert it all back and try a different approach.
Note: there are failures for mongoid, it needs to have translations stored as well.
Author
|
Root cause: the new capitalization test only set |
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.
Summary
Fixes the capitalization regression reported in #5835 when
human_attribute_namereturns a multi-word string (e.g."Email Address").Previously this produced:
Invalid email Address or password.With this change it produces:
Invalid email address or password.What changed
Devise::FailureApp#i18n_message, when buildingauthentication_keys:downcase_firstfallback)human_key.include?(" ") ? human_key.downcase : ...)This preserves behavior for values like
"E-Mail"while fixing awkward capitalization for values like"Email Address".Tests
Added coverage in
test/failure_app_test.rb:preserves translation capitalization after auth key replacementVerification run (manual)
I ran the failure app test file locally in a clean Docker Ruby 3.4 environment:
Result: 45 runs, 91 assertions, 0 failures, 0 errors, 0 skips.