Skip to content

Commit 50a57fa

Browse files
committed
added i18n
1 parent 8594373 commit 50a57fa

15 files changed

+220
-5
lines changed

.gitignore

+7
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

+1-1
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

+1
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

+19
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

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Devise.secret_key = "7cfef5fd82a83898dfda8951439fd006df893f68e97d8f4fa1dcea86219a851dccf930e05d3afe11772f08a0aa2cf7a9e71d"
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
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
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
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
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This migration comes from spree_i18n (originally 20140206202524)
2+
class RenameActivatorTranslationsToPromotionTranslations < ActiveRecord::Migration
3+
def change
4+
if ActiveRecord::Base.connection.table_exists? 'spree_activator_translations'
5+
rename_table :spree_activator_translations, :spree_promotion_translations
6+
rename_column :spree_promotion_translations, :spree_activator_id, :spree_promotion_id
7+
end
8+
end
9+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This migration comes from spree_i18n (originally 20140219130603)
2+
class UpdateSpreeProductTranslations < ActiveRecord::Migration
3+
def change
4+
if column_exists?(:spree_product_translations, :permalink)
5+
rename_column :spree_product_translations, :permalink, :slug
6+
end
7+
end
8+
end

db/schema.rb

+96-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended that you check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(version: 20140613182531) do
14+
ActiveRecord::Schema.define(version: 20140616162347) do
1515

1616
create_table "spree_addresses", force: true do |t|
1717
t.string "firstname"
@@ -176,6 +176,18 @@
176176
t.datetime "updated_at"
177177
end
178178

179+
create_table "spree_option_type_translations", force: true do |t|
180+
t.integer "spree_option_type_id"
181+
t.string "locale"
182+
t.datetime "created_at"
183+
t.datetime "updated_at"
184+
t.string "name"
185+
t.string "presentation"
186+
end
187+
188+
add_index "spree_option_type_translations", ["locale"], name: "index_spree_option_type_translations_on_locale"
189+
add_index "spree_option_type_translations", ["spree_option_type_id"], name: "index_spree_option_type_translations_on_spree_option_type_id"
190+
179191
create_table "spree_option_types", force: true do |t|
180192
t.string "name", limit: 100
181193
t.string "presentation", limit: 100
@@ -189,6 +201,18 @@
189201
t.integer "option_type_id"
190202
end
191203

204+
create_table "spree_option_value_translations", force: true do |t|
205+
t.integer "spree_option_value_id"
206+
t.string "locale"
207+
t.datetime "created_at"
208+
t.datetime "updated_at"
209+
t.string "name"
210+
t.string "presentation"
211+
end
212+
213+
add_index "spree_option_value_translations", ["locale"], name: "index_spree_option_value_translations_on_locale"
214+
add_index "spree_option_value_translations", ["spree_option_value_id"], name: "index_spree_option_value_translations_on_spree_option_value_id"
215+
192216
create_table "spree_option_values", force: true do |t|
193217
t.integer "position"
194218
t.string "name"
@@ -334,6 +358,21 @@
334358

335359
add_index "spree_product_properties", ["product_id"], name: "index_product_properties_on_product_id"
336360

361+
create_table "spree_product_translations", force: true do |t|
362+
t.integer "spree_product_id"
363+
t.string "locale"
364+
t.datetime "created_at"
365+
t.datetime "updated_at"
366+
t.string "name"
367+
t.text "description"
368+
t.string "meta_description"
369+
t.string "meta_keywords"
370+
t.string "slug"
371+
end
372+
373+
add_index "spree_product_translations", ["locale"], name: "index_spree_product_translations_on_locale"
374+
add_index "spree_product_translations", ["spree_product_id"], name: "index_spree_product_translations_on_spree_product_id"
375+
337376
create_table "spree_products", force: true do |t|
338377
t.string "name", default: "", null: false
339378
t.text "description"
@@ -378,11 +417,13 @@
378417
end
379418

380419
create_table "spree_promotion_actions", force: true do |t|
381-
t.integer "promotion_id"
382-
t.integer "position"
383-
t.string "type"
420+
t.integer "promotion_id"
421+
t.integer "position"
422+
t.string "type"
423+
t.datetime "deleted_at"
384424
end
385425

