Activeadmin: I18n for submit button

Created on 7 Aug 2011  路  4Comments  路  Source: activeadmin/activeadmin

When I use i18n to translate an application,the submit button can not display my language.How can I solve it? Thanks!

Most helpful comment

Hey guys, I've just found a better solution, and i would share.
In fact, is just add this piece of code on you locale file, because the submit button is internationalized on formtastic.

en:
  formtastic:
    :yes: 'Yes'
    :no: 'No'
    :create: 'Create %{model}'
    :update: 'Update %{model}'
    :submit: 'Submit %{model}'
    :required: 'required'

Cheers,
Rodrigo

All 4 comments

Not a perfect solution, but you could use custom forms:

...
form do |f|
  f.inputs
  f.buttons do
    f.submit I18n.t('submit')
  end
end
...

Thanks! That's work.

Hey guys, I've just found a better solution, and i would share.
In fact, is just add this piece of code on you locale file, because the submit button is internationalized on formtastic.

en:
  formtastic:
    :yes: 'Yes'
    :no: 'No'
    :create: 'Create %{model}'
    :update: 'Update %{model}'
    :submit: 'Submit %{model}'
    :required: 'required'

Cheers,
Rodrigo

I just ran into this problem myself, found out the solution by myself en then thought I would share it here ... Only to discover it had been figured out for a year now !

Maybe now would be the time to add the formtastic locale file into ActiveAdmin so future users won't have to go down this road again ? Or maybe document it a bit better ?

What do you think ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

duksis picture duksis  路  3Comments

dheerajk3 picture dheerajk3  路  3Comments

afriqs picture afriqs  路  3Comments

Awatatah picture Awatatah  路  3Comments

gcerquant picture gcerquant  路  3Comments