From 484e1da6d1c8a5d7abf2e793d4ce3a767932dc8c Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 21 Feb 2023 07:55:04 +0100 Subject: [PATCH] Remove duplicated keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the images.yml file we have a duplicate key with the same translation, so we can remove it. In the admin.yml file we have a duplicate key with different translation. This translation is only used in 2 places in the application: - In the administration table for collaborative legislation proposal index. - In the <% provide :title do %> of the same page. Although it is true that now the second translation (Title) is applied in both cases, I think it makes more sense to use the first one (Proposals) in the page title because it seems to make more sense and be more useful to use "Proposals" instead of “Title”. In order not to modify the behavior in the translation shown in the administration table, we add human_attribute_name to obtain the expected result. --- app/views/admin/legislation/proposals/_proposals.html.erb | 2 +- config/locales/en/admin.yml | 1 - config/locales/en/images.yml | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/admin/legislation/proposals/_proposals.html.erb b/app/views/admin/legislation/proposals/_proposals.html.erb index b884120ed..264f92cda 100644 --- a/app/views/admin/legislation/proposals/_proposals.html.erb +++ b/app/views/admin/legislation/proposals/_proposals.html.erb @@ -7,7 +7,7 @@ <%= t("admin.legislation.proposals.index.id") %> - <%= t("admin.legislation.proposals.index.title") %> + <%= Legislation::Proposal.human_attribute_name(:title) %> <%= t("admin.legislation.proposals.index.supports") %> <%= t("admin.proposals.index.selected") %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 4ed87723a..07ba09c9a 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -619,7 +619,6 @@ en: title: Proposals back: Back id: Id - title: Title supports: Total supports form: custom_categories: Categories diff --git a/config/locales/en/images.yml b/config/locales/en/images.yml index 02ee8d843..155056604 100644 --- a/config/locales/en/images.yml +++ b/config/locales/en/images.yml @@ -7,7 +7,6 @@ en: delete_button: Remove image note: "You can upload one image of following content types: %{accepted_content_types}, up to %{max_file_size} MB." add_new_image: Add image - title_placeholder: Add a descriptive title for the image actions: destroy: notice: Image was deleted successfully.