diff --git a/app/assets/javascripts/admin/bulk_product_update.js.coffee b/app/assets/javascripts/admin/bulk_product_update.js.coffee index cb337c4c47..3d565f703a 100644 --- a/app/assets/javascripts/admin/bulk_product_update.js.coffee +++ b/app/assets/javascripts/admin/bulk_product_update.js.coffee @@ -265,11 +265,11 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout $scope.displayDirtyProducts = -> - if DirtyProducts.count() > 0 - message = if DirtyProducts.count() == 1 then t("one_product") else DirtyProducts.count() + t("products") - StatusMessage.display 'notice', t("changes_to") + "#{message}" + t("remain_unsaved.") - else - StatusMessage.clear() + count = DirtyProducts.count() + switch count + when 0 then StatusMessage.clear() + when 1 then StatusMessage.display 'notice', t("one_product_unsaved") + else StatusMessage.display 'notice', t("products_unsaved", n: count) filterSubmitProducts = (productsToFilter) -> diff --git a/config/locales/en.yml b/config/locales/en.yml index da0948dece..2656fe91c9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -938,9 +938,8 @@ Please follow the instructions there to make your enterprise visible on the Open success: "success" failure: "failure" unsaved_changes_confirmation: "Unsaved changes will be lost. Continue anyway?" - one_product: "one product" - changes_to: "Changes to" - remain_unsaved: "remain unsaced" + one_product_unsaved: "Changes to one product remain unsaved." + products_unsaved: "Changes to %{n} products remain unsaved." add_manager: "Add a manager" is_already_manager: "is already a manager!" no_change_to_save: " No change to save"