diff --git a/CHANGELOG.md b/CHANGELOG.md index a5d4ce1013..14a07eda61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ * [#251] [FEATURE] Raise a helpful error when an attribute is missing from `ATTRIBUTE_TYPES` +* [#298] [FEATURE] Support ActiveRecord model I18n translations * [#231] [UI] Fix layout issue on show page where a long label next to an empty value would cause following fields on the page to be mis-aligned. * [#259] [BUGFIX] Make installation generator more robust diff --git a/app/helpers/administrate/application_helper.rb b/app/helpers/administrate/application_helper.rb index 189aa75df9..9834493f7d 100644 --- a/app/helpers/administrate/application_helper.rb +++ b/app/helpers/administrate/application_helper.rb @@ -4,5 +4,17 @@ def render_field(field, locals = {}) locals.merge!(field: field) render locals: locals, partial: field.to_partial_path end + + def display_resource_name(resource_name) + resource_name. + to_s. + classify. + constantize. + model_name. + human( + count: 0, + default: resource_name.to_s.pluralize.titleize, + ) + end end end diff --git a/app/views/administrate/application/_sidebar.html.erb b/app/views/administrate/application/_sidebar.html.erb index 08d875cb7a..74f5141d80 100644 --- a/app/views/administrate/application/_sidebar.html.erb +++ b/app/views/administrate/application/_sidebar.html.erb @@ -11,7 +11,7 @@ as defined by the DashboardManifest. <% DashboardManifest::DASHBOARDS.each do |resource| %>