From ad6d830c1f98b4252496d8ce82dac2cd7aca23f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 13 Jul 2020 02:04:41 +0200 Subject: [PATCH] Make translations more consistent We're passing the amount as a paramenter to the "remaining" text, so it makes sense to pass it to the "amount spent" text as well. Here we're also changing the I18n key to the text saying users can change their vote, so it's easier to note the text is about changing their vote, and not about the projects they have voted so far. --- app/views/budgets/ballot/_ballot.html.erb | 6 ++---- app/views/budgets/investments/_sidebar.html.erb | 4 ++-- config/locales/en/budgets.yml | 6 +++--- config/locales/es/budgets.yml | 6 +++--- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/views/budgets/ballot/_ballot.html.erb b/app/views/budgets/ballot/_ballot.html.erb index 795246d47..e288111a9 100644 --- a/app/views/budgets/ballot/_ballot.html.erb +++ b/app/views/budgets/ballot/_ballot.html.erb @@ -32,10 +32,8 @@ <% if @ballot.has_lines_in_group?(group) %>

- <%= t("budgets.ballots.show.amount_spent") %> - - <%= @ballot.formatted_amount_spent(heading) %> - + <%= sanitize(t("budgets.ballots.show.amount_spent", + amount: @ballot.formatted_amount_spent(heading))) %>

<% else %>

diff --git a/app/views/budgets/investments/_sidebar.html.erb b/app/views/budgets/investments/_sidebar.html.erb index 823c23a89..2a7070670 100644 --- a/app/views/budgets/investments/_sidebar.html.erb +++ b/app/views/budgets/investments/_sidebar.html.erb @@ -14,8 +14,8 @@ <% if @heading && can?(:show, @ballot) %>

- <%= sanitize(t("budgets.investments.index.sidebar.voted_info", - link: link_to(t("budgets.investments.index.sidebar.voted_info_link"), + <%= sanitize(t("budgets.investments.index.sidebar.change_vote_info", + link: link_to(t("budgets.investments.index.sidebar.change_vote_link"), budget_ballot_path(@budget)))) %>

<% end %> diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml index f3c5713b5..6dad9ade6 100644 --- a/config/locales/en/budgets.yml +++ b/config/locales/en/budgets.yml @@ -3,7 +3,7 @@ en: ballots: show: title: Your ballot - amount_spent: Amount spent + amount_spent: "Amount spent %{amount}" remaining: "You still have %{amount} to invest." no_balloted_group_yet: "You have not voted on this group yet, go vote!" remove: Remove vote @@ -87,8 +87,8 @@ en: voted: one: "You voted one proposal with a cost of %{amount_spent}" other: "You voted %{count} proposals with a cost of %{amount_spent}" - voted_info: You can %{link} at any time until the close of this phase. No need to spend all the money available. - voted_info_link: change your vote + change_vote_info: "You can %{link} at any time until the close of this phase. No need to spend all the money available." + change_vote_link: "change your vote" different_heading_assigned: "You have active votes in another heading: %{heading_link}" change_ballot: "If your change your mind you can remove your votes in %{check_ballot} and start again." check_ballot_link: "check and confirm my ballot" diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml index e096dcc3b..5b0c3c918 100644 --- a/config/locales/es/budgets.yml +++ b/config/locales/es/budgets.yml @@ -3,7 +3,7 @@ es: ballots: show: title: Mis votos - amount_spent: Coste total + amount_spent: "Coste total %{amount}" remaining: "Te quedan %{amount} para invertir" no_balloted_group_yet: "Todavía no has votado proyectos de este grupo, ¡vota!" remove: Quitar voto @@ -87,8 +87,8 @@ es: voted: one: "Has votado un proyecto por un valor de %{amount_spent}" other: "Has votado %{count} proyectos por un valor de %{amount_spent}" - voted_info: Puedes %{link} en cualquier momento hasta el cierre de esta fase. No hace falta que gastes todo el dinero disponible. - voted_info_link: cambiar tus votos + change_vote_info: "Puedes %{link} en cualquier momento hasta el cierre de esta fase. No hace falta que gastes todo el dinero disponible." + change_vote_link: "cambiar tus votos" different_heading_assigned: "Ya apoyaste proyectos de otra sección del presupuesto: %{heading_link}" change_ballot: "Si cambias de opinión puedes borrar tus votos en %{check_ballot} y volver a empezar." check_ballot_link: "revisar y confirmar mis votos"