i18n inconsistencies in forms for associations
There are some inconsistencies in the way Administrate handles i18n in places. For example, this is how form labels are rendered for forms in the HasMany
/BelongsTo
/HasOne
cases:
-
HasMany
(eg:Order#line_items
)- Rendered as
f.label field.attribute_key, field.attribute
- Gives "line_items", which is better than "line_item_ids", but isn't great
- No i18n.
- Rendered as
-
BelongsTo
(eg:Customer#country
)- Rendered as
f.label field.permitted_attribute
- Defaults to "Country code" (similar to "Country id" in this case).
- Allows i18n as
helpers.label.customer.country_code
.
- Rendered as
-
HasOne
(eg:Product#product_meta_tag
)- Rendered as
field.nested_form.resource_name.titleize
- Gives "Product Meta Tag".
- No i18n.
- Rendered as
I see that https://github.com/thoughtbot/administrate/pull/707/files touches on app/views/fields/has_many/_index.html.erb
, which was something I had noted was inconsistent in this way. Otherwise, this is a relatively different thing from that PR.