From 484e1da6d1c8a5d7abf2e793d4ce3a767932dc8c Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 21 Feb 2023 07:55:04 +0100 Subject: [PATCH 1/2] 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. From f100e01dd227d14a313416a3780f818d57fcfb63 Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 22 Feb 2023 09:34:25 +0100 Subject: [PATCH 2/2] Use human_attribute_name in admin tables To be consistent with the previous commit we update the text that appears in the administration tables for discussions and proposals. Now instead of "Proposals" and "Discussions" will appear "Title" which makes more sense and is more consistent. --- app/views/admin/debates/index.html.erb | 2 +- app/views/admin/proposals/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/debates/index.html.erb b/app/views/admin/debates/index.html.erb index 0d3afd507..63e601aad 100644 --- a/app/views/admin/debates/index.html.erb +++ b/app/views/admin/debates/index.html.erb @@ -12,7 +12,7 @@ - + diff --git a/app/views/admin/proposals/index.html.erb b/app/views/admin/proposals/index.html.erb index 2c62d0c25..5cad75632 100644 --- a/app/views/admin/proposals/index.html.erb +++ b/app/views/admin/proposals/index.html.erb @@ -13,7 +13,7 @@ - +
<%= t("admin.debates.index.id") %><%= t("admin.debates.index.title") %><%= Debate.human_attribute_name(:title) %> <%= t("admin.debates.index.author") %>
<%= t("admin.proposals.index.id") %><%= t("admin.proposals.index.title") %><%= Proposal.human_attribute_name(:title) %> <%= t("admin.proposals.index.author") %> <%= t("admin.proposals.index.milestones") %> <%= t("admin.proposals.index.selected") %>