solidus_i18n 1.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +35 -0
- data/.gem_release.yml +5 -0
- data/.github/stale.yml +17 -0
- data/.gitignore +4 -8
- data/.hound.yml +1 -1
- data/.rspec +2 -0
- data/.rubocop.yml +3 -6
- data/.rubocop_todo.yml +18 -0
- data/Gemfile +24 -6
- data/{LICENSE.md → LICENSE} +2 -2
- data/README.md +63 -29
- data/Rakefile +10 -73
- data/bin/console +17 -0
- data/bin/rails +12 -4
- data/bin/setup +8 -0
- data/config/locales/bg.yml +1 -47
- data/config/locales/ca.yml +12 -49
- data/config/locales/cs.yml +1 -48
- data/config/locales/da.yml +238 -139
- data/config/locales/de-CH.yml +0 -48
- data/config/locales/de.yml +476 -102
- data/config/locales/en-AU.yml +0 -48
- data/config/locales/en-GB.yml +1 -47
- data/config/locales/en-IN.yml +2 -48
- data/config/locales/en-NZ.yml +0 -48
- data/config/locales/es-CL.yml +1 -49
- data/config/locales/es-EC.yml +1 -47
- data/config/locales/es-MX.yml +417 -111
- data/config/locales/es.yml +1525 -797
- data/config/locales/et.yml +0 -50
- data/config/locales/fa.yml +0 -48
- data/config/locales/fi.yml +1 -47
- data/config/locales/fr.yml +677 -275
- data/config/locales/id.yml +2 -46
- data/config/locales/it.yml +1303 -445
- data/config/locales/ja.yml +598 -536
- data/config/locales/ko.yml +0 -48
- data/config/locales/lv.yml +0 -48
- data/config/locales/nb.yml +0 -48
- data/config/locales/nl.yml +1 -47
- data/config/locales/pl.yml +1 -47
- data/config/locales/pt-BR.yml +1101 -249
- data/config/locales/pt.yml +0 -48
- data/config/locales/ro.yml +3 -48
- data/config/locales/ru.yml +1884 -1237
- data/config/locales/sk.yml +722 -577
- data/config/locales/sl-SI.yml +0 -48
- data/config/locales/sv.yml +1 -47
- data/config/locales/th.yml +1 -45
- data/config/locales/tr.yml +1 -45
- data/config/locales/uk.yml +370 -381
- data/config/locales/vi.yml +1 -45
- data/config/locales/zh-CN.yml +1 -45
- data/config/locales/zh-TW.yml +1 -45
- data/config/routes.rb +2 -4
- data/i18n-tasks.yml +4 -0
- data/lib/generators/solidus_i18n/install/install_generator.rb +10 -13
- data/lib/solidus_i18n.rb +5 -6
- data/lib/solidus_i18n/engine.rb +9 -36
- data/lib/solidus_i18n/factories.rb +4 -0
- data/lib/solidus_i18n/version.rb +3 -16
- data/lib/tasks/solidus_i18n/upgrade.rake +13 -11
- data/solidus_i18n.gemspec +29 -39
- data/spec/solidus_i18n_spec.rb +67 -0
- data/spec/spec_helper.rb +15 -13
- metadata +231 -292
- data/.travis.yml +0 -12
- data/Guardfile +0 -11
- data/app/assets/javascripts/spree/backend/solidus_i18n.js +0 -2
- data/app/assets/javascripts/spree/backend/translations.js.coffee +0 -5
- data/app/assets/javascripts/spree/frontend/cart_decorator.js.coffee +0 -5
- data/app/assets/javascripts/spree/frontend/locale.js.coffee +0 -3
- data/app/assets/javascripts/spree/frontend/solidus_i18n.js +0 -2
- data/app/assets/stylesheets/spree/backend/solidus_i18n.css +0 -8
- data/app/assets/stylesheets/spree/frontend/solidus_i18n.css +0 -8
- data/app/controllers/spree/admin/general_settings_controller_decorator.rb +0 -12
- data/app/controllers/spree/api/base_controller_decorator.rb +0 -3
- data/app/controllers/spree/base_controller_decorator.rb +0 -3
- data/app/controllers/spree/locale_controller_decorator.rb +0 -6
- data/app/helpers/solidus_i18n/locale_helper.rb +0 -31
- data/app/overrides/spree/admin/general_settings/edit/localization_settings.html.erb.deface +0 -20
- data/app/overrides/spree/shared/_main_nav_bar/cart_link.html.erb.deface +0 -9
- data/app/overrides/spree/shared/_main_nav_bar/locale_selector.html.erb.deface +0 -16
- data/config/initializers/country_names.rb +0 -51
- data/config/initializers/routing_filter.rb +0 -2
- data/db/migrate/20150609154031_remove_translations_from_spree_tables.rb +0 -65
- data/lib/solidus_i18n/configuration.rb +0 -9
- data/lib/solidus_i18n/controller_locale_helper.rb +0 -29
- data/lib/solidus_i18n/locale.rb +0 -13
- data/lib/solidus_i18n/utils.rb +0 -56
- data/spec/controllers/locales_controller_spec.rb +0 -24
- data/spec/features/admin/translations_spec.rb +0 -33
- data/spec/features/russian_errors_translation_spec.rb +0 -17
- data/spec/features/translation_spec.rb +0 -31
- data/spec/features/translations_spec.rb +0 -28
- data/spec/support/capybara.rb +0 -11
- data/spec/support/database_cleaner.rb +0 -23
- data/spec/support/factory_girl.rb +0 -5
- data/spec/support/i18n.rb +0 -5
- data/spec/support/spree.rb +0 -12
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.feature 'Translations', :js do
|
4
|
-
stub_authorization!
|
5
|
-
|
6
|
-
given!(:store) { create(:store) }
|
7
|
-
|
8
|
-
background do
|
9
|
-
reset_spree_preferences
|
10
|
-
end
|
11
|
-
|
12
|
-
context 'localization settings' do
|
13
|
-
given(:language) { Spree.t(:this_file_language, scope: 'i18n', locale: 'de') }
|
14
|
-
given(:french) { Spree.t(:this_file_language, scope: 'i18n', locale: 'fr') }
|
15
|
-
|
16
|
-
background do
|
17
|
-
SolidusI18n::Config.available_locales = []
|
18
|
-
visit spree.edit_admin_general_settings_path
|
19
|
-
end
|
20
|
-
|
21
|
-
scenario 'adds german to available locales' do
|
22
|
-
targetted_select2_search(language, from: '#s2id_available_locales_')
|
23
|
-
click_on 'Update'
|
24
|
-
expect(SolidusI18n::Config.available_locales).to include(:de)
|
25
|
-
end
|
26
|
-
|
27
|
-
scenario 'adds french to available locales' do
|
28
|
-
targetted_select2_search(french, from: '#s2id_available_locales_')
|
29
|
-
click_on 'Update'
|
30
|
-
expect(SolidusI18n::Config.available_locales).to include(:fr)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe 'Russian errors translations' do
|
5
|
-
def translation(count)
|
6
|
-
Spree.t(:errors_prohibited_this_record_from_being_saved, count: count)
|
7
|
-
end
|
8
|
-
|
9
|
-
context 'when current locale is Russian' do
|
10
|
-
it 'translation is available' do
|
11
|
-
I18n.locale = :ru
|
12
|
-
expect(translation(1)).to eq 'Одна ошибка не позволяет сохранить запись в базе'
|
13
|
-
expect(translation(3)).to eq '3 ошибки не позволяют сохранить запись в базе'
|
14
|
-
expect(translation(10)).to eq '10 ошибок не позволяют сохранить запись в базе'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe 'Translation' do
|
5
|
-
def translation
|
6
|
-
I18n.t('activerecord.attributes.spree/address.zipcode')
|
7
|
-
end
|
8
|
-
|
9
|
-
context 'when current locale is en' do
|
10
|
-
it 'translation is available' do
|
11
|
-
I18n.locale = :en
|
12
|
-
expect(translation).to eq 'Zip Code'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
# German is chosen as an example of language whose translations are found in a file.
|
17
|
-
context 'when current locale is German' do
|
18
|
-
it 'translation is available' do
|
19
|
-
I18n.locale = :de
|
20
|
-
expect(translation).to eq 'PLZ'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# Chilean spanish is chosen
|
25
|
-
context 'when current locale is Chilean Spanish' do
|
26
|
-
it 'translation is available' do
|
27
|
-
I18n.locale = :'es-CL'
|
28
|
-
expect(translation).to eq 'Código Postal'
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.feature 'Translations', :js do
|
5
|
-
given(:language) { Spree.t(:this_file_language, scope: 'i18n', locale: 'pt-BR') }
|
6
|
-
|
7
|
-
background do
|
8
|
-
reset_spree_preferences
|
9
|
-
SolidusI18n::Config.available_locales = [:en, :'pt-BR']
|
10
|
-
end
|
11
|
-
|
12
|
-
context 'page' do
|
13
|
-
context 'switches locale from the dropdown' do
|
14
|
-
before do
|
15
|
-
visit spree.root_path
|
16
|
-
select(language, from: Spree.t(:language, scope: 'i18n'))
|
17
|
-
end
|
18
|
-
|
19
|
-
scenario 'selected translation is applied' do
|
20
|
-
expect(page).to have_content(/#{Spree.t(:home, locale: 'pt-BR')}/i)
|
21
|
-
end
|
22
|
-
|
23
|
-
scenario 'JS cart link is translated' do
|
24
|
-
expect(page).to have_content(/#{Spree.t(:cart, locale: 'pt-BR')}/i)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
data/spec/support/capybara.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'capybara/rspec'
|
2
|
-
require 'capybara/rails'
|
3
|
-
require 'capybara/poltergeist'
|
4
|
-
|
5
|
-
RSpec.configure do
|
6
|
-
Capybara.javascript_driver = :poltergeist
|
7
|
-
|
8
|
-
Capybara.register_driver(:poltergeist) do |app|
|
9
|
-
Capybara::Poltergeist::Driver.new app, timeout: 90
|
10
|
-
end
|
11
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'database_cleaner'
|
2
|
-
|
3
|
-
RSpec.configure do |config|
|
4
|
-
config.before(:suite) do
|
5
|
-
DatabaseCleaner.clean_with :truncation
|
6
|
-
end
|
7
|
-
|
8
|
-
config.before do
|
9
|
-
DatabaseCleaner.strategy = :transaction
|
10
|
-
end
|
11
|
-
|
12
|
-
config.before(:each, :js) do
|
13
|
-
DatabaseCleaner.strategy = :truncation
|
14
|
-
end
|
15
|
-
|
16
|
-
config.before do
|
17
|
-
DatabaseCleaner.start
|
18
|
-
end
|
19
|
-
|
20
|
-
config.after do
|
21
|
-
DatabaseCleaner.clean
|
22
|
-
end
|
23
|
-
end
|
data/spec/support/i18n.rb
DELETED
data/spec/support/spree.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spree/testing_support/factories'
|
2
|
-
require 'spree/testing_support/preferences'
|
3
|
-
require 'spree/testing_support/url_helpers'
|
4
|
-
require 'spree/testing_support/capybara_ext'
|
5
|
-
require 'spree/testing_support/controller_requests'
|
6
|
-
require 'spree/testing_support/authorization_helpers'
|
7
|
-
|
8
|
-
RSpec.configure do |config|
|
9
|
-
config.include Spree::TestingSupport::UrlHelpers
|
10
|
-
config.include Spree::TestingSupport::Preferences
|
11
|
-
config.include Spree::TestingSupport::ControllerRequests, type: :controller
|
12
|
-
end
|