solidus_i18n 1.2.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +4 -4
  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 +20 -10
  11. data/{LICENSE.md → LICENSE} +2 -2
  12. data/README.md +47 -46
  13. data/Rakefile +8 -24
  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 +1 -47
  21. data/config/locales/de-CH.yml +0 -48
  22. data/config/locales/de.yml +408 -257
  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 +7 -53
  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 +27 -63
  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 +660 -264
  35. data/config/locales/id.yml +2 -46
  36. data/config/locales/it.yml +1196 -646
  37. data/config/locales/ja.yml +7 -53
  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 +1093 -251
  44. data/config/locales/pt.yml +0 -48
  45. data/config/locales/ro.yml +3 -48
  46. data/config/locales/ru.yml +1884 -1240
  47. data/config/locales/sk.yml +1 -45
  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 +1 -49
  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 -8
  57. data/i18n-tasks.yml +4 -0
  58. data/lib/generators/solidus_i18n/install/install_generator.rb +10 -13
  59. data/lib/solidus_i18n/engine.rb +9 -36
  60. data/lib/solidus_i18n/factories.rb +4 -0
  61. data/lib/solidus_i18n/version.rb +3 -16
  62. data/lib/solidus_i18n.rb +4 -5
  63. data/lib/tasks/solidus_i18n/upgrade.rake +13 -11
  64. data/solidus_i18n.gemspec +29 -37
  65. data/spec/dummy/README.md +24 -0
  66. data/spec/dummy/Rakefile +6 -0
  67. data/spec/dummy/app/assets/config/manifest.js +2 -0
  68. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  69. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  70. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  71. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  72. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  73. data/spec/dummy/app/jobs/application_job.rb +7 -0
  74. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  75. data/spec/dummy/app/models/application_record.rb +3 -0
  76. data/spec/dummy/app/views/layouts/application.html.erb +15 -0
  77. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  78. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  79. data/spec/dummy/bin/rails +4 -0
  80. data/spec/dummy/bin/rake +4 -0
  81. data/spec/dummy/bin/setup +33 -0
  82. data/spec/dummy/config/application.rb +53 -0
  83. data/spec/dummy/config/boot.rb +6 -0
  84. data/spec/dummy/config/cable.yml +10 -0
  85. data/spec/dummy/config/credentials.yml.enc +1 -0
  86. data/spec/dummy/config/database.yml +12 -0
  87. data/spec/dummy/config/environment.rb +5 -0
  88. data/spec/dummy/config/environments/development.rb +76 -0
  89. data/spec/dummy/config/environments/production.rb +120 -0
  90. data/spec/dummy/config/environments/test.rb +36 -0
  91. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  92. data/spec/dummy/config/initializers/assets.rb +12 -0
  93. data/spec/dummy/config/initializers/backtrace_silencers.rb +8 -0
  94. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  95. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  96. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
  97. data/spec/dummy/config/initializers/inflections.rb +16 -0
  98. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  99. data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
  100. data/spec/dummy/config/initializers/spree.rb +74 -0
  101. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  102. data/spec/dummy/config/locales/en.yml +33 -0
  103. data/spec/dummy/config/master.key +1 -0
  104. data/spec/dummy/config/routes.rb +9 -0
  105. data/spec/dummy/config/storage.yml +34 -0
  106. data/spec/dummy/config.ru +6 -0
  107. data/spec/dummy/db/migrate/20210218213814_create_active_storage_tables.active_storage.rb +36 -0
  108. data/spec/dummy/db/migrate/20210218213818_create_action_mailbox_tables.action_mailbox.rb +14 -0
  109. data/spec/dummy/db/migrate/20210218213819_create_action_text_tables.action_text.rb +14 -0
  110. data/spec/dummy/db/migrate/20210218213820_solidus_one_four.spree.rb +1103 -0
  111. data/spec/dummy/db/migrate/20210218213821_create_spree_wallet_payment_sources.spree.rb +28 -0
  112. data/spec/dummy/db/migrate/20210218213822_migrate_credit_cards_to_wallet_payment_sources.spree.rb +30 -0
  113. data/spec/dummy/db/migrate/20210218213823_remove_is_default_from_prices.spree.rb +8 -0
  114. data/spec/dummy/db/migrate/20210218213824_remove_currency_from_line_items.spree.rb +8 -0
  115. data/spec/dummy/db/migrate/20210218213825_add_available_to_columns_and_remove_display_on_from_payment_methods.spree.rb +31 -0
  116. data/spec/dummy/db/migrate/20210218213826_create_spree_promotion_code_batch.spree.rb +39 -0
  117. data/spec/dummy/db/migrate/20210218213827_add_available_to_users_and_remove_display_on_from_shipping_methods.spree.rb +23 -0
  118. data/spec/dummy/db/migrate/20210218213828_add_index_to_spree_payments_number.spree.rb +8 -0
  119. data/spec/dummy/db/migrate/20210218213829_remove_spree_store_credits_column.spree.rb +8 -0
  120. data/spec/dummy/db/migrate/20210218213830_add_lft_and_rgt_indexes_to_taxons.spree.rb +9 -0
  121. data/spec/dummy/db/migrate/20210218213831_remove_order_id_from_inventory_units.spree.rb +31 -0
  122. data/spec/dummy/db/migrate/20210218213832_transform_tax_rate_category_relation.spree.rb +51 -0
  123. data/spec/dummy/db/migrate/20210218213833_add_roles_unique_constraints.spree.rb +9 -0
  124. data/spec/dummy/db/migrate/20210218213834_add_time_range_to_tax_rate.spree.rb +9 -0
  125. data/spec/dummy/db/migrate/20210218213835_rename_bogus_gateways.spree.rb +19 -0
  126. data/spec/dummy/db/migrate/20210218213836_remove_default_tax_from_spree_zones.spree.rb +8 -0
  127. data/spec/dummy/db/migrate/20210218213837_create_promotion_rule_stores.spree.rb +13 -0
  128. data/spec/dummy/db/migrate/20210218213838_create_store_shipping_methods.spree.rb +13 -0
  129. data/spec/dummy/db/migrate/20210218213839_add_available_locales_to_stores.spree.rb +10 -0
  130. data/spec/dummy/db/migrate/20210218213840_add_amount_remaining_to_store_credit_events.spree.rb +62 -0
  131. data/spec/dummy/db/migrate/20210218213841_add_join_characters_to_promotion_code_batch.spree.rb +12 -0
  132. data/spec/dummy/db/migrate/20210218213842_add_apply_to_all_to_variant_property_rule.spree.rb +13 -0
  133. data/spec/dummy/db/migrate/20210218213843_create_spree_store_credit_reasons_table.spree.rb +56 -0
  134. data/spec/dummy/db/migrate/20210218213844_remove_code_from_spree_promotions.spree.rb +43 -0
  135. data/spec/dummy/db/migrate/20210218213845_drop_spree_store_credit_update_reasons.spree.rb +20 -0
  136. data/spec/dummy/db/migrate/20210218213846_add_default_billng_flag_to_user_addresses.spree.rb +7 -0
  137. data/spec/dummy/db/migrate/20210218213847_add_bcc_email_to_spree_stores.spree.rb +8 -0
  138. data/spec/dummy/db/migrate/20210218213848_add_discontinue_on_to_spree_products.spree.rb +8 -0
  139. data/spec/dummy/db/migrate/20210218213849_add_name_to_spree_addresses.spree.rb +14 -0
  140. data/spec/dummy/db/migrate/20210218213850_add_api_key_to_spree_users.spree_api.rb +10 -0
  141. data/spec/dummy/db/migrate/20210218213851_resize_api_key_field.spree_api.rb +10 -0
  142. data/spec/dummy/db/migrate/20210218213852_rename_api_key_to_spree_api_key.spree_api.rb +10 -0
  143. data/spec/dummy/db/migrate/20210218213853_add_index_to_user_spree_api_key.spree_api.rb +10 -0
  144. data/spec/dummy/db/schema.rb +1215 -0
  145. data/spec/dummy/db/seeds.rb +10 -0
  146. data/spec/dummy/db/solidus_test.sqlite3 +0 -0
  147. data/spec/dummy/log/test.log +1198 -0
  148. data/spec/dummy/public/404.html +67 -0
  149. data/spec/dummy/public/422.html +67 -0
  150. data/spec/dummy/public/500.html +66 -0
  151. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  152. data/spec/dummy/public/apple-touch-icon.png +0 -0
  153. data/spec/dummy/public/favicon.ico +0 -0
  154. data/spec/dummy/tmp/development_secret.txt +1 -0
  155. data/spec/dummy/vendor/assets/javascripts/spree/backend/all.js +10 -0
  156. data/spec/dummy/vendor/assets/javascripts/spree/frontend/all.js +10 -0
  157. data/{app/assets/stylesheets/spree/backend/solidus_i18n.css → spec/dummy/vendor/assets/stylesheets/spree/backend/all.css} +1 -0
  158. data/{app/assets/stylesheets/spree/frontend/solidus_i18n.css → spec/dummy/vendor/assets/stylesheets/spree/frontend/all.css} +1 -0
  159. data/spec/examples.txt +4 -0
  160. data/spec/solidus_i18n_spec.rb +67 -0
  161. data/spec/spec_helper.rb +15 -13
  162. metadata +222 -264
  163. data/.travis.yml +0 -30
  164. data/app/assets/javascripts/spree/backend/solidus_i18n.js +0 -2
  165. data/app/assets/javascripts/spree/backend/translations.js.coffee +0 -5
  166. data/app/assets/javascripts/spree/frontend/locale.js.coffee +0 -3
  167. data/app/assets/javascripts/spree/frontend/solidus_i18n.js +0 -2
  168. data/app/controllers/spree/admin/locales_controller.rb +0 -16
  169. data/app/controllers/spree/api/base_controller_decorator.rb +0 -3
  170. data/app/controllers/spree/base_controller_decorator.rb +0 -3
  171. data/app/controllers/spree/locale_controller_decorator.rb +0 -6
  172. data/app/helpers/solidus_i18n/locale_helper.rb +0 -31
  173. data/app/overrides/spree/admin/shared/_configuration_menu/add_i18n_tab.html.erb.deface +0 -2
  174. data/app/overrides/spree/shared/_main_nav_bar/locale_selector.html.erb.deface +0 -16
  175. data/app/views/spree/admin/locales/show.html.erb +0 -27
  176. data/config/initializers/country_names.rb +0 -51
  177. data/config/initializers/routing_filter.rb +0 -2
  178. data/db/migrate/20150609154031_remove_translations_from_spree_tables.rb +0 -65
  179. data/lib/solidus_i18n/configuration.rb +0 -9
  180. data/lib/solidus_i18n/controller_locale_helper.rb +0 -29
  181. data/lib/solidus_i18n/locale.rb +0 -13
  182. data/spec/controllers/locales_controller_spec.rb +0 -24
  183. data/spec/features/admin/translations_spec.rb +0 -34
  184. data/spec/features/russian_errors_translation_spec.rb +0 -17
  185. data/spec/features/translation_spec.rb +0 -31
  186. data/spec/features/translations_spec.rb +0 -28
  187. data/spec/support/capybara.rb +0 -11
  188. data/spec/support/database_cleaner.rb +0 -23
  189. data/spec/support/factory_girl.rb +0 -5
  190. data/spec/support/i18n.rb +0 -5
  191. data/spec/support/spree.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfb020944a1343dc92cbd2b35fa80043d6b2055ff55806192f7c8b2529142bcb
