Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Issues
  • #1105
Closed
Open
Issue created Mar 05, 2018 by Pablo Brasero@pablobmContributor

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.
  • 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.
  • HasOne (eg: Product#product_meta_tag)

    • Rendered as field.nested_form.resource_name.titleize
    • Gives "Product Meta Tag".
    • No i18n.

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.

Assignee
Assign to
Time tracking