diff --git a/backend/app/views/spree/admin/shared/_js_locale_data.html.erb b/backend/app/views/spree/admin/shared/_js_locale_data.html.erb index d61a32b1c85..6ad652fdd0f 100644 --- a/backend/app/views/spree/admin/shared/_js_locale_data.html.erb +++ b/backend/app/views/spree/admin/shared/_js_locale_data.html.erb @@ -3,40 +3,42 @@ var Spree = {} } Spree.translations = <%== - I18n.t("spree").merge({ - date_picker: Spree.t(:js_format, - scope: 'date_picker', - default: 'yy/mm/dd'), - abbr_day_names: I18n.t(:abbr_day_names, scope: :date), - destroy: Spree.t(:destroy, scope: :actions), - edit: Spree.t(:edit, scope: :actions), - save: Spree.t(:save, scope: :actions), - cancel: Spree.t(:cancel, scope: :actions), - first_day: Spree.t(:first_day, - scope: 'date_picker', - default: 0).to_i, - item_stock_placeholder: Spree.t(:choose_location), - month_names: I18n.t(:month_names, scope: :date).reject(&:blank?), - currency_separator: I18n.t('number.currency.format.separator'), - currency_delimiter: I18n.t('number.currency.format.delimiter'), - activerecord: I18n.t('activerecord') - }).to_json + JSON.dump( + I18n.t("spree").merge({ + date_picker: Spree.t(:js_format, + scope: 'date_picker', + default: 'yy/mm/dd'), + abbr_day_names: I18n.t(:abbr_day_names, scope: :date), + destroy: Spree.t(:destroy, scope: :actions), + edit: Spree.t(:edit, scope: :actions), + save: Spree.t(:save, scope: :actions), + cancel: Spree.t(:cancel, scope: :actions), + first_day: Spree.t(:first_day, + scope: 'date_picker', + default: 0).to_i, + item_stock_placeholder: Spree.t(:choose_location), + month_names: I18n.t(:month_names, scope: :date).reject(&:blank?), + currency_separator: I18n.t('number.currency.format.separator'), + currency_delimiter: I18n.t('number.currency.format.delimiter'), + activerecord: I18n.t('activerecord') + })) %>; Spree.currencyInfo = <%== - Money::Currency.all.map { |c| - format = - if c.symbol == "" || c.symbol_first - "%s%v" - else - "%v %s" - end - [c.id.to_s.upcase, [ - c.symbol || "¤", - c.exponent, - format - ]] - }.to_h.to_json + JSON.dump( + Money::Currency.all.map { |c| + format = + if c.symbol == "" || c.symbol_first + "%s%v" + else + "%v %s" + end + [c.id.to_s.upcase, [ + c.symbol || "¤", + c.exponent, + format + ]] + }.to_h) %>;