Translate variant override on_demand yes and no

This commit is contained in:
Kristina Lim
2018-11-26 13:41:32 +08:00
parent 4b3198a2b4
commit 7ae555cd9c
3 changed files with 9 additions and 6 deletions

View File

@@ -14,8 +14,8 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl",
$scope.selectView = Views.selectView
$scope.currentView = -> Views.currentView
$scope.onDemandOptions = [
{ description: t('js.yes'), value: true },
{ description: t('js.no'), value: false }
{ description: t('js.variant_overrides.on_demand.yes'), value: true },
{ description: t('js.variant_overrides.on_demand.no'), value: false }
]
$scope.views = Views.setViews

View File

@@ -2596,6 +2596,9 @@ See the %{link} to find out more about %{sitename}'s features and to start using
now_out_of_stock: is now out of stock.
only_n_remainging: "now only has %{num} remaining."
variant_overrides:
on_demand:
"yes": "Yes"
"no": "No"
inventory_products: "Inventory Products"
hidden_products: "Hidden Products"
new_products: "New Products"

View File

@@ -141,7 +141,7 @@ feature %q{
fill_in "variant-overrides-#{variant.id}-sku", with: 'NEWSKU'
fill_in "variant-overrides-#{variant.id}-price", with: '777.77'
fill_in "variant-overrides-#{variant.id}-count_on_hand", with: '123'
select I18n.t("js.yes"), from: "variant-overrides-#{variant.id}-on_demand"
select I18n.t("js.variant_overrides.on_demand.yes"), from: "variant-overrides-#{variant.id}-on_demand"
page.should have_content "Changes to one override remain unsaved."
expect do
@@ -236,7 +236,7 @@ feature %q{
it "product values are affected by overrides" do
page.should have_input "variant-overrides-#{variant.id}-price", with: '77.77', placeholder: '1.23'
page.should have_input "variant-overrides-#{variant.id}-count_on_hand", with: '11111', placeholder: '12'
expect(page).to have_select "variant-overrides-#{variant.id}-on_demand", selected: I18n.t("js.yes")
expect(page).to have_select "variant-overrides-#{variant.id}-on_demand", selected: I18n.t("js.variant_overrides.on_demand.yes")
end
it "updates existing overrides" do
@@ -257,14 +257,14 @@ feature %q{
end
it "updates on_demand settings" do
select I18n.t("js.no"), from: "variant-overrides-#{variant.id}-on_demand"
select I18n.t("js.variant_overrides.on_demand.no"), from: "variant-overrides-#{variant.id}-on_demand"
click_button I18n.t("save_changes")
expect(page).to have_content I18n.t("js.changes_saved")
vo.reload
expect(vo.on_demand).to eq(false)
select I18n.t("js.yes"), from: "variant-overrides-#{variant.id}-on_demand"
select I18n.t("js.variant_overrides.on_demand.yes"), from: "variant-overrides-#{variant.id}-on_demand"
click_button I18n.t("save_changes")
expect(page).to have_content I18n.t("js.changes_saved")