Skip to content
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

Remove capitalization helper #3396

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

codealchemy
Copy link
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
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