4
- data.tar.gz: a68b7f59d0c89f5795d22cff8224d7f40c97007aecbd2ef4989d1aa4cea7afab
3
+ metadata.gz: e81407d27ac8d4d865c858353136816de626274eb4b0ceaf1feababdd89dae18
4
+ data.tar.gz: a4a36c750eb435adaf4be6af1f8cd248c5f4a2658e9eea03d06dd942abdc71a4
5
5
  SHA512:
6
- metadata.gz: 6cb6719bec0ffba480b8a39d5cf6822bf773bd7c87ad8fe1180ae09ea69053594c72171b47a1abca4bb3b9680543b1178f7bf8ec7e4247291c7ac37135f07a20
7
- data.tar.gz: 7a42835eacaf1139b3394b0b1196bcb3cfcf0ca81029eb4e626b6f823bfa706e1b88c6eef14dea57ab89479c07baf57aba58dce8f5f30b8dda573ded08019c19
6
+ metadata.gz: 4dd88e9176dfa9d5a0b880c327796635282ce844183f57591aa587c3461a2e4becafa792a93a6ee036e8fb5c88aa3542ca72576169a9969e84f481099ab64dfd
7
+ data.tar.gz: 4c23b55f2cf650a14d3d26988bdb82e0f24bda27f858ceba812b2e0ff9c8482eccaeaf5082f06a3093f13eab1bdee536f7fda82710fa5f7daa60b271089e86b2
@@ -0,0 +1,35 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ # Always take the latest version of the orb, this allows us to
5
+ # run specs against Solidus supported versions only without the need
6
+ # to change this configuration every time a Solidus version is released
7
+ # or goes EOL.
8
+ solidusio_extensions: solidusio/extensions@volatile
9
+
10
+ jobs:
11
+ run-specs-with-postgres:
12
+ executor: solidusio_extensions/postgres
13
+ steps:
14
+ - solidusio_extensions/run-tests
15
+ run-specs-with-mysql:
16
+ executor: solidusio_extensions/mysql
17
+ steps:
18
+ - solidusio_extensions/run-tests
19
+
20
+ workflows:
21
+ "Run specs on supported Solidus versions":
22
+ jobs:
23
+ - run-specs-with-postgres
24
+ - run-specs-with-mysql
25
+ "Weekly run specs against master":
26
+ triggers:
27
+ - schedule:
28
+ cron: "0 0 * * 4" # every Thursday
29
+ filters:
30
+ branches:
31
+ only:
32
+ - master
33
+ jobs:
34
+ - run-specs-with-postgres
35
+ - run-specs-with-mysql
data/.gem_release.yml ADDED
@@ -0,0 +1,5 @@
1
+ bump:
2
+ recurse: false
3
+ file: 'lib/solidus_i18n/version.rb'
4
+ message: Bump SolidusI18n to %{version}
5
+ tag: true
data/.github/stale.yml ADDED
@@ -0,0 +1,17 @@
1
+ # Number of days of inactivity before an issue becomes stale
2
+ daysUntilStale: 60
3
+ # Number of days of inactivity before a stale issue is closed
4
+ daysUntilClose: 7
5
+ # Issues with these labels will never be considered stale
6
+ exemptLabels:
7
+ - pinned
8
+ - security
9
+ # Label to use when marking an issue as stale
10
+ staleLabel: wontfix
11
+ # Comment to post when marking an issue as stale. Set to `false` to disable
12
+ markComment: >
13
+ This issue has been automatically marked as stale because it has not had
14
+ recent activity. It will be closed if no further activity occurs. Thank you
15
+ for your contributions.
16
+ # Comment to post when closing a stale issue. Set to `false` to disable
17
+ closeComment: false
data/.gitignore CHANGED
@@ -1,20 +1,16 @@
1
+ *.gem
1
2
  \#*
2
3
  *~
3
4
  .#*
4
5
  .DS_Store
5
6
  .idea
6
- .localeapp/locales
7
7
  .project
8
+ .sass-cache
8
9
  coverage
9
- config/locales/en.yml
10
10
  Gemfile.lock
11
11
  tmp
12
12
  nbproject
13
13
  pkg
14
- *.sw?
14
+ *.swp
15
15
  spec/dummy
16
- .rvmrc
17
- .sass-cache
18
- public/spree
19
- .ruby-version
20
- .ruby-gemset
16
+ spec/examples.txt
data/.hound.yml CHANGED
@@ -8,7 +8,7 @@ Style/Documentation:
8
8
  Enabled: false
9
9
 
10
10
  # Neatly aligned code is too swell.
11
- Style/SingleSpaceBeforeFirstArg:
11
+ Layout/SpaceBeforeFirstArg:
12
12
  Enabled: false
13
13
 
14
14
  # Don't mess with RSpec DSL.
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml CHANGED
@@ -1,7 +1,4 @@
1
- ---
2
- inherit_from: .hound.yml
1
+ require:
2
+ - solidus_dev_support/rubocop
3
3
 
4
- AllCops:
5
- Exclude:
6
- - spec/dummy/**/*
7
- - bin/*
4
+ inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,18 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-01-24 11:23:54 +0100 using RuboCop version 0.76.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ RSpec/DescribeClass:
11
+ Exclude:
12
+ - 'spec/solidus_i18n_spec.rb'
13
+
14
+ # Offense count: 2
15
+ # Configuration parameters: IgnoreSharedExamples.
16
+ RSpec/NamedSubject:
17
+ Exclude:
18
+ - 'spec/solidus_i18n_spec.rb'
data/Gemfile CHANGED
@@ -1,21 +1,31 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
2
5
 
3
6
  branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
4
- gem "solidus", github: "solidusio/solidus", branch: branch
7
+ gem 'solidus', github: 'solidusio/solidus', branch: branch
8
+
9
+ # Needed to help Bundler figure out how to resolve dependencies,
10
+ # otherwise it takes forever to resolve them.
11
+ # See https://github.com/bundler/bundler/issues/6677
12
+ gem 'rails', '>0.a'
5
13
 
6
- if branch == 'master' || branch >= "v2.0"
7
- gem "rails-controller-testing", group: :test
14
+ case ENV['DB']
15
+ when 'mysql'
16
+ gem 'mysql2'
17
+ when 'postgresql'
18
+ gem 'pg'
8
19
  else
9
- gem "rails_test_params_backport", group: :test
20
+ gem 'sqlite3'
10
21
  end
11
22
 
12
- gem 'pg', '~> 0.21'
13
- gem 'sqlite3'
14
- gem 'mysql2'
15
-
16
23
  group :development, :test do
17
- gem "pry-rails"
18
24
  gem 'i18n-tasks', '~> 0.9' if branch == 'master'
19
25
  end
20
26
 
21
27
  gemspec
28
+
29
+ # Use a local Gemfile to include development dependencies that might not be
30
+ # relevant for the project or for other contributors, e.g.: `gem 'pry-debug'`.
31
+ eval_gemfile 'Gemfile-local' if File.exist? 'Gemfile-local'
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2015 Spree Commerce Inc., and other contributors.
1
+ Copyright (c) 2011-2015 Spree Commerce Inc. and other contributors
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -9,7 +9,7 @@ are permitted provided that the following conditions are met:
9
9
  * Redistributions in binary form must reproduce the above copyright notice,
10
10
  this list of conditions and the following disclaimer in the documentation
11
11
  and/or other materials provided with the distribution.
12
- * Neither the name Spree nor the names of its contributors may be used to
12
+ * Neither the name Solidus nor the names of its contributors may be used to
13
13
  endorse or promote products derived from this software without specific
14
14
  prior written permission.
15
15
 
data/README.md CHANGED
@@ -1,61 +1,66 @@
1
1
  # Solidus Internationalization
2
2
 
3
- [![Build Status](https://travis-ci.org/solidusio-contrib/solidus_i18n.svg?branch=master)](https://travis-ci.org/solidusio-contrib/solidus_i18n)
4
- [![Code Climate](https://codeclimate.com/github/solidusio-contrib/solidus_i18n/badges/gpa.svg)](https://codeclimate.com/github/solidusio-contrib/solidus_i18n)
3
+ [![CircleCI](https://circleci.com/gh/solidusio/solidus_i18n.svg?style=svg)](https://circleci.com/gh/solidusio/solidus_i18n)
4
+ [![Code Climate](https://codeclimate.com/github/solidusio/solidus_i18n/badges/gpa.svg)](https://codeclimate.com/github/solidusio/solidus_i18n)
5
5
  [![Gem Version](https://badge.fury.io/rb/solidus_i18n.svg)](https://badge.fury.io/rb/solidus_i18n)
6
6
 
7
7
  This is the Internationalization project for [Solidus](https://solidus.io)
8
8
 
9
9
  ---
10
10
 
11
- ## Supported languages
11
+ ## Changes in Version 2.0
12
12
 
13
- We currently support the [following locales](https://github.com/solidusio-contrib/solidus_i18n/tree/master/config/locales)
14
- by default. If you need a locale that is not in the list you can add a custom
15
- translation file into your application by following the
16
- [Rails translations guide](http://guides.rubyonrails.org/i18n.html#how-to-store-your-custom-translations).
13
+ solidus_i18n Version 2.0+ only contains translation files.
14
+
15
+ Previous versions of solidus_i18n included extra functionality like locale
16
+ selectors and which is now built in to Solidus 2.6+. Configuration for
17
+ `routing-filter` has also been removed and must be configured manually
18
+ (See [Locale in URL](#locale-in-url)).
17
19
 
18
20
  ## Installation
19
21
 
20
22
  Add the following to your `Gemfile`:
21
23
 
22
24
  ```ruby
23
- gem 'solidus_i18n', github: 'solidusio-contrib/solidus_i18n', branch: 'master'
25
+ gem 'solidus_i18n', '~> 2.0'
26
+ gem 'rails-i18n', '~> 5.1'
27
+ gem 'kaminari-i18n', '~> 0.5.0'
24
28
  ```
25
29
 
26
- Run `bundle install`
27
-
28
- You can use the generator to install migrations and append solidus_i18n assets to
29
- your app solidus manifest file.
30
-
31
- bin/rails g solidus_i18n:install
30
+ ## Locale in URL
32
31
 
33
- This will insert these lines into your Spree assets manifests:
32
+ Older versions of solidus_i18n included the routing-filter gem and configured routes to include the locale in the URL.
33
+ This is still supported (maybe even recommended) but requires some additional configuration.
34
34
 
35
- In `vendor/assets/javascripts/spree/frontend/all.js`
35
+ 1. Add this gem to your `Gemfile`, then run `bundle install`
36
36
 
37
- ```
38
- //= require spree/frontend/solidus_i18n
37
+ ``` ruby
38
+ gem 'routing-filter', '~> 0.6.0'
39
39
  ```
40
40
 
41
- In `vendor/assets/javascripts/spree/backend/all.js`
41
+ 2. Add `filter :locale` to your `config/routes.rb`
42
42
 
43
- ```
44
- //= require spree/backend/solidus_i18n
45
- ```
43
+ ``` ruby
44
+ Rails.application.routes.draw do
45
+ filter :locale
46
46
 
47
- ## Set default locale
47
+ mount Spree::Core::Engine, at: '/'
48
+ end
49
+ ```
48
50
 
49
- In `config/initializers/spree.rb` you will find the default locale settings
50
- for both frontend and backend. Just replace `'en'` with your default locale
51
- code.
51
+ 3. Configure routing-fitler in `config/initializers/locale_filter.rb` (optional)
52
52
 
53
- ## Add more languages to the frontend locale toggle
53
+ ``` ruby
54
+ # Do not include the default locale in the URL
55
+ RoutingFilter::Locale.include_default_locale = false
56
+ ```
54
57
 
55
- Go to Admin -> General Settings -> Localization Setting and add the locales
56
- you want your users to be able to select from the locale toggle on the frontend.
58
+ ## Supported languages
57
59
 
58
- ---
60
+ We currently support the [following locales](https://github.com/solidusio/solidus_i18n/tree/master/config/locales)
61
+ by default. If you need a locale that is not in the list you can add a custom
62
+ translation file into your application by following the
63
+ [Rails translations guide](http://guides.rubyonrails.org/i18n.html#how-to-store-your-custom-translations).
59
64
 
60
65
  ## Updating Translations
61
66
 
@@ -69,8 +74,6 @@ Substitute <LOCALE> with your locale code (e.g: `it`).
69
74
  This will do a cleanup and prepare `<LOCALE>.yml` with all the missing keys.
70
75
  You can then write the translations and open a pull request.
71
76
 
72
- ---
73
-
74
77
  ## Model Translations
75
78
 
76
79
  We **removed** support for translating models into [a separate Gem](https://github.com/solidusio-contrib/solidus_globalize).
@@ -82,23 +85,21 @@ Please update your `Gemfile` if you still need the model translations.
82
85
  gem 'solidus_globalize', github: 'solidusio-contrib/solidus_globalize', branch: 'master'
83
86
  ```
84
87
 
85
- ---
88
+ ## Localizing country names
86
89
 
87
- ## Upgrading
90
+ You can translate country names by defining `spree.country_names` in your own locale files. For example, to have countries in Spanish do:
88
91
 
89
- **WARNING**: If you want to keep your model translations, be sure to add the `solidus_globalize` gem to your `Gemfile` **before** migrating the database. Otherwise **you will loose your translations**!
90
-
91
- ### 1. Migrate your database
92
-
93
- bin/rake solidus_i18n:upgrade
94
- bin/rake db:migrate
95
-
96
- *Note:* The migration automatically skips the removal of the translations tables. So it's safe to run the migration without data loss. But be sure to have the `solidus_globalize` gem in your `Gemfile`, if you want to keep them.
97
-
98
- ### 2. Remove Configuration
99
-
100
- Remove all occurrences of `SolidusI18n::Config.supported_locales` from your code.
92
+ ```yml
93
+ es:
94
+ spree:
95
+ country_names:
96
+ US: Estados Unidos de América
97
+ UK: Reino Unido
98
+ CA: Canadá
99
+ # ...
100
+ ```
101
101
 
102
+ Some supported languages already define localized country names. Take a look at this repo's `.yml` files for your locale to confirm if we already provide translations.
102
103
 
103
104
  Contributing
104
105
  ------------
data/Rakefile CHANGED
@@ -1,38 +1,22 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
1
+ # frozen_string_literal: true
3
2
 
4
- require 'rspec/core/rake_task'
5
- RSpec::Core::RakeTask.new
6
-
7
- task :default do
8
- if Dir["spec/dummy"].empty?
9
- Rake::Task[:test_app].invoke
10
- Dir.chdir("../../")
11
- end
12
- Rake::Task[:spec].invoke
13
- end
14
-
15
- require 'spree/testing_support/common_rake'
16
- desc 'Generates a dummy app for testing'
17
- task :test_app do
18
- ENV['LIB_NAME'] = 'solidus_i18n'
19
- Rake::Task['common:test_app'].invoke
20
- end
3
+ require 'solidus_dev_support/rake_tasks'
4
+ SolidusDevSupport::RakeTasks.install
21
5
 
22
6
  require 'solidus_i18n'
23
7
  namespace :solidus_i18n do
24
8
  desc 'Update by retrieving the latest Solidus locale files'
25
- task :update_default do
9
+ task update_default: :environment do
26
10
  require 'open-uri'
27
- puts "Fetching latest Solidus locale file"
11
+ puts 'Fetching latest Solidus locale file'
28
12
  location = 'https://raw.github.com/solidusio/solidus/master/core/config/locales/en.yml'
29
13
 
30
- open("#{locales_dir}/en.yml", 'wb') do |file|
31
- file << open(location).read
32
- end
14
+ File.write("#{locales_dir}/en.yml", URI.parse(location).read)
33
15
  end
34
16
 
35
17
  def locales_dir
36
18
  File.join File.dirname(__FILE__), 'config/locales'
37
19
  end
38
20
  end
21
+
22
+ task default: 'extension:specs'
data/bin/console ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require "bundler/setup"
6
+ require "solidus_i18n"
7
+
8
+ # You can add fixtures and/or initialization code here to make experimenting
9
+ # with your gem easier. You can also use a different console, if you like.
10
+ $LOAD_PATH.unshift(*Dir["#{__dir__}/../app/*"])
11
+
12
+ # (If you use this, don't forget to add pry to your Gemfile!)
13
+ # require "pry"
14
+ # Pry.start
15
+
16
+ require "irb"
17
+ IRB.start(__FILE__)
data/bin/rails CHANGED
@@ -1,7 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
4
- ENGINE_PATH = File.expand_path('../../lib/solidus_i18n/engine', __FILE__)
3
+ # frozen_string_literal: true
5
4
 
6
- require 'rails/all'
7
- require 'rails/engine/commands'
5
+ app_root = 'spec/dummy'
6
+
7
+ unless File.exist? "#{app_root}/bin/rails"
8
+ system "bin/rake", app_root or begin # rubocop:disable Style/AndOr
9
+ warn "Automatic creation of the dummy app failed"
10
+ exit 1
11
+ end
12
+ end
13
+
14
+ Dir.chdir app_root
15
+ exec 'bin/rails', *ARGV
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ gem install bundler --conservative
7
+ bundle update
8
+ bundle exec rake clobber
@@ -275,52 +275,6 @@ bg:
275
275
  spree/zone:
276
276
  one: Zone Зона
277
277
  other: "Зони"
278
- devise:
279
- confirmations:
280
- confirmed: "Вашият акаунт е потвърден. Вече сте вписан."
281
- send_instructions: "До няколко минути ще получите съобщение с обяснение как да потвърдите своя акаунт."
282
- failure:
283
- inactive: "Вашият акаунт все още не е активен."
284
- invalid: "Грешен имейл или парола"
285
- invalid_token: Invalid authentication token.
286
- locked: "Вашият акаунт е заключен."
287
- timeout: "Вашата сесия е изтекла, моля влезте повторно."
288
- unauthenticated: "Трябва да се впишете или регистрирате преди да продължите"
289
- unconfirmed: "Трябва да потвърдите акаунта си преди да продължите."
290
- mailer:
291
- confirmation_instructions:
292
- subject: "Инструкции за потвърждаване"
293
- reset_password_instructions:
294
- subject: Reset password instructions Инструкции за смяна на паролата
295
- unlock_instructions:
296
- subject: "Инструкции за отключване"
297
- oauth_callbacks:
298
- failure: Could not authorise you from %{kind} because %{reason}.
299
- success: Successfully authorised from %{kind} account.
300
- unlocks:
301
- send_instructions: "До няколко минути ще получите имейл с инструкции как да отключите своя акаунт."
302
- unlocked: "Вашият акаунт бе отключен успешно. Вече сте вписани."
303
- user_passwords:
304
- user:
305
- cannot_be_blank: "Вашата парола не може бъде празна"
306
- send_instructions: "До няколко минути ще получите имейл с инструкции как да промените паролата си."
307
- updated: "Вашата парола бе променена успешко. Вече сте вписани."
308
- user_registrations:
309
- destroyed: "Вашият акаунт бе отменен успешно. Надяваме се да ви видим скоро."
310
- inactive_signed_up: You have signed up successfully. However, we could not sign you in because your account is %{reason}.
311
- signed_up: "Вие се регистрирахте успешно."
312
- updated: "Успешно обновихте своя акаунт."
313
- user_sessions:
314
- signed_in: "Успешно влизане"
315
- signed_out: "Успешно излизане"
316
- errors:
317
- messages:
318
- already_confirmed: "Вече бе потвърден"
319
- not_found: "не намерен"
320
- not_locked: "не бе заключен"
321
- not_saved:
322
- one: "Една грешка предоотврати запазването на %{resource}"
323
- other: "%{count} грешки предоотвратиха запазването на %{resource}"
324
278
  spree:
325
279
  abbreviation: "Абривиатура"
326
280
  accept:
@@ -561,7 +515,7 @@ bg:
561
515
  date_picker:
562
516
  first_day: 0
563
517
  format: "%Y/%m/%d"
564
- js_format: yy/mm/dd
518
+ js_format: Y/m/d
565
519
  date_range:
566
520
  default:
567
521
  default_refund_amount:
@@ -281,50 +281,6 @@ ca:
281
281
  spree/zone:
282
282
  one: Zona
283
283
  other:
284
- devise:
285
- confirmations:
286
- confirmed:
287
- send_instructions:
288
- failure:
289
- inactive: El seu compte no s'ha estat activat encara.
290
- invalid: Correu electrònic o contrasenya no vàlids.
291
- invalid_token: Token d'autenticació no vàlid.
292
- locked: El seu compte està bloquejat.
293
- timeout:
294
- unauthenticated:
295
- unconfirmed:
296
- mailer:
297
- confirmation_instructions:
298
- subject:
299
- reset_password_instructions:
300
- subject:
301
- unlock_instructions:
302
- subject:
303
- oauth_callbacks:
304
- failure:
305
- success:
306
- unlocks:
307
- send_instructions:
308
- unlocked:
309
- user_passwords:
310
- user:
311
- cannot_be_blank:
312
- send_instructions:
313
- updated:
314
- user_registrations:
315
- destroyed:
316
- inactive_signed_up:
317
- signed_up:
318
- updated:
319
- user_sessions:
320
- signed_in:
321
- signed_out:
322
- errors:
323
- messages:
324
- already_confirmed:
325
- not_found: no trobat
326
- not_locked:
327
- not_saved:
328
284
  spree:
329
285
  abbreviation: Abreviatura
330
286
  accept:
@@ -562,10 +518,6 @@ ca:
562
518
  jirafe_settings_updated:
563
519
  date: Data
564
520
  date_completed:
565
- date_picker:
566
- first_day:
567
- format:
568
- js_format:
569
521
  date_range: Rang de Data
570
522
  default: Per omissió
571
523
  default_refund_amount:
@@ -1027,7 +979,18 @@ ca:
1027
979
  receive: rebre
1028
980
  receive_stock:
1029
981
  received: Rebut
1030
- reception_status:
982
+ reception_states:
983
+ awaiting: En espera
984
+ cancelled: Cancel·lat
985
+ expired: Expirat
986
+ given_to_customer: Entregat al client
987
+ in_transit: En trànsit
988
+ lost_in_transit: Perdut en trànsit
989
+ received: Rebut
990
+ shipped_wrong_item: Article incorrecte
991
+ short_shipped: No inclòs en l'enviament
992
+ unexchanged: Sense canvis
993
+ reception_status: Estat de recepció
1031
994
  reference:
1032
995
  refund: Retornar
1033
996
  refund_amount_must_be_greater_than_zero:
@@ -303,53 +303,6 @@ cs:
303
303
  few: Zóny
304
304
  one: Zóna
305
305
  other: Zón
306
- devise:
307
- confirmations:
308
- confirmed: Váš účet byl úspěšně potvrzen. Nyní jste přihlášen(a).
309
- send_instructions: Za několik minut obdržíte email s instrukcemi k potvrzení vašeho účtu.
310
- failure:
311
- inactive: Váš účet ještě nebyl aktivován.
312
- invalid: Neplatný email nebo heslo.
313
- invalid_token: Neplatný ověřovací symbol.
314
- locked: Váš účet je uzamčen.
315
- timeout: Vaše relace vypršela, přihlaste se prosím znovu, pak můžete pokračovat.
316
- unauthenticated: Musíte se přihlásit, pak můžete pokračovat.
317
- unconfirmed: Musíte potvrdit svůj účet, pak můžete pokračovat.
318
- mailer:
319
- confirmation_instructions:
320
- subject: Instrukce k potvrzení účtu
321
- reset_password_instructions:
322
- subject: Instrukce k nastavení nového hesla
323
- unlock_instructions:
324
- subject: Instrukce k odemčení účtu
325
- oauth_callbacks:
326
- failure: 'Není možné autorizovat z %{kind}, protože: %{reason}.'
327
- success: "Úspěšná autorizace z účtu %{kind}."
328
- unlocks:
329
- send_instructions: Za několik minut obdržíte email s instrukcemi, jak odemknout svůj účet.
330
- unlocked: Váš účet byl úspěšně odemknut. Nyní jste přihlášen(a).
331
- user_passwords:
332
- user:
333
- cannot_be_blank: Heslo nemůže být prázdné.
334
- send_instructions: Za několik minut obdržíte email s instrukcemi k nastavení nového hesla.
335
- updated: Vaše heslo bylo úspěšně změněno. Nyní jste přihlášen(a).
336
- user_registrations:
337
- destroyed: Na shledanou! Váš účet byl úspěšně zrušen. Doufáme, že se brzy opět uvidíme.
338
- inactive_signed_up: Registrace byla úspěšná. Nicméně se nemůžete přihlásit, protože Váš účet je %{reason}.
339
- signed_up: Vítejte! Registrace byla úspěšná.
340
- updated: Váš účet byl úspěšně aktualizován.
341
- user_sessions:
342
- signed_in: Přihlášení bylo úspěšné.
343
- signed_out: Odhlášení bylo úspěšné.
344
- errors:
345
- messages:
346
- already_confirmed: již byl potvrzen
347
- not_found: nenalezen
348
- not_locked: nebyl uzamčen
349
- not_saved:
350
- few: "%{count} chyby zabraňují uložení %{resource}:"
351
- one: '1 chyba zabraňuje uložení %{resource}:'
352
- other: "%{count} chyb zabraňuje uložení %{resource}:"
353
306
  spree:
354
307
  abbreviation: Zkratka
355
308
  accept: Přijmout
@@ -593,7 +546,7 @@ cs:
593
546
  date_picker:
594
547
  first_day: 1
595
548
  format: "%d.%m.%Y"
596
- js_format: dd.mm.yy
549
+ js_format: d.m.Y
597
550
  date_range: Datum (od-do)
598
551
  default: Výchozí
599
552
  default_refund_amount: Výchozí částka refundace