save_or_create_button_text is changing the I18n translation in production #47

Closed
carlosantoniodasilva opened this Issue Sep 9, 2009 · 3 comments

Comments

Projects
None yet
3 participants

Hello guys,

When using formtastic in development, commit button text is being created ok, ie 'Create Product' or 'Save Product'... however, while testing it in production mode, I'm having an weird issue: commit labels are updating the translation, resulting in 'Save Product Product Product'... as many times I open the form for editing.

As translations aren't reloaded in production, changing the following code:

  I18n.t(prefix.downcase, :default => prefix, :scope => [:formtastic]) << ' ' << object_name

to this:

  button_text = I18n.t(prefix.downcase, :default => prefix, :scope => [:formtastic]).dup
  button_text << ' ' << object_name

worked nicely here.
Thanks, Carlos.

Contributor

josevalim commented Sep 9, 2009

Fixed! I will ask Justin to release a new gem!

Owner

justinfrench commented Sep 9, 2009

Done! 0.2.4 just got pushed to github, should be available soon!

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment