i18n app/views/campaigns/_campaigns_table.html.erb

This commit is contained in:
Eric Schultz 2021-04-15 10:45:01 -05:00 committed by Eric Schultz
parent b52b72af34
commit c6fee85e5f
2 changed files with 40 additions and 3 deletions

View file

@ -13,7 +13,7 @@
<td class='u-padding--10'> <td class='u-padding--10'>
<% if campaign.end_datetime %> <% if campaign.end_datetime %>
<p class='u-marginBottom--0'> <p class='u-marginBottom--0'>
<small><strong>Until: <%= Format::Date.full(campaign.end_datetime, campaign.nonprofit.timezone) %> </strong></small> <small><strong><%= t('campaigns.until_end_datetime', end_datetime: Format::Date.full(campaign.end_datetime, campaign.nonprofit.timezone)) %></strong></small>
</p> </p>
<% end %> <% end %>
<h6 class='u-marginTop--0 u-marginBottom--5'> <h6 class='u-marginTop--0 u-marginBottom--5'>
@ -23,11 +23,11 @@
<small><%= campaign.summary ? strip_tags(campaign.summary) : strip_tags(campaign.tagline) %></small> <small><%= campaign.summary ? strip_tags(campaign.summary) : strip_tags(campaign.tagline) %></small>
</p> </p>
<% if campaign.show_total_count %> <% if campaign.show_total_count %>
<span class='pastelBox--white u-padding--3'><%= metric['supporters_count'] %> <small>supporters</small></span> <span class='pastelBox--white u-padding--3'><%= t('campaigns.total_count_of_supporters', supporters_count: metric['supporters_count'] ) %></span>
<% end %> <% end %>
<% if campaign.show_total_raised %> <% if campaign.show_total_raised %>
<span class='pastelBox--white u-padding--3'> <span class='pastelBox--white u-padding--3'>
<%= print_currency metric['total_raised'], campaign.nonprofit.currency_symbol %> <small>raised</small> <%= t('campaigns.total_amount_raised_html', total_raised: print_currency(metric['total_raised'], campaign.nonprofit.currency_symbol))%>
</span> </span>
<% end %> <% end %>
</td> </td>

View file

@ -0,0 +1,37 @@
# License: CC0-1.0
# Files in the config/locales directory are used for internationalization
# and are automatically loaded by Rails. If you want to use locales other
# than English, add the necessary files in this directory.
#
# To use the locales, use `I18n.t`:
#
# I18n.t 'hello'
#
# In views, this is aliased to just `t`:
#
# <%= t('hello') %>
#
# To use a different locale, set it with `I18n.locale`:
#
# I18n.locale = :es
#
# This would use the information in config/locales/es.yml.
#
# The following keys must be escaped otherwise they will not be retrieved by
# the default I18n backend:
#
# true, false, on, off, yes, no
#
# Instead, surround them with single quotes.
#
# en:
# 'true': 'foo'
#
# To learn more, please read the Rails Internationalization guide
# available at https://guides.rubyonrails.org/i18n.html.
en:
campaigns:
until_end_datetime: "Until: %{end_datetime}"
total_count_of_supporters_html: "%{supporters_count} <small>supporters</small>"
total_amount_raised_html: "%{total_raised} <small>raised</small>"