Refactor some translations to use interpolation

This commit is contained in:
Julius Pabrinkis
2017-06-09 00:17:55 +01:00
committed by Maikel Linke
parent 3a0c0fd638
commit 872a150c7d
3 changed files with 4 additions and 4 deletions

View File

@@ -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')

View File

@@ -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:

View File

@@ -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)