426+
add_index "spree_promotion_actions", ["deleted_at"], name: "index_spree_promotion_actions_on_deleted_at"
386427
add_index "spree_promotion_actions", ["id", "type"], name: "index_spree_promotion_actions_on_id_and_type"
387428
add_index "spree_promotion_actions", ["promotion_id"], name: "index_spree_promotion_actions_on_promotion_id"
388429

@@ -407,6 +448,18 @@
407448
add_index "spree_promotion_rules_users", ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id"
408449
add_index "spree_promotion_rules_users", ["user_id"], name: "index_promotion_rules_users_on_user_id"
409450

451+
create_table "spree_promotion_translations", force: true do |t|
452+
t.integer "spree_promotion_id"
453+
t.string "locale"
454+
t.datetime "created_at"
455+
t.datetime "updated_at"
456+
t.string "name"
457+
t.string "description"
458+
end
459+
460+
add_index "spree_promotion_translations", ["locale"], name: "index_spree_promotion_translations_on_locale"
461+
add_index "spree_promotion_translations", ["spree_promotion_id"], name: "index_spree_promotion_translations_on_spree_promotion_id"
462+
410463
create_table "spree_promotions", force: true do |t|
411464
t.string "description"
412465
t.datetime "expires_at"
@@ -436,6 +489,18 @@
436489
t.integer "property_id"
437490
end
438491

492+
create_table "spree_property_translations", force: true do |t|
493+
t.integer "spree_property_id"
494+
t.string "locale"
495+
t.datetime "created_at"
496+
t.datetime "updated_at"
497+
t.string "name"
498+
t.string "presentation"
499+
end
500+
501+
add_index "spree_property_translations", ["locale"], name: "index_spree_property_translations_on_locale"
502+
add_index "spree_property_translations", ["spree_property_id"], name: "index_spree_property_translations_on_spree_property_id"
503+
439504
create_table "spree_prototypes", force: true do |t|
440505
t.string "name"
441506
t.datetime "created_at"
@@ -638,13 +703,40 @@
638703
t.datetime "deleted_at"
639704
end
640705

706+
create_table "spree_taxon_translations", force: true do |t|
707+
t.integer "spree_taxon_id"
708+
t.string "locale"
709+
t.datetime "created_at"
710+
t.datetime "updated_at"
711+
t.string "name"
712+
t.text "description"
713+
t.string "meta_title"
714+
t.string "meta_description"
715+
t.string "meta_keywords"
716+
t.string "permalink"
717+
end
718+
719+
add_index "spree_taxon_translations", ["locale"], name: "index_spree_taxon_translations_on_locale"
720+
add_index "spree_taxon_translations", ["spree_taxon_id"], name: "index_spree_taxon_translations_on_spree_taxon_id"
721+
641722
create_table "spree_taxonomies", force: true do |t|
642723
t.string "name", null: false
643724
t.datetime "created_at"
644725
t.datetime "updated_at"
645726
t.integer "position", default: 0
646727
end
647728

729+
create_table "spree_taxonomy_translations", force: true do |t|
730+
t.integer "spree_taxonomy_id"
731+
t.string "locale"
732+
t.datetime "created_at"
733+
t.datetime "updated_at"
734+
t.string "name"
735+
end
736+
737+
add_index "spree_taxonomy_translations", ["locale"], name: "index_spree_taxonomy_translations_on_locale"
738+
add_index "spree_taxonomy_translations", ["spree_taxonomy_id"], name: "index_spree_taxonomy_translations_on_spree_taxonomy_id"
739+
648740
create_table "spree_taxons", force: true do |t|
649741
t.integer "parent_id"
650742
t.integer "position", default: 0

vendor/assets/javascripts/spree/backend/all.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
//= require spree/backend
1111

1212
//= require_tree .
13+
//= require spree/backend/spree_i18n

vendor/assets/javascripts/spree/frontend/all.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
//= require spree/frontend
1111

1212
//= require_tree .
13+
//= require spree/frontend/spree_i18n

0 commit comments

Comments
 (0)