12332 - Fix rubocop Rails/I18nLocaleTexts errors

- Add en locales for the hardcodded strings
This commit is contained in:
Ahmed Ejaz
2024-04-07 03:02:37 +05:00
committed by Maikel Linke
parent 693b9bd171
commit ec61cff387
3 changed files with 6 additions and 8 deletions

View File

@@ -576,11 +576,6 @@ Rails/HasManyOrHasOneDependent:
- 'app/models/spree/tax_rate.rb'
- 'app/models/spree/variant.rb'
# Offense count: 3
Rails/I18nLocaleTexts:
Exclude:
- 'app/controllers/admin/stripe_accounts_controller.rb'
# Offense count: 22
# Configuration parameters: IgnoreScopes, Include.
# Include: app/models/**/*.rb

View File

@@ -16,14 +16,14 @@ module Admin
authorize! :destroy, stripe_account
if stripe_account.deauthorize_and_destroy
flash[:success] = "Stripe account disconnected."
flash[:success] = I18n.t('stripe.success_code.disconnected')
else
flash[:error] = "Failed to disconnect Stripe."
flash[:error] = I18n.t('stripe.error_code.disconnect_failure')
end
redirect_to main_app.edit_admin_enterprise_path(stripe_account.enterprise)
rescue ActiveRecord::RecordNotFound
flash[:error] = "Failed to disconnect Stripe."
flash[:error] = I18n.t('stripe.error_code.disconnect_failure')
redirect_to spree.admin_dashboard_path
end

View File

@@ -235,6 +235,9 @@ en:
transaction_not_allowed: "The card has been declined for an unknown reason."
try_again_later: "The card has been declined for an unknown reason."
withdrawal_count_limit_exceeded: "The customer has exceeded the balance or credit limit available on their card."
disconnect_failure: "Failed to disconnect Stripe."
success_code:
disconnected: "Stripe account disconnected."
activemodel:
errors: