Skip to content

Keep original casing of multi-word authentication keys in flash messages - #5869

Open
azmi2409 wants to merge 1 commit into
heartcombo:mainfrom
azmi2409:fix/multi-word-auth-keys-casing
Open

azmi2409 wants to merge 1 commit into
heartcombo:mainfrom
azmi2409:fix/multi-word-auth-keys-casing

Conversation

@azmi2409

@azmi2409 azmi2409 commented Oct 8, 2026

Copy link
Copy Markdown

Fixes #5864.

Since #5822, human_attribute_name values are downcased on the first letter when interpolated into the failure flash message. For multi-word title-cased names like "Company Code" this produces "company Code", which reads like a typo:

Before: Invalid login ID and company Code or password.
After: Invalid Login ID and Company Code or password.

This change only applies downcase_first to single-word names ("Email" -> "email", keeping #4834's grammar fix and #5822's German "E-Mail" behavior), while multi-word names keep their original casing.

A regression test was added to test/failure_app_test.rb covering a multi-word translated attribute name; the existing single-word expectations ("Invalid email or password.") are unchanged.

…n keys in flash messages

Since heartcombo#5822, human_attribute_name values are downcased on the first letter
for the failure flash message. For multi-word title-cased names like
"Company Code" this produces "company Code", which reads like a typo.

Only apply downcase_first to single-word names ("Email" -> "email"),
preserving the original casing of multi-word names ("Company Code").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Title-cased multi-word attribute names produce mixed-case flash messages since 5.0 (e.g. "company Code")

1 participant