From f22795ac901942a4db7ff2e88d8e3467d58066ba Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Mon, 16 Jun 2025 22:56:54 -0400 Subject: [PATCH] Moved strings for notices to en.yml --- app/controllers/qbo_controller.rb | 10 +++++----- config/locales/en.yml | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/qbo_controller.rb b/app/controllers/qbo_controller.rb index c62c937..c3c86d3 100644 --- a/app/controllers/qbo_controller.rb +++ b/app/controllers/qbo_controller.rb @@ -51,9 +51,9 @@ class QboController < ApplicationController qbo.refresh_token! if qbo.save! - redirect_to qbo_sync_path, :flash => { :notice => "Successfully connected to Quickbooks" } + redirect_to qbo_sync_path, :flash => { :notice => I18n.t(:label_connected) } else - redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Error" } + redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => I18n.t(:label_error) } end end @@ -65,9 +65,9 @@ class QboController < ApplicationController i = Issue.find_by_id params[:id] if i.customer i.bill_time - redirect_to i, :flash => { :notice => "Successfully Billed #{i.customer.name}" } + redirect_to i, :flash => { :notice => I18n.t(:label_billed_success) + i.customer.name } else - redirect_to i, :flash => { :error => "Cannot bill without a customer assigned" } + redirect_to i, :flash => { :error => I18n.t(:label_billing_error) } end end @@ -152,6 +152,6 @@ class QboController < ApplicationController ActiveRecord::Base.connection.close end - redirect_to :home, :flash => { :notice => "Syncing Quickbooks" } + redirect_to :home, :flash => { :notice => I18n.t(:label_syncing) } end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 506e18d..81a598e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -92,3 +92,4 @@ en: label_appointment: "Add Appointment" label_actions: "Actions" label_create_estimate: "Create Estimate" + label_syncing: "Syncing Quickbooks"