Created
August 13, 2012 11:46
-
-
Save alininja/3339932 to your computer and use it in GitHub Desktop.
Can't Globalize Spree::PaymentMethod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#db/migrate/20120501085533_create_translation_tables.rb | |
class CreateTranslationTables < ActiveRecord::Migration | |
def up | |
Spree::PaymentMethod.create_translation_table! :name => :string | |
Spree::Product.create_translation_table! :name => :string, :description => :text, :ingredients => :text | |
Spree::Taxon.create_translation_table! :name => :string | |
Spree::OptionType.create_translation_table! :presentation => :string | |
Spree::OptionValue.create_translation_table! :presentation => :string | |
Spree::ShippingMethod.create_translation_table! :name => :string | |
end | |
def down | |
Spree::PaymentMethod.drop_translation_table! | |
Spree::Product.drop_translation_table! | |
Spree::Taxon.drop_translation_table! | |
Spree::OptionType.drop_translation_table! | |
Spree::OptionValue.drop_translation_table! | |
Spree::ShippingMethod.drop_translation_table! | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#app/models/spree/payment_method_decorator.rb | |
Spree::PaymentMethod.class_eval do | |
translates :name, :fallbacks_for_empty_translations => true | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#db/project/spree/payment_methods.yml | |
bogus_dev: | |
name: Credit Card | |
description: Bogus payment gateway for development. | |
environment: development | |
active: true | |
type: Spree::Gateway::Bogus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#db/project/spree/payment_method/translations.yml | |
bogus_dev_en: | |
spree_payment_method: bogus_dev | |
locale: en | |
name: Credit Card | |
bogus_dev_ja: | |
spree_payment_method: bogus_dev | |
locale: ja | |
name: Credit Card TBD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment