Fixes i18n errors now that they are detected by i18n-tasks

This commit is contained in:
kikito
2017-01-06 19:55:23 +01:00
parent 9d80b56f84
commit b7a0aa3b57
15 changed files with 46 additions and 157 deletions

View File

@@ -66,14 +66,14 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
def valid_price_params?
if /\D/.match params[:budget_investment][:price]
@investment.errors.add(:price, I18n.t('budget.investments.wrong_price_format'))
@investment.errors.add(:price, I18n.t('budgets.investments.wrong_price_format'))
end
if /\D/.match params[:budget_investment][:price_first_year]
@investment.errors.add(:price_first_year, I18n.t('budget.investments.wrong_price_format'))
@investment.errors.add(:price_first_year, I18n.t('budgets.investments.wrong_price_format'))
end
@investment.errors.empty?
end
end
end

View File

@@ -21,7 +21,7 @@
<p id="amount-spent" class="progress-meter-text spent-amount-text">
<%= @ballot.formatted_amount_spent(@heading) %>
<span id="amount-available" class="amount-available">
<%= t("budget.progress_bar.available") %>
<%= t("budgets.progress_bar.available") %>
<span><%= @ballot.formatted_amount_available(@heading) %></span>
</span>
</p>

View File

@@ -1,7 +1,7 @@
<div class="expanded budget no-margin-top padding">
<div class="row">
<div class="small-12 column">
<h1><%= t('budget.index.title') %></h1>
<h1><%= t('budgets.index.title') %></h1>
</div>
</div>
</div>
@@ -10,8 +10,8 @@
<div class="small-12 medium-9 column">
<table>
<thead>
<th><%= t('budget.index.name') %></th>
<th><%= t('budget.index.phase') %></th>
<th><%= Budget.human_attribute_name(:name) %></th>
<th><%= Budget.human_attribute_name(:phase) %></th>
</thead>
<tbody>
<% @budgets.each do |budget| %>

View File

@@ -4,7 +4,7 @@
<div class="remove supported inline-block">
<span class="icon-check-circle"
title="<%= t("budget.investments.investment.already_added") %>">
title="<%= t("budgets.investments.investment.already_added") %>">
</span>
<p class="investment-project-amount">
<%= investment.formatted_price %>
@@ -27,12 +27,12 @@
<%= investment.formatted_price %>
</p>
<% if investment.should_show_ballots? %>
<%= link_to t("budget.investments.investment.add"),
<%= link_to t("budgets.investments.investment.add"),
budget_ballot_lines_url(investment_id: investment.id,
budget_id: investment.budget_id,
investments_ids: investment_ids),
class: "button button-support small expanded",
title: t('budget.investments.investment.support_title'),
title: t('budgets.investments.investment.support_title'),
method: :post,
remote: true %>
<% end %>

View File

