Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Formtastic::I18n module #122

grimen opened this Issue Nov 19, 2009 · 4 comments


None yet
2 participants

grimen commented Nov 19, 2009

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.


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



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


grimen commented Nov 19, 2009

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


justinfrench commented Nov 21, 2009

My refactoring got shelved again, go for it :)


grimen commented Nov 22, 2009

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