Skip to content

Commit

Permalink
Merge pull request #796 from Murph33/use_model_names_order_views
Browse files Browse the repository at this point in the history
Use model names in translations in order views.
  • Loading branch information
jhawthorn committed Feb 15, 2016
2 parents 1841403 + 316471a commit 5bfe5dd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion backend/app/views/spree/admin/orders/_risk_analysis.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
</strong></td>
<td class="align-center">
<span class="<%= @order.payments.failed.count > 0 ? 'state void' : 'state complete' %>">
<%= link_to "#{Spree.t 'payments_count', count: @order.payments.failed.count, default: pluralize(@order.payments.failed.count, Spree.t(:payment))}", spree.admin_order_payments_path(@order) %>
<%= link_to Spree.t(:payments_failed_count,
count: @order.payments.failed.count),
spree.admin_order_payments_path(@order) %>
</span>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
<th><%= Spree.t(:amount) %></th>
<th><%= Spree.t(:payment_method) %></th>
<th><%= Spree::PaymentMethod.model_name.human %></th>
<th><%= Spree.t(:transaction_id) %></th>
<th><%= Spree.t(:payment_state) %></th>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="<%= "shipment_#{shipment.id}" %>" data-hook="admin_shipment_form">
<fieldset class="no-border-bottom">
<legend align="center" class="stock-location" data-hook="stock-location">
<%= Spree.t(:shipment) %>
<%= Spree::Shipment.model_name.human %>
<span class="shipment-number"><%= shipment.number %></span>
<%= Spree.t(:from) %>
<strong class="stock-location-name" data-hook="stock-location-name">"<%= shipment.stock_location.name %>"</strong>
Expand Down
6 changes: 4 additions & 2 deletions backend/app/views/spree/admin/orders/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@
</table>
<% else %>
<div class="alpha twelve columns no-objects-found">
<%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/order')) %>,
<%= link_to Spree.t(:add_one), spree.new_admin_order_path %>!
<%= Spree.t(:no_resource_found_html,
resource: Spree::Order.model_name.human(count: :other),
add_one_link: link_to(Spree.t(:no_resource_found_link),
spree.new_admin_order_path)) %>
</div>
<% end %>
Expand Down
5 changes: 5 additions & 0 deletions core/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,8 @@ en:
no_promotions_found: No promotions found
no_results: No results
no_rules_added: No rules added
no_resource_found_html: 'No %{resource} found, %{add_one_link}!'
no_resource_found_link: Add One
no_resource_found: ! 'No %{resource} found'
no_shipping_methods_found: No shipping methods found
no_shipping_method_selected: No shipping method selected.
Expand Down Expand Up @@ -1270,6 +1272,9 @@ en:
payment: Payment
payment_amount: Payment Amount
payment_could_not_be_created: Payment could not be created.
payments_failed_count:
one: 1 Payment
other: '%{count} Payments'
payment_identifier: Payment Identifier
payment_information: Payment Information
payment_method: Payment Method
Expand Down

0 comments on commit 5bfe5dd

Please sign in to comment.