Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Cast `say_no` and `say_yes` translations to string, since they can be parsed to bool (#12723)

Damian Kaczmarczyk9e830f7850fb
diff --git a/admin/app/helpers/spree/admin/navigation_helper.rb b/admin/app/helpers/spree/admin/navigation_helper.rb
index 515bd5aaf6..010f87b060 100644
--- a/admin/app/helpers/spree/admin/navigation_helper.rb
+++ b/admin/app/helpers/spree/admin/navigation_helper.rb
@@ -190,7 +190,7 @@ module Spree
# @return [String] the badge with the icon
def active_badge(condition, options = {})
label = options[:label]
- label ||= condition ? Spree.t(:say_yes) : Spree.t(:say_no)
+ label ||= condition ? Spree.t(:say_yes).to_s : Spree.t(:say_no).to_s
label = icon('check') + label if condition
css_class = condition ? 'badge-active' : 'badge-inactive'
diff --git a/admin/app/views/spree/admin/payment_methods/_form.html.erb b/admin/app/views/spree/admin/payment_methods/_form.html.erb
index 3aa7ef077d..30d832b69a 100644
--- a/admin/app/views/spree/admin/payment_methods/_form.html.erb
+++ b/admin/app/views/spree/admin/payment_methods/_form.html.erb
@@ -55,7 +55,7 @@
</div>
<div class="form-group">
<%= label_tag :payment_method_auto_capture, Spree.t(:auto_capture) %>
- <%= select(:payment_method, :auto_capture, [["#{Spree.t(:use_app_default)} (#{Spree::Config[:auto_capture]})", ''], [Spree.t(:say_yes), true], [Spree.t(:say_no), false]], {}, {class: 'custom-select'}) %>
+ <%= select(:payment_method, :auto_capture, [["#{Spree.t(:use_app_default)} (#{Spree::Config[:auto_capture]})", ''], [Spree.t(:say_yes).to_s, true], [Spree.t(:say_no).to_s, false]], {}, {class: 'custom-select'}) %>
</div>
<div class="form-group">