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.
Files changed (101) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +35 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +17 -0
  5. data/.gitignore +4 -8
  6. data/.hound.yml +1 -1
  7. data/.rspec +2 -0
  8. data/.rubocop.yml +3 -6
  9. data/.rubocop_todo.yml +18 -0
  10. data/Gemfile +24 -6
  11. data/{LICENSE.md → LICENSE} +2 -2
  12. data/README.md +63 -29
  13. data/Rakefile +10 -73
  14. data/bin/console +17 -0
  15. data/bin/rails +12 -4
  16. data/bin/setup +8 -0
  17. data/config/locales/bg.yml +1 -47
  18. data/config/locales/ca.yml +12 -49
  19. data/config/locales/cs.yml +1 -48
  20. data/config/locales/da.yml +238 -139
  21. data/config/locales/de-CH.yml +0 -48
  22. data/config/locales/de.yml +476 -102
  23. data/config/locales/en-AU.yml +0 -48
  24. data/config/locales/en-GB.yml +1 -47
  25. data/config/locales/en-IN.yml +2 -48
  26. data/config/locales/en-NZ.yml +0 -48
  27. data/config/locales/es-CL.yml +1 -49
  28. data/config/locales/es-EC.yml +1 -47
  29. data/config/locales/es-MX.yml +417 -111
  30. data/config/locales/es.yml +1525 -797
  31. data/config/locales/et.yml +0 -50
  32. data/config/locales/fa.yml +0 -48
  33. data/config/locales/fi.yml +1 -47
  34. data/config/locales/fr.yml +677 -275
  35. data/config/locales/id.yml +2 -46
  36. data/config/locales/it.yml +1303 -445
  37. data/config/locales/ja.yml +598 -536
  38. data/config/locales/ko.yml +0 -48
  39. data/config/locales/lv.yml +0 -48
  40. data/config/locales/nb.yml +0 -48
  41. data/config/locales/nl.yml +1 -47
  42. data/config/locales/pl.yml +1 -47
  43. data/config/locales/pt-BR.yml +1101 -249
  44. data/config/locales/pt.yml +0 -48
  45. data/config/locales/ro.yml +3 -48
  46. data/config/locales/ru.yml +1884 -1237
  47. data/config/locales/sk.yml +722 -577
  48. data/config/locales/sl-SI.yml +0 -48
  49. data/config/locales/sv.yml +1 -47
  50. data/config/locales/th.yml +1 -45
  51. data/config/locales/tr.yml +1 -45
  52. data/config/locales/uk.yml +370 -381
  53. data/config/locales/vi.yml +1 -45
  54. data/config/locales/zh-CN.yml +1 -45
  55. data/config/locales/zh-TW.yml +1 -45
  56. data/config/routes.rb +2 -4
  57. data/i18n-tasks.yml +4 -0
  58. data/lib/generators/solidus_i18n/install/install_generator.rb +10 -13
  59. data/lib/solidus_i18n.rb +5 -6
  60. data/lib/solidus_i18n/engine.rb +9 -36
  61. data/lib/solidus_i18n/factories.rb +4 -0
  62. data/lib/solidus_i18n/version.rb +3 -16
  63. data/lib/tasks/solidus_i18n/upgrade.rake +13 -11
  64. data/solidus_i18n.gemspec +29 -39
  65. data/spec/solidus_i18n_spec.rb +67 -0
  66. data/spec/spec_helper.rb +15 -13
  67. metadata +231 -292
  68. data/.travis.yml +0 -12
  69. data/Guardfile +0 -11
  70. data/app/assets/javascripts/spree/backend/solidus_i18n.js +0 -2
  71. data/app/assets/javascripts/spree/backend/translations.js.coffee +0 -5
  72. data/app/assets/javascripts/spree/frontend/cart_decorator.js.coffee +0 -5
  73. data/app/assets/javascripts/spree/frontend/locale.js.coffee +0 -3
  74. data/app/assets/javascripts/spree/frontend/solidus_i18n.js +0 -2
  75. data/app/assets/stylesheets/spree/backend/solidus_i18n.css +0 -8
  76. data/app/assets/stylesheets/spree/frontend/solidus_i18n.css +0 -8
  77. data/app/controllers/spree/admin/general_settings_controller_decorator.rb +0 -12
  78. data/app/controllers/spree/api/base_controller_decorator.rb +0 -3
  79. data/app/controllers/spree/base_controller_decorator.rb +0 -3
  80. data/app/controllers/spree/locale_controller_decorator.rb +0 -6
  81. data/app/helpers/solidus_i18n/locale_helper.rb +0 -31
  82. data/app/overrides/spree/admin/general_settings/edit/localization_settings.html.erb.deface +0 -20
  83. data/app/overrides/spree/shared/_main_nav_bar/cart_link.html.erb.deface +0 -9
  84. data/app/overrides/spree/shared/_main_nav_bar/locale_selector.html.erb.deface +0 -16
  85. data/config/initializers/country_names.rb +0 -51
  86. data/config/initializers/routing_filter.rb +0 -2
  87. data/db/migrate/20150609154031_remove_translations_from_spree_tables.rb +0 -65
  88. data/lib/solidus_i18n/configuration.rb +0 -9
  89. data/lib/solidus_i18n/controller_locale_helper.rb +0 -29
  90. data/lib/solidus_i18n/locale.rb +0 -13
  91. data/lib/solidus_i18n/utils.rb +0 -56
  92. data/spec/controllers/locales_controller_spec.rb +0 -24
  93. data/spec/features/admin/translations_spec.rb +0 -33
  94. data/spec/features/russian_errors_translation_spec.rb +0 -17
  95. data/spec/features/translation_spec.rb +0 -31
  96. data/spec/features/translations_spec.rb +0 -28
  97. data/spec/support/capybara.rb +0 -11
  98. data/spec/support/database_cleaner.rb +0 -23
  99. data/spec/support/factory_girl.rb +0 -5
  100. data/spec/support/i18n.rb +0 -5
  101. 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
@@ -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
@@ -1,5 +0,0 @@
1
- require 'factory_girl'
2
-
3
- RSpec.configure do |config|
4
- config.include FactoryGirl::Syntax::Methods
5
- end
data/spec/support/i18n.rb DELETED
@@ -1,5 +0,0 @@
1
- RSpec.configure do |config|
2
- config.before do
3
- I18n.locale = I18n.default_locale
4
- end
5
- end
@@ -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