Skip to content

Remove capitalization helper#3396

Merged
mshibuya merged 1 commit into
railsadminteam:masterfrom
codealchemy:patch/capitalization
Sep 23, 2021
Merged

Remove capitalization helper#3396
mshibuya merged 1 commit into
railsadminteam:masterfrom
codealchemy:patch/capitalization

Conversation

@codealchemy

Copy link
Copy Markdown
Contributor

Added in 7f10337, #capitalize_first_letter includes assumptions about letter order / casing for all strings, and may apply the wrong capitalization rules for some use cases / contexts (case-sensitive strings, different languages - related #2354, StackOverflow Q/A).

Most of the use cases here are using translations, in which case the letter casing can / should be applied in the translations themselves. Other cases, such as rendering the value of object_label_method, will show the value as-is without transformation (as seen in the test updates). Cursory checks in the Dummy app show no changes to the UI.

My use case here involves the latter, where the object's label (case sensitive) in the breadcrumb navigation is capitalized and has led to some confusion.

The CSS property text-transform offers an alternative to achieve the same outcome, giving users of this library a way of applying letter-case logic in theme overrides.

Added in railsadminteam@7f10337, `#capitalize_first_letter` includes assumptions about letter order / casing for all strings, and may apply the wrong capitalization rules for some use cases (case-sensitive strings, different languages).

Most of the use cases here are using translations, in which case the letter casing can / should be applied in the translations themselves. Other cases, such as rendering the value of `object_label_method`, will show the value as-is without transformation (as seen in the test updates). Cursory checks in the Dummy app show no changes to the UI.

The [CSS property `text-transform`](https://www.w3schools.com/cssref/pr_text_text-transform.asp) offers an alternative to achieve the same outcome, giving users of this library a way of applying letter-case logic in [theme overrides](https://github.com/sferik/rails_admin/wiki/Theming-and-customization).
@mshibuya mshibuya merged commit 6c802dc into railsadminteam:master Sep 23, 2021
@mshibuya

Copy link
Copy Markdown
Member

Makes sense, thanks!

@codealchemy codealchemy deleted the patch/capitalization branch September 23, 2021 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants