Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't mark check boxes in collections when using I18n translations #971

Closed
jonathanrz opened this issue Dec 31, 2013 · 3 comments · Fixed by #972
Closed

Don't mark check boxes in collections when using I18n translations #971

jonathanrz opened this issue Dec 31, 2013 · 3 comments · Fixed by #972

Comments

@jonathanrz
Copy link

Collection: ROLES_FORM = [:supervisor, :treasurer, :secretary]

input: <%= u.input :roles_form, collection: User::ROLES_FORM, as: :check_boxes %>

Translation(pt):
options:
user:
roles_form:
supervisor: "Supervisor"
treasurer: "Tesoureiro"
secretary: "Secretário"

When editing the model, without the translations the check boxes came checked exactly as the options, but after I translated, simple_form isn't checking they anymore. The form submition is working fine.

@jonathanrz
Copy link
Author

I tried a workaround replacing the translation in the simple_form.pt.yml for a label_method: (lambda { |obj| t("#{obj}") }) and worked.

@nashby
Copy link
Collaborator

nashby commented Dec 31, 2013

@jonathanrz there's a bug indeed. Thank you for reporting it!

@jonathanrz
Copy link
Author

Thank you for your quick answer.

nashby added a commit that referenced this issue Jan 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants