spree_core 4.8.0 → 4.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb9614d2e37d1c4c04ad71985912a54e12c579ba21266bbec33d95d383bf03f4
4
- data.tar.gz: 7cc25cd0d5e067d97c30a9932cde2a1e02cc3826ba37d98ec14aa6ad5cd8f6ac
3
+ metadata.gz: 347d9720ab5b7339d59ea9a0bf03052f1574b3b4acaceb034063afa0c22515a8
4
+ data.tar.gz: 9de3e8196d36b1131f130360c5fab3f202d9f60af7a31470d94ebbd96b50903b
5
5
  SHA512:
6
- metadata.gz: 8e15d6b8da8503742847b455d084c6fd067fde3fc613605707f6c576a9e169cd9b410e2d6755554f2eef05fb622f0b5dd01533372bacc4b9d2f57407f45dac8e
7
- data.tar.gz: 02e24962d02e6c6665c9d9a8292b9365353fc08170dd7c0697cf6d0234a4d2b22d0b61e0e6d035c2a4ec3f4c6d6b5eb453ae0a5dffae3739e7382ed83c80645d
6
+ metadata.gz: 075bf6bcf2f617036128adf641e401d22a97942117fc2b1fc553a33456697618a43207454c592ff83bc51ef8eaf585fc7fc55fb62c7092f062366f89b6c8a859
7
+ data.tar.gz: 24577e9f4781111d8fddb27b9bf7735d5ad67f29d8aea28b1b16e7b6bd17c96490a7a867ffe0be1760ef4932e6b423246362fe884f6b6da33be296d3b1886bc7
@@ -7,8 +7,13 @@ module Spree
7
7
  include Spree::Webhooks::HasWebhooks
8
8
  end
9
9
 
10
- TRANSLATABLE_FIELDS = %i[presentation].freeze
11
- translates(*TRANSLATABLE_FIELDS, column_fallback: true)
10
+ if Spree.always_use_translations?
11
+ TRANSLATABLE_FIELDS = %i[name presentation].freeze
12
+ translates(*TRANSLATABLE_FIELDS)
13
+ else
14
+ TRANSLATABLE_FIELDS = %i[presentation].freeze
15
+ translates(*TRANSLATABLE_FIELDS, column_fallback: true)
16
+ end
12
17
 
13
18
  acts_as_list
14
19
  auto_strip_attributes :name, :presentation
@@ -6,8 +6,13 @@ module Spree
6
6
  include Spree::Webhooks::HasWebhooks
7
7
  end
8
8
 
9
- TRANSLATABLE_FIELDS = %i[presentation].freeze
10
- translates(*TRANSLATABLE_FIELDS, column_fallback: true)
9
+ if Spree.always_use_translations?
10
+ TRANSLATABLE_FIELDS = %i[name presentation].freeze
11
+ translates(*TRANSLATABLE_FIELDS)
12
+ else
13
+ TRANSLATABLE_FIELDS = %i[presentation].freeze
14
+ translates(*TRANSLATABLE_FIELDS, column_fallback: true)
15
+ end
11
16
 
12
17
  belongs_to :option_type, class_name: 'Spree::OptionType', touch: true, inverse_of: :option_values
13
18
 
@@ -39,7 +39,7 @@ module Spree
39
39
  purchasable? in_stock? backorderable?]
40
40
 
41
41
  TRANSLATABLE_FIELDS = %i[name description slug meta_description meta_keywords meta_title].freeze
42
- translates(*TRANSLATABLE_FIELDS, column_fallback: true)
42
+ translates(*TRANSLATABLE_FIELDS, column_fallback: !Spree.always_use_translations?)
43
43
 
44
44
  self::Translation.class_eval do
45
45
  before_save :set_slug
@@ -3,8 +3,13 @@ module Spree
3
3
  include Spree::FilterParam
4
4
  include Spree::TranslatableResource
5
5
 
6
- TRANSLATABLE_FIELDS = %i[value].freeze
7
- translates(*TRANSLATABLE_FIELDS, column_fallback: true)
6
+ if Spree.always_use_translations?
7
+ TRANSLATABLE_FIELDS = %i[value filter_param].freeze
8
+ translates(*TRANSLATABLE_FIELDS)
9
+ else
10
+ TRANSLATABLE_FIELDS = %i[value].freeze
11
+ translates(*TRANSLATABLE_FIELDS, column_fallback: true)
12
+ end
8
13
 
9
14
  self::Translation.class_eval do
10
15
  auto_strip_attributes :value
@@ -7,8 +7,13 @@ module Spree
7
7
  include Spree::Webhooks::HasWebhooks
8
8
  end
9
9
 
10
- TRANSLATABLE_FIELDS = %i[presentation].freeze
11
- translates(*TRANSLATABLE_FIELDS, column_fallback: true)
10
+ if Spree.always_use_translations?
11
+ TRANSLATABLE_FIELDS = %i[name presentation filter_param].freeze
12
+ translates(*TRANSLATABLE_FIELDS)
13
+ else
14
+ TRANSLATABLE_FIELDS = %i[presentation].freeze
15
+ translates(*TRANSLATABLE_FIELDS, column_fallback: true)
16
+ end
12
17
 
13
18
  self::Translation.class_eval do
14
19
  auto_strip_attributes :presentation
@@ -11,7 +11,7 @@ module Spree
11
11
  TRANSLATABLE_FIELDS = %i[name meta_description meta_keywords seo_title facebook
12
12
  twitter instagram customer_support_email description
13
13
  address contact_phone new_order_notifications_email].freeze
