-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use I18n translations for custom labels on dashboards #492
Conversation
2e3cf72
to
47e2fc4
Compare
cell-label--<%= collection_presenter.ordered_html_class(attr_name) %> | ||
<th class="cell-label | ||
cell-label--<%= attr_type.html_class %> | ||
cell-label--<%= collection_presenter.ordered_html_class(attr_name) %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change: improve spacing of a super-long HTML tag
68cba4d
to
4ad2eb2
Compare
@mcmire, can I get a review? Thanks! |
Problem: At the moment, developers can customize a field's label on form pages with the following translation structure: ``` en: helpers: label: customer: name: Full Name ``` Many developers expect this label change to take effect on the `show` and `index` pages, as well as the form page. Solution: Translate attribute labels with I18n before displaying them on `show` and `index` pages.
Changes: * [#573] [FEATURE] Render custom javascripts and stylesheets to the page by registering them with Administrate in an initializer. For example, you can create `config/initializers/administrate.rb` with the contents: ``` Administrate::Engine.add_javascript "my_plugin/script" Administrate::Engine.add_stylesheet "my_plugin/styles" ``` * [#567] [FEATURE] Add a partial for rendering HTML links to stylesheets. This is useful for plugin developers, as well as people who want to add custom stylesheets on a page-by-page basis using `content_for(:stylesheet)`. * [#492] [FEATURE] Translate attribute labels on show and index pages. To customize an attribute label, add translations according to the structure: ``` en: helpers: label: customer: name: Full Name ```
Administrate already use |
Changes: * [thoughtbot#573] [FEATURE] Render custom javascripts and stylesheets to the page by registering them with Administrate in an initializer. For example, you can create `config/initializers/administrate.rb` with the contents: ``` Administrate::Engine.add_javascript "my_plugin/script" Administrate::Engine.add_stylesheet "my_plugin/styles" ``` * [thoughtbot#567] [FEATURE] Add a partial for rendering HTML links to stylesheets. This is useful for plugin developers, as well as people who want to add custom stylesheets on a page-by-page basis using `content_for(:stylesheet)`. * [thoughtbot#492] [FEATURE] Translate attribute labels on show and index pages. To customize an attribute label, add translations according to the structure: ``` en: helpers: label: customer: name: Full Name ```
Changes: * [thoughtbot#573] [FEATURE] Render custom javascripts and stylesheets to the page by registering them with Administrate in an initializer. For example, you can create `config/initializers/administrate.rb` with the contents: ``` Administrate::Engine.add_javascript "my_plugin/script" Administrate::Engine.add_stylesheet "my_plugin/styles" ``` * [thoughtbot#567] [FEATURE] Add a partial for rendering HTML links to stylesheets. This is useful for plugin developers, as well as people who want to add custom stylesheets on a page-by-page basis using `content_for(:stylesheet)`. * [thoughtbot#492] [FEATURE] Translate attribute labels on show and index pages. To customize an attribute label, add translations according to the structure: ``` en: helpers: label: customer: name: Full Name ```
Problem:
There was uncertainty about how to create custom labels for fields. In #451, it was suggested that we could use I18n translations to solve the problem.
If we accept that as the standard way to set custom labels, we should have a test for it.
Solution:
To Do: