Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #23 from hooktstudios/master

Translations for Spree::ShippingMethod, Spree::TaxRate
  • Loading branch information...
commit 1ef9e76f0e9572f47aa2ccae9b9283a71e3db7a9 2 parents c9c79db + b5ed6d7
@jipiboily authored
View
5 app/models/shipping_method_decorator.rb
@@ -0,0 +1,5 @@
+module Spree
+ ShippingMethod.class_eval do
+ translates :name
+ end
+end
View
5 app/models/tax_rate_decorator.rb
@@ -0,0 +1,5 @@
+module Spree
+ TaxRate.class_eval do
+ translates :name
+ end
+end
View
14 app/views/spree/order_mailer/cancel_email.fr.text.erb
@@ -1,17 +1,17 @@
Cher client,
-Votre commande est annulee.
-Merci de conserver cet email pour un eventuel usage ulterieur.
+Votre commande est annulée.
+Merci de conserver ce courriel pour un éventuel usage ultérieur.
============================================================
-Commande [ANNULEE]
+Commande [ANNULÉE]
============================================================
<% @order.line_items.each do |item| %>
-<%= item.variant.sku %> <%= item.variant.product.name %> <%= variant_options(item.variant) %> (<%= item.quantity %>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
+ <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
<% end %>
============================================================
Sous-Total: <%= number_to_currency @order.item_total %>
-<% @order.adjustments.each do |adjustment| %>
-<%= "#{adjustment.label}: #{number_to_currency adjustment.amount}"%>
+<% @order.adjustments.eligible.each do |adjustment| %>
+ <%= raw(adjustment.label) %> <%= number_to_currency(adjustment.amount) %>
<% end %>
-Total TTC: <%= number_to_currency @order.total %>
+Total TTC: <%= number_to_currency(@order.total) %>
View
12 app/views/spree/order_mailer/confirm_email.fr.text.erb
@@ -1,20 +1,20 @@
Cher client,
-Votre commande est confirmee.
-Merci de conserver cet email pour un eventuel usage ulterieur.
+Votre commande est confirmée.
+Merci de conserver ce courriel pour un éventuel usage ultérieur.
============================================================
Commande
============================================================
<% @order.line_items.each do |item| %>
-<%=item.variant.sku %> <%=item.variant.product.name%> <%= item.variant.options_text -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
+ <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
<% end %>
============================================================
Sous-Total: <%= number_to_currency @order.item_total %>
-<% @order.adjustments.each do |adjustment| %>
-<%= "#{adjustment.label}: #{number_to_currency adjustment.amount}"%>
+<% @order.adjustments.eligible.each do |adjustment| %>
+ <%= raw(adjustment.label) %> <%= number_to_currency(adjustment.amount) %>
<% end %>
-Total TTC: <%= number_to_currency @order.total %>
+Total TTC: <%= number_to_currency(@order.total) %>
Merci pour votre achat.
View
10 db/migrate/20120620153608_add_translations_to_tax_rates.rb
@@ -0,0 +1,10 @@
+class AddTranslationsToTaxRates < ActiveRecord::Migration
+ def up
+ Spree::TaxRate.create_translation_table!({:name => :string},
+ {:migrate_data => true})
+ end
+
+ def down
+ Spree::TaxRate.drop_translation_table!(:migrate_date => true)
+ end
+end
View
9 db/migrate/20120628135204_add_translations_to_shipping_methods.rb
@@ -0,0 +1,9 @@
+class AddTranslationsToShippingMethods < ActiveRecord::Migration
+ def up
+ Spree::ShippingMethod.create_translation_table!(:name => :string)
+ end
+
+ def down
+ Spree::ShippingMethod.drop_translation_table!
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.