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

titleize the model name on default submit buttons #22764

Merged
merged 1 commit into from Jan 4, 2016
Merged

titleize the model name on default submit buttons #22764

merged 1 commit into from Jan 4, 2016

Conversation

stevenspiel
Copy link
Contributor

pull request implementing lighthouse's diff to titleize the model names on submit buttons. So, for a model TicketType, the submit button would read "Create Ticket Type", rather than "Create Ticket type". References issue 791

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rafaelfranca
Copy link
Member

See #791 (comment)

@kaulanishasj
Copy link

Has this issue been resolved?

@surreymagpie
Copy link

I think it's the wrong approach to titleise the model. The text on the button is an imperative, an instruction to the user. As such it's a very short, but complete, sentence and only the first word should be capitalised: i.e. "Create ticket type". So downcasing would be most appropriate.

@stevenspiel
Copy link
Contributor Author

I'm agree with @surreymagpie. I just don't like the inconsistency of "Create Ticket type". I've made the changes needed so it reads "Create ticket type"

@rafaelfranca
Copy link
Member

Seems good. Could you squash your commits?

rafaelfranca added a commit that referenced this pull request Jan 4, 2016
…fault_submit_button_value

titleize the model name on default submit buttons
@rafaelfranca rafaelfranca merged commit 4158974 into rails:master Jan 4, 2016
@halo
Copy link

halo commented Mar 3, 2016

I might definitely be missing something, but how should one change the button value to "User begone" merely via the I18n file? Doesn't the .downcase now override whatever .human picks up from my i18n yml?

Many languages need the model name (being a noun) to be capitalized. Additionally, the model name may come first and thus should be capitalized. It seemed reasonable to have i18n handle that scenario instead of having to pass in something to f.submit the view.

I'm just trying the rails 5 beta and now all my features fail because the buttons are all downcased even though I have specific capitalized model names defined via i18n.

EDIT: I elaborated a little more with an example on the issue.

@rafaelfranca
Copy link
Member

Reverted in ddf4c95

rafaelfranca added a commit that referenced this pull request Mar 5, 2016
…e_for_default_submit_button_value"

This reverts commit 4158974, reversing
changes made to 3d590ad.

Reason: This break i18n in some languages. See
#791 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants