Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Formtastic::I18n module #122

Closed
grimen opened this Issue · 4 comments

2 participants

@grimen

Justin, when now when you doing the big refactor of the lib I would suggest to introduce a new module: ::Formtastic::I18n. There's some redundant code that could be DRYed up with ::Formtastic::I18n#translate() method, and storing default string values in constants within the same module. I noticed Authlogic (and other popular plugins) follow this pattern as well.

Before:

::I18n.t(:yes, :default => 'Yes', :scope => [:formtastic])

After:

I18n.t(:yes)

Stating the obvious: Without "::" it'll be same as ::Formtastic::I18n.t(:yes) if called within the Formtastic namespace.

@grimen

Of course, I could do this (not a big change) but will probably wait for your refactoring.

@justinfrench

My refactoring got shelved again, go for it :)

@grimen

Refactored I18n stuff to Formtastic::I18n with specs. Cleaner. Closed by 382c552.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.