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.

Re-use existing translations rather than adding new (#12646)

Damian Legawiec03a046b58cdb
diff --git a/admin/app/controllers/spree/admin/users_controller.rb b/admin/app/controllers/spree/admin/users_controller.rb
index 9db7b841ec..90a9c09a85 100644
--- a/admin/app/controllers/spree/admin/users_controller.rb
+++ b/admin/app/controllers/spree/admin/users_controller.rb
@@ -27,7 +27,7 @@ module Spree
def update
if @user.update(user_params)
- flash[:success] = Spree.t(:account_updated)
+ flash[:success] = flash_message_for(@user, :successfully_updated)
redirect_to spree.admin_user_path(@user)
else
render :edit, status: :unprocessable_entity
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index 64316118db..327b0ba0a1 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -530,7 +530,6 @@ en:
account: Account
account_info: Account info
account_members: Team
- account_updated: Account updated
action: Action
actions:
approve: Approve
@@ -1522,7 +1521,6 @@ en:
permalink: Permalink
personal_details: Personal details
phone: Phone
- place_now: Place now
place_order: Place Order
please_check_back_soon: Please check back soon.
please_define_payment_methods: Please define some payment methods first.
diff --git a/storefront/app/controllers/spree/account/profile_controller.rb b/storefront/app/controllers/spree/account/profile_controller.rb
index 1ee2006304..1855db529a 100644
--- a/storefront/app/controllers/spree/account/profile_controller.rb
+++ b/storefront/app/controllers/spree/account/profile_controller.rb
@@ -7,7 +7,7 @@ module Spree
# PUT /account/profile
def update
if try_spree_current_user.update(user_params)
- redirect_to spree.edit_account_profile_path, notice: Spree.t(:account_updated)
+ redirect_to spree.edit_account_profile_path, notice: Spree.t(:successfully_updated, resource: Spree.t(:account))
else
render :edit, status: :unprocessable_entity
end
diff --git a/storefront/app/views/spree/checkout/_payment_methods.html.erb b/storefront/app/views/spree/checkout/_payment_methods.html.erb
index 155f1a10d5..6116809edd 100644
--- a/storefront/app/views/spree/checkout/_payment_methods.html.erb
+++ b/storefront/app/views/spree/checkout/_payment_methods.html.erb
@@ -12,7 +12,7 @@
</p>
</div>
<div class="flex justify-end w-full">
- <%= button_tag Spree.t(:place_now),
+ <%= button_tag Spree.t(:place_order),
class: 'btn-primary w-full lg:w-2/5 font-semibold checkout-content-save-continue-button my-5 !py-4',
data: { 'turbo-submits-with': (render 'spree/checkout/button_processing', is_hidden: false) } %>
</div>
diff --git a/storefront/spec/controllers/spree/account/profile_controller_spec.rb b/storefront/spec/controllers/spree/account/profile_controller_spec.rb
index 142af36024..40e4be9b94 100644
--- a/storefront/spec/controllers/spree/account/profile_controller_spec.rb
+++ b/storefront/spec/controllers/spree/account/profile_controller_spec.rb
@@ -37,7 +37,7 @@ RSpec.describe Spree::Account::ProfileController, type: :controller do
expect(user.email).to eq('[email protected]')
expect(user.phone).to eq('0987654321')
expect(response).to redirect_to(spree.edit_account_profile_path)
- expect(flash[:notice]).to eq(Spree.t(:account_updated))
+ expect(flash[:notice]).to eq('Account has been successfully updated!')
end
end