From a92b95b1272001349b699ccdb430b7b340e229c1 Mon Sep 17 00:00:00 2001 From: "rudraswamy.c" Date: Thu, 20 Jun 2024 12:25:09 +0530 Subject: [PATCH] PWA-3294 :PLP should displayed on all store view --- .../i18n/zh_TW.json | 410 ++++++++++++++++++ .../lib/components/App/localeProvider.js | 9 +- packages/venia-ui/lib/util/formatLocale.js | 4 +- 3 files changed, 418 insertions(+), 5 deletions(-) create mode 100644 packages/extensions/venia-sample-language-packs/i18n/zh_TW.json diff --git a/packages/extensions/venia-sample-language-packs/i18n/zh_TW.json b/packages/extensions/venia-sample-language-packs/i18n/zh_TW.json new file mode 100644 index 0000000000..74678c0674 --- /dev/null +++ b/packages/extensions/venia-sample-language-packs/i18n/zh_TW.json @@ -0,0 +1,410 @@ +{ + "About Us": "關於我們", + "Account": "帳戶", + "accountChip.chipText": "您好,{name}", + "accountInformationPage.accountInformation": "帳戶資訊", + "accountInformationPage.editAccount": "編輯帳戶資訊", + "accountInformationPage.errorTryAgain": "發生問題,請重新整理並重試。", + "accountInformationPage.titleAccount": "帳戶資訊", + "accountMenu.accountInfoLink": "帳戶資訊", + "accountMenu.addressBookLink": "地址簿", + "accountMenu.communicationsLink": "通訊", + "accountMenu.favoritesListsLink": "收藏清單", + "accountMenu.orderHistoryLink": "訂單記錄", + "accountMenu.savedPaymentsLink": "已儲存付款方式", + "accountMenu.signOutButtonText": "登出", + "accountMenu.storeCreditLink": "商店信用卡和禮品", + "accountTrigger.ariaLabel": "切換我的帳戶選單", + "accountTrigger.buttonFallback": "登入", + "accountTrigger.signIn": "登入", + "addressBook.addNewAddresstext": "新增新地址", + "addressBook.applyButtonText": "應用", + "addressBook.cancelButtonText": "取消", + "addressBook.headerText": "修改運送資訊", + "addressBookPage.addAddressText": "新增地址", + "addressBookPage.addDialogTitle": "新增地址", + "addressBookPage.addressBookText": "地址簿", + "addressBookPage.editDialogTitle": "編輯地址", + "addressBookPage.makeDefaultAddress": "設為預設地址", + "addressCard.defaultText": "預設", + "addToCartButton.addItemToCart": "加入購物車", + "addToCartButton.itemOutOfStock": "缺貨", + "app.errorOffline": "您目前處於離線狀態,某些功能可能無法使用。", + "app.errorUnexpected": "抱歉!發生意外錯誤。", + "app.infoOnline": "您已連線。", + "authBar.fallbackText": "帳戶", + "authBar.signInText": "登入", + "autocomplete.emptyResult": "找不到結果。", + "autocomplete.error": "檢索結果時發生錯誤。", + "autocomplete.invalidCharacterLength": "搜索字詞至少需三個字元", + "autocomplete.loading": "正在檢索結果...", + "autocomplete.prompt": "搜索產品", + "autocomplete.resultSummary": "{resultCount} 項產品", + "cartPage.couponCode": "優惠碼", + "cartPage.emptyCart": "您的購物車中沒有任何商品。", + "cartPage.heading": "購物車", + "cartPage.signIn": "登入", + "cartPage.title": "購物車", + "cartPage.wishlist.ce.successMessage": "已成功將項目新增至您的收藏清單。", + "cartPage.wishlist.ee.successMessage": "已成功將項目新增至「{wishlistName}」的清單。", + "cartTrigger.ariaLabel": "切換迷你購物車。您的購物車中有 {count} 項商品。", + "category.notFound": "找不到此類別。請重試。", + "categoryContent.filter": "篩選", + "categoryContent.itemsSortedBy": "按排序顯示商品", + "categoryContent.resultCount": "{count} 結果", + "categoryLeaf.allLabel": "所有{name}", + "categoryList.noResults": "找不到子類別。", + "checkoutPage.accountSuccessfullyCreated": "帳戶建立成功。", + "checkoutPage.additionalText": "您將收到一封包含詳細信息的電子郵件,我們會在您的訂單發貨時通知您。", + "checkoutPage.billingAddressSame": "帳單地址與運送地址相同", + "checkoutPage.checkout": "結帳", + "checkoutPage.couponCode": "輸入優惠碼", + "checkoutPage.createAccount": "建立帳戶", + "checkoutPage.editPaymentInformation": "編輯付款資訊", + "checkoutPage.editShippingInfo": "編輯運送資訊", + "checkoutPage.editShippingMethod": "修改運送方式", + "checkoutPage.emptyMessage": "您的購物車中沒有任何商品。", + "checkoutPage.errorLoadingPayment": "加載付款選項時發生錯誤。請稍後重試。", + "checkoutPage.errorSubmit": "糟糕!提交時發生錯誤。請重試。", + "checkoutPage.fetchingItemsInYourOrder": "正在檢索您的訂單商品", + "checkoutPage.giftOptions": "查看禮品選項", + "checkoutPage.greeting": "歡迎,{firstname}!", + "checkoutPage.guestCheckout": "訪客結帳", + "checkoutPage.guestSignIn.backToCheckout": "返回結帳", + "checkoutPage.itemsInYourOrder": " 訂單中的商品", + "checkoutPage.loadingPayment": "正在加載付款方式", + "checkoutPage.loadingPaymentInformation": "正在檢索付款資訊", + "checkoutPage.loginAndCheckoutFaster": "登入後更快結帳", + "checkoutPage.orderNumber": "訂單編號:{orderNumber}", + "checkoutPage.orderSummary": "訂單摘要", + "checkoutPage.paymentInformation": "付款資訊", + "checkoutPage.paymentInformationStep": "3. 付款資訊", + "checkoutPage.paymentMethodStatus": "{selectedPaymentMethod} 不支持編輯。", + "checkoutPage.paymentSummary": "{cardType} 卡號末四碼 {lastFour}", + "checkoutPage.cardPlaceholder": "16 位卡號", + "checkoutPage.placeOrder": "下訂單", + "checkoutPage.quantity": "數量:{quantity}", + "checkoutPage.quickCheckout": "返程快速結帳", + "checkoutPage.returnToCart": "返回購物車", + "checkoutPage.reviewAndPlaceOrder": "檢查並下訂單", + "checkoutPage.reviewOrder": "檢視訂單", + "checkoutPage.setAPasswordAndSave": "設置密碼並保存資訊,以便下次快速完成。", + "checkoutPage.shippingMethodStep": "2. 運送方式", + "checkoutPage.signInLabel": "登入以快速結帳", + "checkoutPage.signInButton": "登入", + "checkoutPage.showAllItems": "顯示所有商品", + "checkoutPage.step0": "加載付款方式", + "checkoutPage.step1": "檢查信用卡資訊", + "checkoutPage.step2": "檢查信用卡資訊", + "checkoutPage.step3": "檢查信用卡資訊", + "checkoutPage.step4": "成功保存信用卡資訊", + "checkoutPage.stockStatusMessage": "您的購物車中有一件商品目前缺貨,需要移除才能結帳。請返回購物車移除該商品。", + "checkoutPage.subscribe": "訂閱新聞和更新", + "checkoutPage.suggestSignInMessage": "您提供的電子郵件已與現有的 Venia 帳戶關聯。您要使用這個帳戶登入嗎?", + "checkoutPage.suggestSignInConfirmMessage": "是,登入", + "checkoutPage.suggestSignInDeclineMessage": "不,謝謝", + "checkoutPage.thankYou": "感謝您的訂購!", + "checkoutPage.titleCheckout": "結帳", + "checkoutPage.titleReceipt": "收據", + "cms.shopByCategory": "依類別購買", + "cmsBlock.noBlocks": "目前沒有可顯示的區塊", + "communicationsPage.changesText": "儲存變更", + "communicationsPage.communicationsText": "通訊", + "communicationsPage.eNewsletterText": "Venia 電子報", + "communicationsPage.optInText": "我們希望能保持聯繫。請選取您希望接收的通訊項目。", + "communicationsPage.preferencesText": "您的偏好已更新。", + "communicationsPage.savingText": "儲存中", + "communicationsPage.subscribeText": "保持流行趨勢,訂閱 Venia 的每月通訊。", + "communicationsPage.title": "通訊", + "completedView.errorLoading": "加載選擇的運送方法時發生錯誤。請重新選擇。", + "completedView.shippingMethod": "運送方式", + "Contact Us": "聯絡我們", + "country.label": "國家", + "couponCode.apply": "套用", + "couponCode.couponCode": "優惠碼", + "couponCode.enterCode": "輸入代碼", + "couponCode.errorContainer": "發生問題。請重新整理並重試。", + "couponCode.removeButton": "移除", + "createAccount.cancelText": "取消", + "createAccount.createAccountText": "建立帳戶", + "createAccount.emailText": "電子郵件", + "createAccount.firstNameText": "名字", + "createAccount.lastNameText": "姓氏", + "createAccount.passwordText": "密碼", + "createAccount.subscribeText": "訂閱新聞和更新", + "createWishlist.createListText": "建立清單", + "createWishlist.dialogTitle": "新收藏清單", + "createWishlist.handleCreateListText": "建立清單", + "createWishlist.listName": "清單名稱", + "Customer Service": "客戶服務", + "customerForm.defaultShipping": "設為預設運送地址", + "customerForm.formMessage": "您輸入的運送地址將被儲存至您的地址簿並設為未來購物的預設地址。", + "customerForm.loading": "正在取得客戶詳細資料...", + "discountSummary.lineItemLabel": "已應用折扣", + "editModal.headerText": "編輯項目", + "Email Signup": "電子郵件訂閱", + "field.optional": "選填", + "filterFooter.results": "顯示結果", + "filterList.showMore": "顯示更多", + "filterList.showLess": "顯示較少", + "filterModal.action": "全部清除", + "filterModal.headerTitle": "篩選器", + "filterSearch.name": "輸入{name}", + "footer.calloutText": "Lorem ipsum en français dolor sit amet, consectetur adipsicing elit, sed do eiusmod tempor incididunt ut labore et dolore.", + "footer.followText": "追蹤我們!", + "footer.privacyText": "隱私政策", + "footer.termsText": "使用條款", + "forgotPassword.instructions": "請輸入與此帳戶關聯的電子郵件地址。", + "forgotPassword.recoverPasswordText": "找回我的密碼", + "forgotPasswordForm.cancelButtonText": "取消", + "forgotPasswordForm.emailAddressText": "電子郵件地址", + "forgotPasswordForm.submitButtonText": "提交", + "formSubmissionSuccessful.recoverPasswordText": "找回我的密碼", + "formSubmissionSuccessful.textMessage": "如果 {email} 有關聯的帳戶,您將收到一封包含密碼重置連結的電子郵件。", + "galleryItem.unavailableProduct": "目前無法購買此商品。", + "giftCard.balance": "餘額:", + "giftCard.remove": "移除", + "giftCards.apply": "套用", + "giftCards.balance": "餘額:", + "giftCards.cardEntry": "輸入卡號", + "giftCards.cardNumber": "禮品卡號碼", + "giftCards.checkBalance": "查詢餘額", + "giftCards.errorInvalid": "無效的卡片。請重試。", + "giftCards.errorLoading": "加載應用的禮品卡時發生錯誤。請重新整理並重試。", + "giftCards.errorRemoving": "無法移除禮品卡。請重試。", + "giftCards.loading": "正在加載禮品卡...", + "giftCardSection.giftCard": "套用禮品卡", + "giftCardSummary.lineItemLabel": "已套用的禮品卡", + "giftOptions.addGiftMessage": "新增訊息", + "giftOptions.cancelGiftMessageButton": "取消", + "giftOptions.cardMessage": "在此輸入您的訊息", + "giftOptions.editGiftMessageButton": "編輯", + "giftOptions.from": "寄件人", + "giftOptions.giftMessageFrom": "寄件人: {cardFrom}", + "giftOptions.giftMessageTo": "收件人: {cardTo}", + "giftOptions.includeGiftMessage": "選擇性訊息", + "giftOptions.includeGiftReceipt": "包含禮品收據", + "giftOptions.includePrintedCard": "包含印刷卡{price}", + "giftOptions.message": "訊息", + "giftOptions.saving": "儲存中", + "giftOptions.to": "收件人", + "giftOptions.updateGiftMessageButton": "更新", + "Give Back": "回饋", + "global.addButton": "新增", + "global.cancelButton": "取消", + "global.changePassword": "更改密碼", + "global.city": "城市", + "global.confirmButton": "確認", + "global.creditCard": "信用卡", + "global.currentPassword": "目前密碼", + "global.editButton": "編輯", + "global.email": "電子郵件", + "global.firstName": "名字", + "global.free": "免費", + "global.home": "首頁", + "global.lastName": "姓氏", + "global.name": "名稱", + "global.newPassword": "新密碼", + "global.password": "密碼", + "global.phoneNumber": "電話號碼", + "global.private": "私人", + "global.public": "公開", + "global.quantity": "數量", + "global.save": "儲存", + "global.saveAndContinueButton": "儲存並繼續", + "global.shippingInformation": "運送資訊", + "global.shippingMethod": "運送方式", + "global.sku": "FR-SKU", + "global.streetAddress": "街道地址", + "global.streetAddress2": "街道地址2", + "global.updateButton": "更新", + "guestForm.continueToNextStep": "繼續到運送方式", + "guestForm.emailMessage": "在結賬時設置密碼以創建一步帳戶。", + "Help": "幫助", + "loadingIndicator.message": "正在獲取數據...", + "logo.title": "Venia", + "magentoRoute.internalError": "出現問題。請重試。", + "magentoRoute.routeError": "找不到此頁面。請重試。", + "miniCart.checkout": "進行結賬", + "miniCart.editCartButton": "編輯購物車", + "miniCart.emptyMessage": "您的購物車中沒有任何商品。", + "miniCart.subtotal": "小計:", + "miniCart.totalQuantity": "{totalQuantity} 項商品", + "navHeader.accountText": "帳戶", + "navHeader.createAccountText": "創建帳戶", + "navHeader.forgotPasswordText": "忘記密碼", + "navHeader.mainMenuText": "主選單", + "navHeader.myAccountText": "我的帳戶", + "navHeader.signInText": "登入", + "navigationTrigger.ariaLabel": "切換導航面板", + "newsletter.subscribeMessage": "訂閱電子報", + "newsletter.loadingText": "正在訂閱", + "newsletter.titleText": "訂閱 Venia", + "newsletter.subscribeText": "訂閱", + "newsletter.infoText": "直接在您的郵箱中收到最新消息、更新和優惠。", + "noProductsFound.noProductsFound": "抱歉!找不到任何產品。", + "noProductsFound.tryOneOfTheseCategories": "嘗試以下其中一個類別", + "notFound.goBack": "返回", + "notFound.offline": "離線", + "Order Status": "訂單狀態", + "orderDetails.billingInformationLabel": "帳單詳細資料", + "orderDetails.buyAgain": "再次購買", + "orderDetails.discount": "折扣", + "orderDetails.orderTotal": "訂單總額", + "orderDetails.paymentMethodLabel": "付款方式", + "orderDetails.printLabel": "列印收據", + "orderDetails.quantity": "數量:{quantity}", + "orderDetails.returnThis": "退貨", + "orderDetails.shipping": "運費", + "orderDetails.shippingInformationLabel": "運送資訊", + "orderDetails.shippingMethodLabel": "運送方式", + "orderDetails.subtotal": "小計", + "orderDetails.tax": "稅金", + "orderDetails.total": "總計", + "orderDetails.trackingInformation": "{carrier} 追蹤號碼:{number}", + "orderHistoryPage.emptyDataMessage": "您還沒有訂單。", + "orderHistoryPage.pageTitleText": "訂單歷史記錄", + "orderProgressBar.deliveredText": "已交付", + "orderProgressBar.processingText": "處理中", + "orderProgressBar.readyToShipText": "準備運送", + "orderProgressBar.shippedText": "已發貨", + "orderRow.deliveredText": "已交付", + "orderRow.orderDateText": "訂單日期", + "orderRow.orderNumberText": "訂單 #", + "orderRow.orderTotalText": "訂單總額", + "orderRow.processingText": "處理中", + "orderRow.readyToShipText": "準備運送", + "orderRow.shippedText": "已發貨", + "Our Story": "我們的故事", + "pagination.firstPage": "轉到第一頁", + "pagination.lastPage": "轉到最後一頁", + "pagination.nextPage": "轉到下一頁", + "pagination.prevPage": "轉到上一頁", + "postcode.label": "郵遞區號 / 郵政編碼", + "priceAdjustments.couponCode": "輸入優惠碼", + "priceAdjustments.giftOptions": "查看禮物選項", + "priceAdjustments.shippingMethod": "估計運費", + "priceSummary.checkoutButton": "去結帳", + "priceSummary.discountSummary.hideDiscounts": "隱藏各項折扣。", + "priceSummary.discountSummary.showDiscounts": "顯示各項折扣。", + "priceSummary.errorText": "出現問題。請刷新頁面後重試。", + "priceSummary.estimatedTotal": "估計總額", + "priceSummary.lineItemLabel": "小計", + "priceSummary.total": "總計", + "product.editItem": "編輯商品", + "product.outOfStock": "缺貨", + "product.outOfStockTryAgain": "此商品目前缺貨。請稍後再試。", + "product.price": "價格", + "product.removeFromCart": "從購物車中移除", + "product.removeFromFavorites": "從收藏中移除", + "product.saveForLater": "移到收藏", + "productDetail.inStock": "有庫存", + "productDetail.outOfStock": "缺貨", + "productDetail.skuNumber": "商品編號:FR-SKU # {sku}", + "productDetail.unknown": "未知", + "productForm.dataError": "發生錯誤。請重新整理並重試。", + "productForm.fetchingProductOptions": "取得商品選項中...", + "productForm.quantity": "數量", + "productForm.submit": "更新", + "productForm.updatingCart": "更新購物車中...", + "productFullDetail.addItemToCart": "加入購物車", + "productFullDetail.itemOutOfStock": "已售完", + "productFullDetail.errorCart": "購物車發生問題。請重新整理並再次嘗試加入商品。", + "productFullDetail.errorToken": "購物車發生問題。請重新登入並再次嘗試加入商品。", + "productFullDetail.errorUnknown": "無法加入商品至購物車。請檢查必填選項並重試。", + "productFullDetail.productDescription": "產品描述", + "productFullDetail.details": "詳情", + "productFullDetail.outOfStockProduct": "此商品目前已售罄", + "productList.each": "每件", + "productList.outOfStock": "缺貨", + "productList.quantity": "數量:{quantity}", + "productListing.loading": "載入購物車中...", + "productOptions.selectedLabel": "已選擇 {label}:", + "productQuantity.label": "產品數量", + "productSort.sortByButton": "排序方式", + "productSort.sortButton": "排序", + "quantity.buttonDecrement": "減少數量", + "quantity.buttonIncrement": "增加數量", + "quantity.input": "商品數量", + "region.label": "地區", + "Register": "註冊", + "resetPassword.descriptionText": "請輸入您的新密碼。", + "resetPassword.header": "重設密碼", + "resetPassword.invalidTokenMessage": "哎呀,出了點問題。請檢查連結或再試一次。", + "resetPassword.newPasswordText": "新密碼", + "resetPassword.savedPasswordText": "您的新密碼已儲存。", + "resetPassword.savePassword": "儲存密碼", + "resetPassword.successMessage": "您的新密碼已儲存。請使用此密碼登入您的帳號。", + "resetPassword.title": "重設密碼", + "Returns": "退貨", + "savedPaymentsPage.addButtonText": "新增信用卡", + "savedPaymentsPage.noSavedPayments": "您目前沒有儲存的付款方式", + "savedPaymentsPage.subHeading": "此處儲存的信用卡將在結帳時顯示。", + "savedPaymentsPage.title": "已儲存的付款方式", + "searchBar.heading": "產品建議", + "searchBar.label": " 在 {label} 中", + "searchPage.filterButton": "篩選", + "searchPage.noResult": "未找到任何結果。可能是搜尋字詞有誤或無效。", + "searchPage.noResultImportant": "找不到任何結果!", + "searchPage.searchTerm": "顯示 {term} 的搜尋結果{category, select, null {} other { 在 {category} 中}}:", + "searchPage.searchTermEmpty": "顯示所有搜尋結果:", + "searchPage.sortContainer": "依排序顯示商品", + "searchPage.totalPages": "{totalCount} 個商品", + "searchTrigger.search": "搜尋", + "shippingForm.formTitle": "送貨地址", + "shippingForm.getShippingOptions": "取得運送選項", + "shippingForm.loading": "載入中...", + "shippingForm.zip": "郵遞區號", + "shippingForm.shippingEmail": "送貨電郵", + "shippingInformation.cardTitle": "送貨資訊", + "shippingInformation.editTitle": "1. 送貨資訊", + "shippingInformation.loading": "取得送貨資訊中...", + "shippingMethod.continueToNextStep": "繼續至付款資訊", + "shippingMethod.heading": "運送方式", + "shippingMethod.loading": "載入中...", + "shippingMethods.estimateButton": "我想要評估運費", + "shippingMethods.message": "若要在結帳前評估運費,請提供您的訂單目的地國家、地區和郵遞區號。", + "shippingMethods.prompt": "運送方式", + "shippingRadios.errorLoading": "載入運送方式時發生錯誤。請確認已設定送貨地址並重試。", + "shippingSummary.estimatedShipping": "預估運費", + "shippingSummary.shipping": "運送", + "Sign In": "登入", + "signIn.createAccountText": "建立帳號", + "signIn.emailAddressText": "電子郵件地址", + "signIn.forgotPasswordText": "忘記密碼?", + "signIn.loadingText": "登入中", + "signIn.passwordText": "密碼", + "signIn.signInText": "登入", + "signIn.titleText": "登入您的帳號", + "sortItem.priceAsc": "價格低到高", + "sortItem.priceDesc": "價格高到低", + "sortItem.relevance": "相關性最高", + "stockStatusMessage.message": "您的購物車中有商品缺貨,需移除才能結帳。", + "taxSummary.estimatedTax": "預估稅金", + "taxSummary.tax": "稅金", + "validation.hasLengthAtLeast": "需至少包含 {value} 個字元。", + "validation.hasLengthAtMost": "不得超過 {value} 個字元。", + "validation.hasLengthExactly": "必須正好包含 {value} 個字元。", + "validation.invalidAbbreviation": "「{value}」不是有效的州縮寫。", + "validation.invalidCountry": "「{value}」不是有效的國家。", + "validation.invalidRegions": "「{value}」沒有可用的地區。", + "validation.isEqualToField": "{value} 必須相同。", + "validation.isNotEqualToField": "{value} 必須不同。", + "validation.isRequired": "為必填項目。", + "validation.mustBeChecked": "必須勾選。", + "validation.validatePassword": "密碼需包含至少3種以下元素:小寫字母、大寫字母、數字、特殊符號。", + "wishlist.emptyListText": "此清單目前沒有任何項目", + "wishlist.itemCountOpen": "顯示此清單中的 {currentCount} 項中的 {count} 項", + "wishlist.itemCountClosed": "您的清單中有 {count} 項", + "wishlistButton.addedText": "已加入收藏", + "wishlistButton.addText": "加入收藏", + "wishlistEditFavoritesListDialog.title": "修改收藏清單", + "wishlistItem.addToCart": "加入購物車", + "wishlistItem.addToCartError": "發生問題。請重新整理並重試。", + "wishlistListActionsDialog.title_initial": "清單操作", + "wishlistListActionsDialog.edit": "編輯清單", + "wishlistPage.disabledMessage": "抱歉,此功能已停用。", + "wishlistPage.fetchErrorMessage": "發生問題。請重新整理並重試。", + "wishlistPage.headingText": "收藏清單", + "wishlistPage.wishlistDisabledMessage": "目前無法使用收藏清單。" +} diff --git a/packages/venia-ui/lib/components/App/localeProvider.js b/packages/venia-ui/lib/components/App/localeProvider.js index 2bdcb7e19c..83ef42b80e 100644 --- a/packages/venia-ui/lib/components/App/localeProvider.js +++ b/packages/venia-ui/lib/components/App/localeProvider.js @@ -20,10 +20,13 @@ const LocaleProvider = props => { nextFetchPolicy: 'cache-first' }); + let locale = data.storeConfig.locale; + if (locale === 'zh_Hant_TW') { + locale = 'zh_TW'; + } + const language = useMemo(() => { - return data && data.storeConfig.locale - ? toReactIntl(data.storeConfig.locale) - : DEFAULT_LOCALE; + return data && locale ? toReactIntl(locale) : DEFAULT_LOCALE; }, [data]); /** diff --git a/packages/venia-ui/lib/util/formatLocale.js b/packages/venia-ui/lib/util/formatLocale.js index b10550af3b..c25786095c 100644 --- a/packages/venia-ui/lib/util/formatLocale.js +++ b/packages/venia-ui/lib/util/formatLocale.js @@ -5,7 +5,7 @@ * @returns {string} A locale string (e.g. `fr_FR`). */ export const fromReactIntl = string => { - return string.replace('-', '_'); + return string.replace(/-/g, '_'); }; /** @@ -15,5 +15,5 @@ export const fromReactIntl = string => { * @returns {string} A string (e.g. `fr-FR`). */ export const toReactIntl = string => { - return string.replace('_', '-'); + return string.replace(/_/g, '-'); };