@@ -10,7 +10,7 @@
<% end %>
<% if can? :show, @ballot %>
<%= link_to t("budget.investments.header.check_ballot"),
<%= link_to t("budgets.investments.header.check_ballot"),
budget_ballot_path(@budget),
class: "button float-right" %>
<% end %>
@@ -23,7 +23,7 @@
<h1 class="inline-block margin-top"><%= @heading.name %></h1>
<% if can? :show, @ballot %>
<div id="check-ballot" style="display: none;">
<%= link_to t("budget.investments.header.check_ballot"),
<%= link_to t("budgets.investments.header.check_ballot"),
budget_ballot_path(@budget) %>
</div>
<% if @ballot.valid_heading?(@heading) %>
@@ -33,7 +33,7 @@
<% else %>
<br>
<p class="callout warning inline-block">
<%= t("budget.investments.header.different_heading_assigned_html",
<%= t("budgets.investments.header.different_heading_assigned_html",
heading_link: link_to(
@assigned_heading.name,
budget_investments_path(@budget, heading: @assigned_heading))
@@ -57,7 +57,7 @@
<%= t("shared.back") %>
<% end %>
<h1><%= t('budget.investments.index.title') %></h1>
<h1><%= t('budgets.investments.index.title') %></h1>
</div>
</div>
</div>

View File

@@ -6,7 +6,7 @@
<div class="budget-investment-content">
<% cache [locale_and_user_status(investment), 'index', investment, investment.author] do %>
<span class="label-budget-investment float-left"><%= t("budget.investments.investment.title") %></span>
<span class="label-budget-investment float-left"><%= t("budgets.investments.investment.title") %></span>
<span class="icon-budget"></span>
<h3><%= link_to investment.title, namespaced_budget_investment_path(investment) %></h3>
<p class="investment-project-info">
@@ -16,7 +16,7 @@
<% if investment.author.hidden? || investment.author.erased? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= t("budget.investments.show.author_deleted") %>
<%= t("budgets.investments.show.author_deleted") %>
</span>
<% else %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>

View File

@@ -20,18 +20,18 @@
<br>
<p id="investment_code">
<%= t("budget.investments.show.code_html", code: investment.id) %>
<%= t("budgets.investments.show.code_html", code: investment.id) %>
</p>
<% if investment.location.present? %>
<p>
<%= t("budget.investments.show.location_html", location: investment.location) %>
<%= t("budgets.investments.show.location_html", location: investment.location) %>
</p>
<% end %>
<% if investment.organization_name.present? %>
<p>
<%= t("budget.investments.show.organization_name_html", name: investment.organization_name) %>
<%= t("budgets.investments.show.organization_name_html", name: investment.organization_name) %>
</p>
<% end %>
@@ -44,12 +44,12 @@
<% end %>
<% if investment.unfeasible? && investment.unfeasibility_explanation.present? %>
<h2><%= t('budget.investments.show.unfeasibility_explanation') %></h2>
<h2><%= t('budgets.investments.show.unfeasibility_explanation') %></h2>
<p><%= investment.unfeasibility_explanation %></p>
<% end %>
<% if investment.feasible? && investment.price_explanation.present? %>
<h2><%= t('budget.investments.show.price_explanation') %></h2>
<h2><%= t('budgets.investments.show.price_explanation') %></h2>
<p><%= investment.price_explanation %></p>
<% end %>
</div>
@@ -80,7 +80,7 @@
</div>
<div class="sidebar-divider"></div>
<h2><%= t("budget.investments.show.share") %></h2>
<h2><%= t("budgets.investments.show.share") %></h2>
<div class="social-share-full">
<%= social_share_button_tag("#{investment.title} #{setting['twitter_hashtag']}") %>
<% if browser.device.mobile? %>

View File

@@ -2,11 +2,11 @@
<% if can?(:create, Budget::Investment.new(budget: @budget)) %>
<% if current_user && current_user.level_two_or_three_verified? %>
<%= link_to t("budget.investments.index.sidebar.create"), new_budget_investment_path, class: "button budget expanded" %>
<%= link_to t("budgets.investments.index.sidebar.create"), new_budget_investment_path, class: "button budget expanded" %>
<% else %>
<div class="callout warning">
<%= t("budget.investments.index.sidebar.verified_only",
verify: link_to(t("budget.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
<%= t("budgets.investments.index.sidebar.verified_only",
verify: link_to(t("budgets.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
</div>
<% end %>
<% end %>
@@ -16,17 +16,17 @@
<div class="sidebar-divider"></div>
<h2 class="sidebar-title"><%= t("budget.investments.index.sidebar.my_ballot") %></h2>
<h2 class="sidebar-title"><%= t("budgets.investments.index.sidebar.my_ballot") %></h2>
<% if @ballot.investments.by_heading(@heading.id).count > 0 %>
<p>
<em>
<%= t("budget.investments.index.sidebar.voted_html",
<%= t("budgets.investments.index.sidebar.voted_html",
count: @ballot.investments.by_heading(@heading.id).count,
amount_spent: @ballot.formatted_amount_spent(@heading)) %>
</em>
</p>
<% else %>
<p><strong><%= t("budget.investments.index.sidebar.zero") %></strong></p>
<p><strong><%= t("budgets.investments.index.sidebar.zero") %></strong></p>
<% end %>
<ul class="ballot-list">
@@ -39,5 +39,5 @@
<% end %>
</ul>
<p class="callout primary"><%= t("budget.investments.index.sidebar.voted_info") %></p>
<p class="callout primary"><%= t("budgets.investments.index.sidebar.voted_info") %></p>
<% end %>

View File

@@ -5,23 +5,23 @@
<div class="supports js-participation">
<span class="total-supports <%= 'no-button' unless voting_allowed || user_voted_for %>">
<%= t("budget.investments.investment.supports", count: investment.total_votes) %>
<%= t("budgets.investments.investment.supports", count: investment.total_votes) %>
</span>
<div class="in-favor js-in-favor">
<% if user_voted_for %>
<div class="supported callout success">
<%= t("budget.investments.investment.already_supported") %>
<%= t("budgets.investments.investment.already_supported") %>
</div>
<% elsif investment.should_show_votes? %>
<%= link_to vote_url,
class: "button button-support small expanded",
title: t('budget.investments.investment.support_title'),
title: t('budgets.investments.investment.support_title'),
method: "post",
remote: true,
"aria-hidden" => css_for_aria_hidden(reason) do %>
<%= t("budget.investments.investment.give_support") %>
<%= t("budgets.investments.investment.give_support") %>
<% end %>
<% end %>
</div>

View File

@@ -1,8 +1,8 @@
<% provide :title do %><%= t('budget.investments.index.title') %><% end %>
<% provide :title do %><%= t('budgets.investments.index.title') %><% end %>
<% content_for :header_addon do %>
<%= render "shared/search_form",
search_path: budget_investments_path(budget_id: @budget.id, page: 1),
i18n_namespace: "budget.investments.index.search_form" %>
i18n_namespace: "budgets.investments.index.search_form" %>
<% end %>
<main id="budget-investments-main">
@@ -17,23 +17,23 @@
<div class="small-12 search-results margin-bottom">
<% if params[:unfeasible].present? %>
<h2><%= t("budget.investments.index.unfeasible") %></h2>
<h2><%= t("budgets.investments.index.unfeasible") %></h2>
<p>
<%= t("budget.investments.index.unfeasible_text",
definitions: link_to(t("budget.investments.index.unfeasible_text_definitions"), "https://decide.madrid.es/participatory_budget_info#20")).html_safe %>
<%= t("budgets.investments.index.unfeasible_text",
definitions: link_to(t("budgets.investments.index.unfeasible_text_definitions"), "https://decide.madrid.es/participatory_budget_info#20")).html_safe %>
</p>
<% end %>
<%= content_tag(:h2, t("budget.investments.index.by_heading", heading: @heading.name)) if @heading.present? %>
<%= content_tag(:h2, t("budgets.investments.index.by_heading", heading: @heading.name)) if @heading.present? %>
<% if params[:search].present? %>
<h2>
<%= page_entries_info @investments %>
<%= t("budget.investments.index.search_results", count: @investments.size, search_term: params[:search]) %>
<%= t("budgets.investments.index.search_results", count: @investments.size, search_term: params[:search]) %>
</h2>
<% end %>
</div>
<%= render('shared/order_links', i18n_namespace: "budget.investments.index") unless params[:unfeasible].present? %>
<%= render('shared/order_links', i18n_namespace: "budgets.investments.index") unless params[:unfeasible].present? %>
<% @investments.each do |investment| %>
<%= render partial: '/budgets/investments/investment', locals: {

View File

@@ -12,18 +12,18 @@
</div>
<div class="small-12 medium-3 column info padding" data-equalizer-watch>
<p>
<strong><%= t('budget.show.phase') %></strong>
<strong><%= t('budgets.show.phase') %></strong>
<br>
<%= t("budget.phase.#{@budget.phase}") %>
</p>
<% if can?(:create, Budget::Investment.new(budget: @budget)) %>
<% if current_user && current_user.level_two_or_three_verified? %>
<%= link_to t("budget.investments.index.sidebar.create"), new_budget_investment_path(@budget), class: "button margin-top" %>
<%= link_to t("budgets.investments.index.sidebar.create"), new_budget_investment_path(@budget), class: "button margin-top" %>
<% else %>
<div class="callout warning margin-top">
<%= t("budget.investments.index.sidebar.verified_only",
verify: link_to(t("budget.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
<%= t("budgets.investments.index.sidebar.verified_only",
verify: link_to(t("budgets.investments.index.sidebar.verify_account"), verification_path)).html_safe %>
</div>
<% end %>
<% end %>
@@ -35,7 +35,7 @@
<div class="small-12 medium-9 column">
<table class="table-fixed">
<thead>
<th><%= t('budget.show.group') %></th>
<th><%= t('budgets.show.group') %></th>
</thead>
<tbody>
<% @budget.groups.each do |group| %>