Skip to content

Commit 50a57fa

Browse files
committed
added i18n
1 parent 8594373 commit 50a57fa

15 files changed

+220
-5
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,10 @@
1616
/tmp
1717
.idea
1818
public/spree/*
19+
solr/data/*
20+
solr/default/*
21+
solr/development/*
22+
solr/pids/*
23+
solr/test/*
24+
log/*
25+

.rvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rvm use 2.0.0@commit --create
1+
rvm use 2.1.0@commit --create

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ end
4747
gem 'spree', github: 'spree/spree', branch: '2-2-stable'
4848
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-2-stable'
4949
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-2-stable'
50+
gem 'spree_i18n', github: 'spree/spree_i18n', branch: '2-2-stable'
5051

5152
gem 'sunspot_rails'
5253
gem 'sunspot_solr'

Gemfile.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ GIT
7171
spree_sample (2.2.3.beta)
7272
spree_core (= 2.2.3.beta)
7373

74+
GIT
75+
remote: git://github.com/spree/spree_i18n.git
76+
revision: 7b879e903110fa6905ff81be84ac9f2aecde7c5f
77+
branch: 2-2-stable
78+
specs:
79+
spree_i18n (3.0.0)
80+
globalize (~> 4.0.0)
81+
i18n_data (~> 0.4.1)
82+
rails-i18n (~> 4.0.0)
83+
spree_core (~> 2.2.0)
84+
7485
GIT
7586
remote: https://github.com/spree/spree_auth_devise.git
7687
revision: 81a0fbb2db15efbbb50d0d139bbc41aee7fa58a1
@@ -175,12 +186,16 @@ GEM
175186
railties (>= 3.2, < 5.0)
176187
friendly_id (5.0.4)
177188
activerecord (>= 4.0.0)
189+
globalize (4.0.1)
190+
activemodel (>= 4.0.0, < 5)
191+
activerecord (>= 4.0.0, < 5)
178192
highline (1.6.21)
179193
hike (1.2.3)
180194
httparty (0.13.1)
181195
json (~> 1.8)
182196
multi_xml (>= 0.5.2)
183197
i18n (0.6.9)
198+
i18n_data (0.4.1)
184199
jbuilder (1.5.3)
185200
activesupport (>= 3.0.0)
186201
multi_json (>= 1.2.0)
@@ -233,6 +248,9 @@ GEM
233248
bundler (>= 1.3.0, < 2.0)
234249
railties (= 4.0.5)
235250
sprockets-rails (~> 2.0.0)
251+
rails-i18n (4.0.2)
252+
i18n (~> 0.6)
253+
rails (>= 4.0)
236254
railties (4.0.5)
237255
actionpack (= 4.0.5)
238256
activesupport (= 4.0.5)
@@ -314,6 +332,7 @@ DEPENDENCIES
314332
spree!
315333
spree_auth_devise!
316334
spree_gateway!
335+
spree_i18n!
317336
spree_monetaweb!
318337
spree_solr!
319338
sqlite3

config/initializers/devise.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Devise.secret_key = "7cfef5fd82a83898dfda8951439fd006df893f68e97d8f4fa1dcea86219a851dccf930e05d3afe11772f08a0aa2cf7a9e71d"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This migration comes from spree (originally 20140601011216)
2+
class SetShipmentTotalForUsersUpgrading < ActiveRecord::Migration
3+
def up
4+
# NOTE You might not need this at all unless you're upgrading from Spree 2.1.x
5+
# or below. For those upgrading this should populate the Order#shipment_total
6+
# for legacy orders
7+
execute "UPDATE spree_orders
8+
SET shipment_total = (SELECT SUM(spree_shipments.cost) AS sum_id
9+
FROM spree_shipments
10+
WHERE spree_shipments.order_id = spree_orders.id)
11+
WHERE spree_orders.completed_at IS NOT NULL AND spree_orders.shipment_total = 0"
12+
end
13+
end
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This migration comes from spree (originally 20140609201656)
2+
class AddDeletedAtToSpreePromotionActions < ActiveRecord::Migration
3+
def change
4+
add_column :spree_promotion_actions, :deleted_at, :datetime
5+
add_index :spree_promotion_actions, :deleted_at
6+
end
7+
end
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This migration comes from spree_i18n (originally 20130419041407)
2+
class AddTranslationsToMainModels < ActiveRecord::Migration
3+
def up
4+
params = { :name => :string, :description => :text, :meta_description => :string,
5+
:meta_keywords => :string }
6+
Spree::Product.create_translation_table!(params, { :migrate_data => true })
7+
8+
params = { :name => :string, :description => :string }
9+
Spree::Promotion.create_translation_table!(params, { :migrate_data => true })
10+
11+
params = { :name => :string, :presentation => :string }
12+
Spree::OptionType.create_translation_table!(params, { :migrate_data => true })
13+
Spree::Property.create_translation_table!(params, { :migrate_data => true })
14+
15+
Spree::Taxonomy.create_translation_table!({ :name => :string }, { :migrate_data => true })
16+
17+
params = { :name => :string, :description => :text, :meta_title => :string,
18+
:meta_description => :string, :meta_keywords => :string,
19+
:permalink => :string }
20+
Spree::Taxon.create_translation_table!(params, { :migrate_data => true })
21+
end
22+
23+
def down
24+
Spree::Product.drop_translation_table! :migrate_data => true
25+
Spree::Promotion.drop_translation_table! :migrate_data => true
26+
Spree::Property.drop_translation_table! :migrate_data => true
27+
Spree::OptionType.drop_translation_table! :migrate_data => true
28+
Spree::Taxonomy.drop_translation_table! :migrate_data => true
29+
Spree::Taxon.drop_translation_table! :migrate_data => true
30+
end
31+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This migration comes from spree_i18n (originally 20130518224827)
2+
class AddTranslationsToProductPermalink < ActiveRecord::Migration
3+
def up
4+
if column_exists?(:spree_products, :permalink)
5+
fields = { :permalink => :string }
6+
else
7+
fields = { :slug => :string }
8+
end
9+
Spree::Product.add_translation_fields!(fields, { :migrate_data => true })
10+
end
11+
12+
def down
13+
end
14+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This migration comes from spree_i18n (originally 20131009091000)
2+
class AddTranslationsToOptionValue < ActiveRecord::Migration
3+
def up
4+
params = { :name => :string, :presentation => :string }
5+
Spree::OptionValue.create_translation_table!(params, { :migrate_data => true })
6+
end
7+
8+
def down
9+
Spree::OptionValue.drop_translation_table! :migrate_data => true
10+
end
11+
end

0 commit comments

Comments
 (0)