From 872a150c7d5b12d61bf2fea29cc71b85b073fdff Mon Sep 17 00:00:00 2001 From: Julius Pabrinkis Date: Fri, 9 Jun 2017 00:17:55 +0100 Subject: [PATCH] Refactor some translations to use interpolation --- .../controllers/variant_overrides_controller.js.coffee | 2 +- config/locales/en.yml | 4 ++-- lib/open_food_network/enterprise_fee_applicator.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/admin/variant_overrides/controllers/variant_overrides_controller.js.coffee b/app/assets/javascripts/admin/variant_overrides/controllers/variant_overrides_controller.js.coffee index 8dcf0ad5b3..ac6c993fef 100644 --- a/app/assets/javascripts/admin/variant_overrides/controllers/variant_overrides_controller.js.coffee +++ b/app/assets/javascripts/admin/variant_overrides/controllers/variant_overrides_controller.js.coffee @@ -82,7 +82,7 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl", for field, field_errors of data.errors errors = errors.concat field_errors errors = errors.join ', ' - t('js.variant_overrides.some_trouble') + ": #{errors}" + t('js.variant_overrides.some_trouble', {errors: errors}) else t('js.oh_no') diff --git a/config/locales/en.yml b/config/locales/en.yml index ba35acf28f..029806d38a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1814,7 +1814,7 @@ Please follow the instructions there to make your enterprise visible on the Open tag_rules: "Tag Rules" shop_preferences: "Shop Preferences" enterprise_fee_whole_order: Whole order - enterprise_fee_by: fee by + enterprise_fee_by: "%{type} fee by %{role} %{enterprise_name}" validation_msg_relationship_already_established: "^That relationship is already established." validation_msg_at_least_one_hub: "^At least one hub must be selected" validation_msg_product_category_cant_be_blank: "^Product Category cant be blank" @@ -2009,7 +2009,7 @@ Please follow the instructions there to make your enterprise visible on the Open remain_unsaved: remain unsaved. no_changes_to_save: No changes to save.' no_authorisation: "I couldn't get authorisation to save those changes, so they remain unsaved." - some_trouble: I had some trouble saving + some_trouble: "I had some trouble saving: %{errors}" changing_on_hand_stock: Changing on hand stock levels... stock_reset: Stocks reset to defaults. tag_rules: diff --git a/lib/open_food_network/enterprise_fee_applicator.rb b/lib/open_food_network/enterprise_fee_applicator.rb index d8c27263b6..e6d52e1749 100644 --- a/lib/open_food_network/enterprise_fee_applicator.rb +++ b/lib/open_food_network/enterprise_fee_applicator.rb @@ -28,7 +28,7 @@ module OpenFoodNetwork end def base_adjustment_label - "#{enterprise_fee.fee_type} #{I18n.t(:enterprise_fee_by)} #{role} #{enterprise_fee.enterprise.name}" + I18n.t(:enterprise_fee_by, type: enterprise_fee.fee_type, role: role, enterprise_name: enterprise_fee.enterprise.name) end def adjustment_tax(adjustable, adjustment)