spree_core 4.8.1 → 4.8.3

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: a07adab86367df355f16ba975b123b0c203579de5882cec741c8f81e1dfff5f0
4
- data.tar.gz: b7c41de3fb4ab564ca7c7ebbe0642e2ed6d0235ea59c4661ceb524435bf51c3f
3
+ metadata.gz: 5ee4d4cee87ddfaa3a840606e85a256ec3751fd79f509e481fc08557c908f0a5
4
+ data.tar.gz: ef15433c0b5ac981d367bf1ee209d5ff126f9930e986bc824b74a554cb56e171
5
5
  SHA512:
6
- metadata.gz: eb9917a0b380bc500b7bcfa63f0a36dcdefb6afc1237b52bd95cd8365d3caba3af00d97eed799834a6db6aa1689d043a27107dc53045a24ccaa7f702152470dd
7
- data.tar.gz: 22c9f866d4e5a5ce0f556fa8dd38bbb59a9a6d6c7f64d7a9de300c30ccf4f63625e75ea2f119eb65e25a03bcf35925905ff522e163925919b048e304e331519f
6
+ metadata.gz: 563286ea01a9de90ed7d4fa10398715511835028bf0ec274a69ea482841793bab3cb7441778b574e2a4add3c128b38b1bb65c31a0e1b1e669361244fbf756b11
7
+ data.tar.gz: a0fa015209ed89a6c2d69cef0bc17e01d2eb7002b869b0fccff2aab8b0ede4f443a6933d15d0832589b5eeae91b2b80364f625af36b6d3a0e50a641c5a85b1f6
@@ -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
 
@@ -19,6 +19,7 @@ module Spree
19
19
  end
20
20
 
21
21
  def set_locale
22
+ I18n.default_locale = default_locale unless Spree.always_use_translations?
22
23
  I18n.locale = current_locale
23
24
  end
24
25
 
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '4.8.1'.freeze
2
+ VERSION = '4.8.3'.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
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.1
4
+ version: 4.8.3
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-27 00:00:00.000000000 Z
12
+ date: 2024-06-13 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.1
1122
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.8.3
1123
1123
  documentation_uri: https://docs.spreecommerce.org/
1124
- source_code_uri: https://github.com/spree/spree/tree/v4.8.1
1124
+ source_code_uri: https://github.com/spree/spree/tree/v4.8.3
1125
1125
  post_install_message:
1126
1126
  rdoc_options: []
1127
1127
  require_paths: