Use Spree.t directly for translating the successfully_removed flash message

Since none of the current keys have a `%{resource}` parameter.
This commit is contained in:
David Rodríguez
2025-11-25 19:05:20 +01:00
parent 7bf54088a6
commit 6bd2f5af8d
5 changed files with 5 additions and 5 deletions

View File

@@ -61,7 +61,7 @@ module Admin
def destroy
if @object.destroy
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
respond_with(@object) do |format|
format.html { redirect_to collection_url }
format.js { render partial: "spree/admin/shared/destroy" }

View File

@@ -68,7 +68,7 @@ module Spree
destroy_before
if @object.destroy
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
end
redirect_to location_after_save

View File

@@ -16,7 +16,7 @@ module Spree
@url_filters = ::ProductFilters.new.extract(request.query_parameters)
if @object.destroy
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
end
# if destroy fails it won't show any errors to the user
redirect_to spree.admin_product_product_properties_url(params[:product_id], @url_filters)

View File

@@ -36,7 +36,7 @@ module Spree
end
@object.touch :deleted_at
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
respond_with(@object) do |format|
format.html { redirect_to collection_url }

View File

@@ -5,7 +5,7 @@ module Spree
class TaxCategoriesController < ::Admin::ResourceController
def destroy
if @object.destroy
flash[:success] = flash_message_for(@object, :successfully_removed)
flash[:success] = Spree.t(:successfully_removed)
respond_with(@object) do |format|
format.html { redirect_to collection_url }
format.js { render partial: "spree/admin/shared/destroy" }