diff --git a/CHANGELOG.md b/CHANGELOG.md index 64e2ebcd7f..b23618f057 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Draft +- Translation mechanism for config.json has been updated. [#2089](https://github.com/bigcommerce/cornerstone/pull/2089) - As a shopper I want to see gift wrapping price in product list the cart. [#2093](https://github.com/bigcommerce/cornerstone/pull/2093) - Fixed wishlist dropdown shift on quick view modal. [#2102](https://github.com/bigcommerce/cornerstone/pull/2102) - Empty email input in newsletter field should trigger an error. [#2101](https://github.com/bigcommerce/cornerstone/pull/2101) diff --git a/assets/js/theme/common/utils/translations-utils.js b/assets/js/theme/common/utils/translations-utils.js index b1f8c3fd90..c96dde833d 100644 --- a/assets/js/theme/common/utils/translations-utils.js +++ b/assets/js/theme/common/utils/translations-utils.js @@ -26,27 +26,3 @@ export const createTranslationDictionary = (context) => { return acc; }, {}); }; - -const defaultPageBuilderValues = { - pdp_sale_badge_label: 'On Sale!', - pdp_sold_out_label: 'Sold Out', - 'pdp-sale-price-label': 'Now:', - 'pdp-non-sale-price-label': 'Was:', - 'pdp-retail-price-label': 'MSRP:', - 'pdp-custom-fields-tab-label': 'Additional Information', -}; - -/** - * defines Translation for values from page builder (locally could be found in config.json) - */ -export const translatePageBuilderValues = () => { - $('[data-page-builder-key]').each((_, selector) => { - const $item = $(selector); - const itemText = $item.text().trim(); - const itemDefaultTranslation = $item.data('default-translation'); - - if (itemText === defaultPageBuilderValues[$item.data('page-builder-key')] && itemText !== itemDefaultTranslation) { - $item.text(itemDefaultTranslation); - } - }); -}; diff --git a/assets/js/theme/global.js b/assets/js/theme/global.js index 572643d627..b030eae56e 100644 --- a/assets/js/theme/global.js +++ b/assets/js/theme/global.js @@ -15,21 +15,11 @@ import adminBar from './global/adminBar'; import carousel from './common/carousel'; import loadingProgressBar from './global/loading-progress-bar'; import svgInjector from './global/svg-injector'; -import { translatePageBuilderValues } from './common/utils/translations-utils'; export default class Global extends PageManager { onReady() { const { - channelId, - cartId, - productId, - categoryId, - secureBaseUrl, - maintenanceModeSettings, - adminBarLanguage, - showAdminBar, - isProductCardPresented, - isProductListPresented, + channelId, cartId, productId, categoryId, secureBaseUrl, maintenanceModeSettings, adminBarLanguage, showAdminBar, } = this.context; cartPreview(secureBaseUrl, cartId); quickSearch(); @@ -45,9 +35,5 @@ export default class Global extends PageManager { } loadingProgressBar(); svgInjector(); - - if (isProductListPresented || isProductCardPresented) { - translatePageBuilderValues(); - } } } diff --git a/config.json b/config.json index c46f00444e..95820c5cbe 100644 --- a/config.json +++ b/config.json @@ -318,12 +318,12 @@ "navigation_design": "simple", "price_ranges": true, "pdp-price-label": "", - "pdp_sale_badge_label": "On Sale!", - "pdp_sold_out_label": "Sold Out", - "pdp-sale-price-label": "Now:", - "pdp-non-sale-price-label": "Was:", - "pdp-retail-price-label": "MSRP:", - "pdp-custom-fields-tab-label": "Additional Information", + "pdp_sale_badge_label": "", + "pdp_sold_out_label": "", + "pdp-sale-price-label": "", + "pdp-non-sale-price-label": "", + "pdp-retail-price-label": "", + "pdp-custom-fields-tab-label": "", "paymentbuttons-paypal-layout": "vertical", "paymentbuttons-paypal-color": "gold", "paymentbuttons-paypal-shape": "rect", diff --git a/templates/components/amp/products/card.html b/templates/components/amp/products/card.html index 946f502318..b85c852dcf 100644 --- a/templates/components/amp/products/card.html +++ b/templates/components/amp/products/card.html @@ -1,5 +1,3 @@ -{{inject "isProductCardPresented" true}} -
{{#or price.sale_price_with_tax.value price.sale_price_without_tax.value}} diff --git a/templates/components/amp/products/list.html b/templates/components/amp/products/list.html index 86d2ba9368..98b419ea9a 100644 --- a/templates/components/amp/products/list.html +++ b/templates/components/amp/products/list.html @@ -1,5 +1,3 @@ -{{inject "isProductListPresented" true}} -