14
- translates(*TRANSLATABLE_FIELDS, column_fallback: true)
14
+ translates(*TRANSLATABLE_FIELDS, column_fallback: !Spree.always_use_translations?)
15
15
 
16
16
  self::Translation.class_eval do
17
17
  acts_as_paranoid
@@ -60,7 +60,7 @@ module Spree
60
60
  scope :for_stores, ->(stores) { joins(:taxonomy).where(spree_taxonomies: { store_id: stores.ids }) }
61
61
 
62
62
  TRANSLATABLE_FIELDS = %i[name description permalink].freeze
63
- translates(*TRANSLATABLE_FIELDS, column_fallback: true)
63
+ translates(*TRANSLATABLE_FIELDS, column_fallback: !Spree.always_use_translations?)
64
64
 
65
65
  self::Translation.class_eval do
66
66
  alias_attribute :slug, :permalink
@@ -7,7 +7,7 @@ module Spree
7
7
  end
8
8
 
9
9
  TRANSLATABLE_FIELDS = %i[name].freeze
10
- translates(*TRANSLATABLE_FIELDS, column_fallback: true)
10
+ translates(*TRANSLATABLE_FIELDS, column_fallback: !Spree.always_use_translations?)
11
11
 
12
12
  acts_as_list
13
13
 
@@ -1038,8 +1038,8 @@ en:
1038
1038
  go_to_previous_menu: Go to previous menu
1039
1039
  log_in: LOG IN
1040
1040
  log_out: LOG OUT
1041
- my_account: MY ACCOUNT
1042
- my_orders: MY ORDERS
1041
+ my_account: My Account
1042
+ my_orders: My Orders
1043
1043
  show_menu: Show menu
1044
1044
  show_search: Show search
1045
1045
  show_user_menu: Show user menu
@@ -1234,14 +1234,6 @@ en:
1234
1234
  payment_type: Payment type
1235
1235
  payment_updated: Payment Updated
1236
1236
  payments: Payments
1237
- pdp:
1238
- checkout: Checkout
1239
- description: Description
1240
- details: Details
1241
- products_included_in_promotion: Products included in the promotion
1242
- quantity: Quantity
1243
- view_cart: View cart
1244
- you_may_also_like: You may also like
1245
1237
  percent: Percent
1246
1238
  percent_per_item: Percent Per Item
1247
1239
  permalink: Permalink
@@ -1251,32 +1243,6 @@ en:
1251
1243
  place_order: Place Order
1252
1244
  please_define_payment_methods: Please define some payment methods first.
1253
1245
  please_enter_reasonable_quantity: Please enter a reasonable quantity.
1254
- plp:
1255
- best_selling: BEST SELLING
1256
- clear_all: CLEAR ALL
1257
- collection: COLLECTION
1258
- color: COLOR
1259
- done: DONE
1260
- default: DEFAULT
1261
- filter_by: FILTER BY
1262
- newest_first: NEWEST FIRST
1263
- no_results: No results
1264
- no_results_found: No results found
1265
- not_found_filters1: We couldn’t find a match for these filters.
1266
- not_found_filters2: Please try another choose.
1267
- not_found_text1: We couldn’t find products for '%{keywords}'.
1268
- not_found_text2: Please try another search.
1269
- price: price
1270
- price_high_to_low: PRICE (HIGH - LOW)
1271
- price_low_to_high: PRICE (LOW - HIGH)
1272
- name_a_z: NAME (A-Z)
1273
- name_z_a: NAME (Z-A)
1274
- result: RESULT
1275
- results_for: RESULTS FOR
1276
- size: SIZE
1277
- sort_by: SORT BY
1278
- top_sellers: TOP SELLERS
1279
- type: TYPE
1280
1246
  populate_get_error: Something went wrong. Please try adding the item again.
1281
1247
  powered_by: Powered by
1282
1248
  pre_tax_refund_amount: Pre-Tax Refund Amount
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '4.8.0'.freeze
2
+ VERSION = '4.8.2'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
data/lib/spree/core.rb CHANGED
@@ -76,6 +76,10 @@ module Spree
76
76
  end
77
77
  end
78
78
 
79
+ def self.always_use_translations?
80
+ Spree::RuntimeConfig.always_use_translations
81
+ end
82
+
79
83
  def self.use_translations?
80
84
  Spree::RuntimeConfig.always_use_translations || I18n.default_locale != I18n.locale
81
85
  end
@@ -91,7 +95,9 @@ module Spree
91
95
  # This method is defined within the core gem on purpose.
92
96
  # Some people may only wish to use the Core part of Spree.
93
97
  def self.config
94
- yield(Spree::Config)
98
+ Rails.application.config.after_initialize do
99
+ yield(Spree::Config)
100
+ end
95
101
  end
96
102
 
97
103
  # Used to set dependencies for Spree.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.0
4
+ version: 4.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-23 00:00:00.000000000 Z
12
+ date: 2024-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -1119,9 +1119,9 @@ licenses:
1119
1119
  - BSD-3-Clause
1120
1120
  metadata:
1121
1121
  bug_tracker_uri: https://github.com/spree/spree/issues
1122
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.8.0
1122
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.8.2
1123
1123
  documentation_uri: https://docs.spreecommerce.org/
1124
- source_code_uri: https://github.com/spree/spree/tree/v4.8.0
1124
+ source_code_uri: https://github.com/spree/spree/tree/v4.8.2
1125
1125
  post_install_message:
1126
1126
  rdoc_options: []
1127
1127
  require_paths: