Form helper changes to automatically translate the disable-with option

Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Form helper changes to automatically translate the disable-with option

Mark Edmondson
In much the same way the submit button is automatically translated to "Create %{model}" and "Update %{model}", (where model is translated through the traditional activerecord model name translation keys) it should be possible to translate the disable-with value for specific models, with an obvious default.

Currently, the default disable-with value uses that from the button so a user sees no text change other than the button becoming disabled.

I'm proposing a change to set default translations as:

en:
  helpers
:
    disable_with
:
      create
: Creating %{model}
      update
: Updating %{model}


which can be overwritten with:


en
:
  helpers
:
    disable_with
:
      blog
/post:
        create
: Creating your %{model}


And the FormHelper#submit method changing to support this.

Thoughts? Opinions?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/63580223-41c4-4fe9-9136-4cff875cdf54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.