diff --git a/app/controllers/admin/order_cycles_controller.rb b/app/controllers/admin/order_cycles_controller.rb index 5eae68c7ce..bb506ec9db 100644 --- a/app/controllers/admin/order_cycles_controller.rb +++ b/app/controllers/admin/order_cycles_controller.rb @@ -48,7 +48,7 @@ module Admin @order_cycle_form = OrderCycleForm.new(@order_cycle, order_cycle_params, spree_current_user) if @order_cycle_form.save - flash[:notice] = I18n.t(:order_cycles_create_notice) + flash[:notice] = t('.success') render json: { success: true, edit_path: main_app.admin_order_cycle_incoming_path(@order_cycle) } else @@ -66,7 +66,7 @@ module Admin if @order_cycle_form.save update_nil_subscription_line_items_price_estimate(@order_cycle) respond_to do |format| - flash[:notice] = I18n.t(:order_cycles_update_notice) if params[:reloading] == '1' + flash[:notice] = t('.success') if params[:reloading] == '1' format.html { redirect_to_after_update_path } format.json { render json: { success: true } } end @@ -118,7 +118,7 @@ module Admin @order_cycle = OrderCycle.find params[:id] @order_cycle.clone! redirect_to main_app.admin_order_cycles_path, - notice: I18n.t(:order_cycles_clone_notice, name: @order_cycle.name) + notice: t('.success', name: @order_cycle.name) end # Send notifications to all producers who are part of the order cycle @@ -126,7 +126,7 @@ module Admin OrderCycleNotificationJob.perform_later params[:id].to_i redirect_to main_app.admin_order_cycles_path, - notice: I18n.t(:order_cycles_email_to_producers_notice) + notice: t('.success') end protected diff --git a/config/locales/en.yml b/config/locales/en.yml index f512b2b9b3..5ac9043638 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1353,6 +1353,14 @@ en: create: "Create" cancel: "Cancel" back_to_list: "Back To List" + create: + success: 'Your order cycle has been created.' + update: + success: 'Your order cycle has been updated.' + clone: + success: "Your order cycle %{name} has been cloned." + notify_producers: + success: 'Emails to be sent to producers have been queued for sending.' edit: save: "Save" save_and_next: "Save and Next" @@ -1750,9 +1758,9 @@ en: save: Save voucher_code: Voucher Code voucher_amount: Amount - voucher_type: Voucher Type - flat_rate: Flat - percentage_rate: Percentage (%) + voucher_type: Voucher Type + flat_rate: Flat + percentage_rate: Percentage (%) # Admin controllers controllers: @@ -3208,11 +3216,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using enterprise_bulk_update_success_notice: "Enterprises updated successfully" enterprise_bulk_update_error: 'Update failed' enterprise_shop_show_error: "The shop you are looking for doesn't exist or is inactive on OFN. Please check other shops." - order_cycles_create_notice: 'Your order cycle has been created.' - order_cycles_update_notice: 'Your order cycle has been updated.' order_cycles_bulk_update_notice: 'Order cycles have been updated.' - order_cycles_clone_notice: "Your order cycle %{name} has been cloned." - order_cycles_email_to_producers_notice: 'Emails to be sent to producers have been queued for sending.' order_cycles_no_permission_to_coordinate_error: "None of your enterprises have permission to coordinate an order cycle" order_cycles_no_permission_to_create_error: "You don't have permission to create an order cycle coordinated by that enterprise" order_cycle_closed: "The order cycle you've selected has just closed. Please try again!"