add translation for calculator preferred unit error

This commit is contained in:
Andy Brett
2020-09-17 08:42:08 -07:00
parent 988abf7a8c
commit 66099239aa
2 changed files with 2 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ module Calculator
def set_preference(name, value)
if name == :unit_from_list && !["kg", "lb"].include?(value)
self.calculable.errors.add(:preferred_unit_from_list, "must be kg or lb")
self.calculable.errors.add(:preferred_unit_from_list, I18n.t(:calculator_preferred_unit_error))
else
send self.class.preference_setter_method(name), value
end

View File

@@ -2120,6 +2120,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
calculator: "Calculator"
calculator_values: "Calculator values"
calculator_settings_warning: "If you are changing the calculator type, you must save first before you can edit the calculator settings"
calculator_preferred_unit_error: "must be kg or lb"
flat_percent_per_item: "Flat Percent (per item)"
flat_rate_per_item: "Flat Rate (per item)"
flat_rate_per_order: "Flat Rate (per order)"