Integrating i18n with Simple Form gem
Simple_form accommodates i18n well, and their docs are pretty thorough on i18n, but they don't specifically address the solution for the "priority:" option for a collection field. I've tried applying the idea/structure they use for "hints:" and "prompts:" but it isn't working. I must be missing something.
Excerpt from yml:
simple_form:
hints:
location:
website: You must enter the leading http://
short_desc: General information, not a review.
prompts:
location:
state: Select the state
# Tried this, doesn't seem to work
priority:
location:
country: United States of America
Here's a snippet from the form:
# Works for prompt per spec.
<%= f.input :state, collection: us_states, prompt: :translate %>
# Tried this. Nope. Missing translation error.
<%= f.input :country, priority: [ t('.country') ] %>
# Tried this. Nope. Missing translation error.
<%= f.input :country, priority: :translate %>
I could make this work by creating a custom t. string for the "priority:" setting in a default yml, but it would be more logical and maintainable if this setting's string had a consistent implementation with simple_form's the "hints:" and "prompts:" There must be a simple_form solution. Thanks in advance.
Added notes (Edit) For anyone else who has this problem, I wanted to add notes here. Translating the path-to-str verbatim at the console will work. But, the Simple From gem uses context dependent translations based on the yml formatted in a way their gem interprets. Their specification is clear on this and this works for the 2 form properties "hints" and "prompts." The problem seems to be that Simple Form doesn't implement this context correctly for the form collection property "priority" in the same way it does for "prompts" and "hints." The form property "Priority" is not spec'ed by Simple Form, and does not work, which makes me think that it's been omitted on purpose. I'm going to have to contact the gem builders and see what they have to say.