Refactor shipping section translations (#127)

This commit is contained in:
Dominik Żegleń 2019-08-26 23:26:36 +02:00 committed by dominik-zeglen
parent 9abc98bdff
commit aaccb724ae
15 changed files with 1074 additions and 438 deletions

View file

@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" msgstr ""
"POT-Creation-Date: 2019-08-26T17:55:41.507Z\n" "POT-Creation-Date: 2019-08-26T17:58:55.558Z\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -91,6 +91,14 @@ msgctxt "page header"
msgid "Add Page" msgid "Add Page"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.2892088870] - dialog header
#. defaultMessage is:
#. Add Price Rate
msgctxt "dialog header"
msgid "Add Price Rate"
msgstr ""
#: build/locale/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.json #: build/locale/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.json
#. [src.orders.components.OrderProductAddDialog.2775402904] - dialog header #. [src.orders.components.OrderProductAddDialog.2775402904] - dialog header
#. defaultMessage is: #. defaultMessage is:
@ -131,6 +139,14 @@ msgctxt "header"
msgid "Add Variant" msgid "Add Variant"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.1397795758] - add weight based shipping method, dialog header
#. defaultMessage is:
#. Add Weight Rate
msgctxt "add weight based shipping method, dialog header"
msgid "Add Weight Rate"
msgstr ""
#: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json #: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json
#. [src.customers.components.CustomerAddressListPage.3623935073] - button #. [src.customers.components.CustomerAddressListPage.3623935073] - button
#. defaultMessage is: #. defaultMessage is:
@ -239,6 +255,14 @@ msgctxt "button"
msgid "Add products" msgid "Add products"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRates/ShippingZoneRates.json
#. [src.shipping.components.ShippingZoneRates.352297149] - button
#. defaultMessage is:
#. Add rate
msgctxt "button"
msgid "Add rate"
msgstr ""
#: build/locale/src/categories/components/CategoryCreatePage/CategoryCreatePage.json #: build/locale/src/categories/components/CategoryCreatePage/CategoryCreatePage.json
#. [src.categories.components.CategoryCreatePage.2563994280] #. [src.categories.components.CategoryCreatePage.2563994280]
#. defaultMessage is: #. defaultMessage is:
@ -287,6 +311,14 @@ msgctxt "button"
msgid "Add shipping carrier" msgid "Add shipping carrier"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZonesList/ShippingZonesList.json
#. [src.shipping.components.ShippingZonesList.2474410767] - button
#. defaultMessage is:
#. Add shipping zone
msgctxt "button"
msgid "Add shipping zone"
msgstr ""
#: build/locale/src/categories/components/CategoryList/CategoryList.json #: build/locale/src/categories/components/CategoryList/CategoryList.json
#. [src.categories.components.CategoryList.435697837] - button #. [src.categories.components.CategoryList.435697837] - button
#. defaultMessage is: #. defaultMessage is:
@ -647,6 +679,14 @@ msgctxt "dialog content"
msgid "Are you sure you want to delete {counter,plural,one{this sale} other{{displayQuantity} sales}}?" msgid "Are you sure you want to delete {counter,plural,one{this sale} other{{displayQuantity} sales}}?"
msgstr "" msgstr ""
#: build/locale/src/shipping/views/ShippingZonesList.json
#. [src.shipping.views.3698270769] - dialog content
#. defaultMessage is:
#. Are you sure you want to delete {counter,plural,one{this shipping zone} other{{displayQuantity} shipping zones}}?
msgctxt "dialog content"
msgid "Are you sure you want to delete {counter,plural,one{this shipping zone} other{{displayQuantity} shipping zones}}?"
msgstr ""
#: build/locale/src/products/views/ProductUpdate/ProductUpdate.json #: build/locale/src/products/views/ProductUpdate/ProductUpdate.json
#. [src.products.views.ProductUpdate.2446451819] - dialog content #. [src.products.views.ProductUpdate.2446451819] - dialog content
#. defaultMessage is: #. defaultMessage is:
@ -703,6 +743,22 @@ msgctxt "delete product type"
msgid "Are you sure you want to delete {name}?" msgid "Are you sure you want to delete {name}?"
msgstr "" msgstr ""
#: build/locale/src/shipping/views/ShippingZoneDetails/ShippingZoneDetailsDialogs.json
#. [shippingZoneDetailsDialogsDeleteShippingMethod] - delete shipping method
#. defaultMessage is:
#. Are you sure you want to delete {name}?
msgctxt "delete shipping method"
msgid "Are you sure you want to delete {name}?"
msgstr ""
#: build/locale/src/shipping/views/ShippingZoneDetails/ShippingZoneDetailsDialogs.json
#. [shippingZoneDetailsDialogsDeleteShippingZone] - delete shipping zone
#. defaultMessage is:
#. Are you sure you want to delete {name}?
msgctxt "delete shipping zone"
msgid "Are you sure you want to delete {name}?"
msgstr ""
#: build/locale/src/discounts/views/SaleDetails.json #: build/locale/src/discounts/views/SaleDetails.json
#. [src.discounts.views.1457489953] - dialog content #. [src.discounts.views.1457489953] - dialog content
#. defaultMessage is: #. defaultMessage is:
@ -711,6 +767,14 @@ msgctxt "dialog content"
msgid "Are you sure you want to delete {saleName}?" msgid "Are you sure you want to delete {saleName}?"
msgstr "" msgstr ""
#: build/locale/src/shipping/views/ShippingZonesList.json
#. [src.shipping.views.1005071028]
#. defaultMessage is:
#. Are you sure you want to delete {shippingZoneName} shipping zone?
msgctxt "description"
msgid "Are you sure you want to delete {shippingZoneName} shipping zone?"
msgstr ""
#: build/locale/src/pages/views/PageDetails.json #: build/locale/src/pages/views/PageDetails.json
#. [src.pages.views.754348000] - delete page #. [src.pages.views.754348000] - delete page
#. defaultMessage is: #. defaultMessage is:
@ -783,6 +847,14 @@ msgctxt "description"
msgid "Are you sure you want to remove this image?" msgid "Are you sure you want to remove this image?"
msgstr "" msgstr ""
#: build/locale/src/shipping/views/ShippingZoneDetails/ShippingZoneDetailsDialogs.json
#. [src.shipping.views.ShippingZoneDetails.1790261672] - unassign country
#. defaultMessage is:
#. Are you sure you want to remove {countryName} from this shipping zone?
msgctxt "unassign country"
msgid "Are you sure you want to remove {countryName} from this shipping zone?"
msgstr ""
#: build/locale/src/productTypes/components/ProductTypeAttributeUnassignDialog/ProductTypeAttributeUnassignDialog.json #: build/locale/src/productTypes/components/ProductTypeAttributeUnassignDialog/ProductTypeAttributeUnassignDialog.json
#. [src.productTypes.components.ProductTypeAttributeUnassignDialog.722498450] #. [src.productTypes.components.ProductTypeAttributeUnassignDialog.722498450]
#. defaultMessage is: #. defaultMessage is:
@ -887,6 +959,10 @@ msgstr ""
#. [src.discounts.components.DiscountCountrySelectDialog.1585396479] - dialog header #. [src.discounts.components.DiscountCountrySelectDialog.1585396479] - dialog header
#. defaultMessage is: #. defaultMessage is:
#. Assign Countries #. Assign Countries
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.1585396479] - dialog header
#. defaultMessage is:
#. Assign Countries
msgctxt "dialog header" msgctxt "dialog header"
msgid "Assign Countries" msgid "Assign Countries"
msgstr "" msgstr ""
@ -927,6 +1003,10 @@ msgstr ""
#. [src.discounts.components.DiscountCountrySelectDialog.2747492886] - button #. [src.discounts.components.DiscountCountrySelectDialog.2747492886] - button
#. defaultMessage is: #. defaultMessage is:
#. Assign countries #. Assign countries
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.2747492886] - button
#. defaultMessage is:
#. Assign countries
msgctxt "button" msgctxt "button"
msgid "Assign countries" msgid "Assign countries"
msgstr "" msgstr ""
@ -1287,6 +1367,14 @@ msgctxt "description"
msgid "Charge taxes for this item" msgid "Charge taxes for this item"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.2404264158]
#. defaultMessage is:
#. Choose countries you want to add to shipping zone from list below
msgctxt "description"
msgid "Choose countries you want to add to shipping zone from list below"
msgstr ""
#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json #: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json
#. [src.discounts.components.DiscountCountrySelectDialog.2177165134] #. [src.discounts.components.DiscountCountrySelectDialog.2177165134]
#. defaultMessage is: #. defaultMessage is:
@ -1499,10 +1587,30 @@ msgctxt "voucher country range"
msgid "Countries" msgid "Countries"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.json
#. [src.shipping.components.ShippingZoneCreatePage.3109712047]
#. defaultMessage is:
#. Countries
#: build/locale/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.json
#. [src.shipping.components.ShippingZoneDetailsPage.3109712047]
#. defaultMessage is:
#. Countries
#: build/locale/src/shipping/components/ShippingZonesList/ShippingZonesList.json
#. [src.shipping.components.ShippingZonesList.3109712047]
#. defaultMessage is:
#. Countries
msgctxt "description"
msgid "Countries"
msgstr ""
#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json #: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json
#. [src.discounts.components.DiscountCountrySelectDialog.2777439857] - country selection #. [src.discounts.components.DiscountCountrySelectDialog.2777439857] - country selection
#. defaultMessage is: #. defaultMessage is:
#. Countries A to Z #. Countries A to Z
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.2777439857] - country selection
#. defaultMessage is:
#. Countries A to Z
msgctxt "country selection" msgctxt "country selection"
msgid "Countries A to Z" msgid "Countries A to Z"
msgstr "" msgstr ""
@ -1523,6 +1631,14 @@ msgctxt "page header"
msgid "Create New Category" msgid "Create New Category"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.json
#. [src.shipping.components.ShippingZoneCreatePage.4049462680] - header
#. defaultMessage is:
#. Create New Shipping Zone
msgctxt "header"
msgid "Create New Shipping Zone"
msgstr ""
#: build/locale/src/products/views/ProductCreate.json #: build/locale/src/products/views/ProductCreate.json
#. [src.products.views.1542417144] - window title #. [src.products.views.1542417144] - window title
#. defaultMessage is: #. defaultMessage is:
@ -1615,6 +1731,14 @@ msgctxt "header"
msgid "Create page" msgid "Create page"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.16061680] - button
#. defaultMessage is:
#. Create rate
msgctxt "button"
msgid "Create rate"
msgstr ""
#: build/locale/src/collections/views/CollectionCreate.json #: build/locale/src/collections/views/CollectionCreate.json
#. [src.collections.views.1597339737] #. [src.collections.views.1597339737]
#. defaultMessage is: #. defaultMessage is:
@ -1639,6 +1763,18 @@ msgctxt "description"
msgid "Creating the navigation structure is done by dragging and dropping. Simply create a new menu item and then drag it into its destined place. You can move items inside one another to create a tree structure and drag items up and down to create a hierarchy" msgid "Creating the navigation structure is done by dragging and dropping. Simply create a new menu item and then drag it into its destined place. You can move items inside one another to create a tree structure and drag items up and down to create a hierarchy"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.json
#. [src.shipping.components.ShippingZoneCreatePage.2364051773]
#. defaultMessage is:
#. Currently, there are no countries assigned to this shipping zone
#: build/locale/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.json
#. [src.shipping.components.ShippingZoneDetailsPage.2364051773]
#. defaultMessage is:
#. Currently, there are no countries assigned to this shipping zone
msgctxt "description"
msgid "Currently, there are no countries assigned to this shipping zone"
msgstr ""
#: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json #: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json
#. [src.orders.components.OrderCustomer.3426593715] - section header #. [src.orders.components.OrderCustomer.3426593715] - section header
#. defaultMessage is: #. defaultMessage is:
@ -1935,6 +2071,34 @@ msgctxt "dialog header"
msgid "Delete Sales" msgid "Delete Sales"
msgstr "" msgstr ""
#: build/locale/src/shipping/views/ShippingZoneDetails/ShippingZoneDetailsDialogs.json
#. [src.shipping.views.ShippingZoneDetails.1502359905] - dialog header
#. defaultMessage is:
#. Delete Shipping Method
msgctxt "dialog header"
msgid "Delete Shipping Method"
msgstr ""
#: build/locale/src/shipping/views/ShippingZoneDetails/ShippingZoneDetailsDialogs.json
#. [src.shipping.views.ShippingZoneDetails.1010705153] - dialog header
#. defaultMessage is:
#. Delete Shipping Zone
#: build/locale/src/shipping/views/ShippingZonesList.json
#. [src.shipping.views.1010705153] - dialog header
#. defaultMessage is:
#. Delete Shipping Zone
msgctxt "dialog header"
msgid "Delete Shipping Zone"
msgstr ""
#: build/locale/src/shipping/views/ShippingZonesList.json
#. [src.shipping.views.1711385401] - dialog header
#. defaultMessage is:
#. Delete Shipping Zones
msgctxt "dialog header"
msgid "Delete Shipping Zones"
msgstr ""
#: build/locale/src/products/components/ProductVariantCreatePage/ProductVariantCreatePage.json #: build/locale/src/products/components/ProductVariantCreatePage/ProductVariantCreatePage.json
#. [src.products.components.ProductVariantCreatePage.3726089650] - button #. [src.products.components.ProductVariantCreatePage.3726089650] - button
#. defaultMessage is: #. defaultMessage is:
@ -2255,6 +2419,14 @@ msgctxt "header"
msgid "Edit Photo" msgid "Edit Photo"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.3934114933] - dialog header
#. defaultMessage is:
#. Edit Price Rate
msgctxt "dialog header"
msgid "Edit Price Rate"
msgstr ""
#: build/locale/src/orders/components/OrderShippingMethodEditDialog/OrderShippingMethodEditDialog.json #: build/locale/src/orders/components/OrderShippingMethodEditDialog/OrderShippingMethodEditDialog.json
#. [src.orders.components.OrderShippingMethodEditDialog.3369240294] - dialog header #. [src.orders.components.OrderShippingMethodEditDialog.3369240294] - dialog header
#. defaultMessage is: #. defaultMessage is:
@ -2271,6 +2443,14 @@ msgctxt "edit attribute value"
msgid "Edit Value" msgid "Edit Value"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.4152709923] - edit weight based shipping method, dialog header
#. defaultMessage is:
#. Edit Weight Rate
msgctxt "edit weight based shipping method, dialog header"
msgid "Edit Weight Rate"
msgstr ""
#: build/locale/src/products/components/ProductVariants/ProductVariants.json #: build/locale/src/products/components/ProductVariants/ProductVariants.json
#. [src.products.components.ProductVariants.1703363919] - product variant attributes, button #. [src.products.components.ProductVariants.1703363919] - product variant attributes, button
#. defaultMessage is: #. defaultMessage is:
@ -2583,6 +2763,14 @@ msgctxt "description"
msgid "If enabled, youll be able to use this attribute to filter products in product list." msgid "If enabled, youll be able to use this attribute to filter products in product list."
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.1818089229]
#. defaultMessage is:
#. If selected, this will add all of the countries not selected to other shipping zones
msgctxt "description"
msgid "If selected, this will add all of the countries not selected to other shipping zones"
msgstr ""
#: build/locale/src/discounts/components/VoucherValue/VoucherValue.json #: build/locale/src/discounts/components/VoucherValue/VoucherValue.json
#. [src.discounts.components.VoucherValue.4189095909] #. [src.discounts.components.VoucherValue.4189095909]
#. defaultMessage is: #. defaultMessage is:
@ -2819,6 +3007,22 @@ msgctxt "order history message"
msgid "Marked order as paid" msgid "Marked order as paid"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.3463567334]
#. defaultMessage is:
#. Maximal Order Value
msgctxt "description"
msgid "Maximal Order Value"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.3659741519]
#. defaultMessage is:
#. Maximal Order Weight
msgctxt "description"
msgid "Maximal Order Weight"
msgstr ""
#: build/locale/src/navigation/components/MenuItems/MenuItems.json #: build/locale/src/navigation/components/MenuItems/MenuItems.json
#. [menuItemsHeader] - header #. [menuItemsHeader] - header
#. defaultMessage is: #. defaultMessage is:
@ -2859,6 +3063,22 @@ msgctxt "minimum amount of spent money to activate voucher"
msgid "Min. Spent" msgid "Min. Spent"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.1337705349]
#. defaultMessage is:
#. Minimal Order Value
msgctxt "description"
msgid "Minimal Order Value"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.1878009504]
#. defaultMessage is:
#. Minimal Order Weight
msgctxt "description"
msgid "Minimal Order Weight"
msgstr ""
#: build/locale/src/discounts/components/VoucherRequirements/VoucherRequirements.json #: build/locale/src/discounts/components/VoucherRequirements/VoucherRequirements.json
#. [src.discounts.components.VoucherRequirements.653777456] - voucher requirement #. [src.discounts.components.VoucherRequirements.653777456] - voucher requirement
#. defaultMessage is: #. defaultMessage is:
@ -2955,6 +3175,22 @@ msgctxt "product variant name"
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRates/ShippingZoneRates.json
#. [src.shipping.components.ShippingZoneRates.636461959] - shipping method name
#. defaultMessage is:
#. Name
msgctxt "shipping method name"
msgid "Name"
msgstr ""
#: build/locale/src/shipping/components/ShippingZonesList/ShippingZonesList.json
#. [src.shipping.components.ShippingZonesList.636461959] - shipping zone
#. defaultMessage is:
#. Name
msgctxt "shipping zone"
msgid "Name"
msgstr ""
#: build/locale/src/intl.json #: build/locale/src/intl.json
#. [src.navigation] - navigation section name #. [src.navigation] - navigation section name
#. defaultMessage is: #. defaultMessage is:
@ -3183,6 +3419,22 @@ msgctxt "description"
msgid "No shipping address" msgid "No shipping address"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRates/ShippingZoneRates.json
#. [src.shipping.components.ShippingZoneRates.1961493435]
#. defaultMessage is:
#. No shipping rates found
msgctxt "description"
msgid "No shipping rates found"
msgstr ""
#: build/locale/src/shipping/components/ShippingZonesList/ShippingZonesList.json
#. [src.shipping.components.ShippingZonesList.655374584]
#. defaultMessage is:
#. No shipping zones found
msgctxt "description"
msgid "No shipping zones found"
msgstr ""
#: build/locale/src/categories/components/CategoryList/CategoryList.json #: build/locale/src/categories/components/CategoryList/CategoryList.json
#. [src.categories.components.CategoryList.2155313053] #. [src.categories.components.CategoryList.2155313053]
#. defaultMessage is: #. defaultMessage is:
@ -3775,6 +4027,22 @@ msgctxt "product variant price"
msgid "Price" msgid "Price"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRates/ShippingZoneRates.json
#. [src.shipping.components.ShippingZoneRates.1134347598] - shipping method price
#. defaultMessage is:
#. Price
msgctxt "shipping method price"
msgid "Price"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRates/ShippingZoneRates.json
#. [src.shipping.components.ShippingZoneRates.2542194565] - price based shipping methods, section header
#. defaultMessage is:
#. Price Based Rates
msgctxt "price based shipping methods, section header"
msgid "Price Based Rates"
msgstr ""
#: build/locale/src/discounts/components/SalePricing/SalePricing.json #: build/locale/src/discounts/components/SalePricing/SalePricing.json
#. [src.discounts.components.SalePricing.1099355007] - sale pricing, header #. [src.discounts.components.SalePricing.1099355007] - sale pricing, header
#. defaultMessage is: #. defaultMessage is:
@ -4127,6 +4395,14 @@ msgctxt "ordered products"
msgid "Quantity" msgid "Quantity"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.1440682557]
#. defaultMessage is:
#. Quick Pick
msgctxt "description"
msgid "Quick Pick"
msgstr ""
#: build/locale/src/orders/components/OrderListFilter/OrderListFilter.json #: build/locale/src/orders/components/OrderListFilter/OrderListFilter.json
#. [src.orders.components.OrderListFilter.2545228781] #. [src.orders.components.OrderListFilter.2545228781]
#. defaultMessage is: #. defaultMessage is:
@ -4139,6 +4415,30 @@ msgctxt "description"
msgid "Range" msgid "Range"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.3213611593] - shipping method
#. defaultMessage is:
#. Rate
msgctxt "shipping method"
msgid "Rate"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.382595300] - shipping method name
#. defaultMessage is:
#. Rate Name
msgctxt "shipping method name"
msgid "Rate Name"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.1403365734] - shipping method price
#. defaultMessage is:
#. Rate Price
msgctxt "shipping method price"
msgid "Rate Price"
msgstr ""
#: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json #: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json
#. [src.customers.components.CustomerOrders.3878642352] - section header #. [src.customers.components.CustomerOrders.3878642352] - section header
#. defaultMessage is: #. defaultMessage is:
@ -4215,6 +4515,14 @@ msgctxt "dialog header"
msgid "Remove draft order" msgid "Remove draft order"
msgstr "" msgstr ""
#: build/locale/src/shipping/views/ShippingZoneDetails/ShippingZoneDetailsDialogs.json
#. [src.shipping.views.ShippingZoneDetails.254167659] - unassign country, dialog header
#. defaultMessage is:
#. Remove from shipping zone
msgctxt "unassign country, dialog header"
msgid "Remove from shipping zone"
msgstr ""
#: build/locale/src/orders/views/OrderDraftList.json #: build/locale/src/orders/views/OrderDraftList.json
#. [src.orders.views.3880993240] #. [src.orders.views.3880993240]
#. defaultMessage is: #. defaultMessage is:
@ -4247,6 +4555,14 @@ msgctxt "description"
msgid "Removed sale" msgid "Removed sale"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.1003092716]
#. defaultMessage is:
#. Rest of the World
msgctxt "description"
msgid "Rest of the World"
msgstr ""
#: build/locale/src/orders/components/OrderFulfillmentCancelDialog/OrderFulfillmentCancelDialog.json #: build/locale/src/orders/components/OrderFulfillmentCancelDialog/OrderFulfillmentCancelDialog.json
#. [src.orders.components.OrderFulfillmentCancelDialog.3515223857] - switch button #. [src.orders.components.OrderFulfillmentCancelDialog.3515223857] - switch button
#. defaultMessage is: #. defaultMessage is:
@ -4347,6 +4663,14 @@ msgctxt "description"
msgid "Search Attributes" msgid "Search Attributes"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.3510295703]
#. defaultMessage is:
#. Search Countries
msgctxt "description"
msgid "Search Countries"
msgstr ""
#: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json #: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json
#. [src.orders.components.OrderCustomer.2433460203] #. [src.orders.components.OrderCustomer.2433460203]
#. defaultMessage is: #. defaultMessage is:
@ -4395,6 +4719,14 @@ msgctxt "search box placeholder"
msgid "Search by country name" msgid "Search by country name"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.2110418881]
#. defaultMessage is:
#. Search by country name
msgctxt "description"
msgid "Search by country name"
msgstr ""
#: build/locale/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.json #: build/locale/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.json
#. [src.orders.components.OrderProductAddDialog.2336947364] #. [src.orders.components.OrderProductAddDialog.2336947364]
#. defaultMessage is: #. defaultMessage is:
@ -4483,6 +4815,22 @@ msgctxt "product type shipping settings, section header"
msgid "Shipping" msgid "Shipping"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.json
#. [src.shipping.components.ShippingZoneDetailsPage.1325966144]
#. defaultMessage is:
#. Shipping
msgctxt "description"
msgid "Shipping"
msgstr ""
#: build/locale/src/shipping/components/ShippingZonesListPage/ShippingZonesListPage.json
#. [src.shipping.components.ShippingZonesListPage.1325966144] - header
#. defaultMessage is:
#. Shipping
msgctxt "header"
msgid "Shipping"
msgstr ""
#: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json #: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json
#. [src.orders.components.OrderCustomer.2758581442] #. [src.orders.components.OrderCustomer.2758581442]
#. defaultMessage is: #. defaultMessage is:
@ -4499,6 +4847,22 @@ msgctxt "shipping section name"
msgid "Shipping Methods" msgid "Shipping Methods"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.json
#. [src.shipping.components.ShippingWeightUnitForm.549146363]
#. defaultMessage is:
#. Shipping Weight Unit
msgctxt "description"
msgid "Shipping Weight Unit"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneInfo/ShippingZoneInfo.json
#. [src.shipping.components.ShippingZoneInfo.1109610983]
#. defaultMessage is:
#. Shipping Zone Name
msgctxt "description"
msgid "Shipping Zone Name"
msgstr ""
#: build/locale/src/customers/components/CustomerAddresses/CustomerAddresses.json #: build/locale/src/customers/components/CustomerAddresses/CustomerAddresses.json
#. [src.customers.components.CustomerAddresses.3517722732] - subsection header #. [src.customers.components.CustomerAddresses.3517722732] - subsection header
#. defaultMessage is: #. defaultMessage is:
@ -4507,6 +4871,14 @@ msgctxt "subsection header"
msgid "Shipping address" msgid "Shipping address"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZonesList/ShippingZonesList.json
#. [src.shipping.components.ShippingZonesList.2942726079] - sort shipping methods by zone, section header
#. defaultMessage is:
#. Shipping by zone
msgctxt "sort shipping methods by zone, section header"
msgid "Shipping by zone"
msgstr ""
#: build/locale/src/orders/components/OrderHistory/OrderHistory.json #: build/locale/src/orders/components/OrderHistory/OrderHistory.json
#. [src.orders.components.OrderHistory.651019008] - order history message #. [src.orders.components.OrderHistory.651019008] - order history message
#. defaultMessage is: #. defaultMessage is:
@ -4883,6 +5255,14 @@ msgctxt "description"
msgid "There are missing or incorrect informations about this order:" msgid "There are missing or incorrect informations about this order:"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.882649212] - shipping method has no value limits
#. defaultMessage is:
#. There are no value limits
msgctxt "shipping method has no value limits"
msgid "There are no value limits"
msgstr ""
#: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json #: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json
#. [src.customers.components.CustomerAddressListPage.1484733755] #. [src.customers.components.CustomerAddressListPage.1484733755]
#. defaultMessage is: #. defaultMessage is:
@ -4907,6 +5287,26 @@ msgctxt "description"
msgid "This customer has no addresses yet" msgid "This customer has no addresses yet"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.json
#. [src.shipping.components.ShippingZoneCreatePage.4270729636]
#. defaultMessage is:
#. This is default shipping zone, which means that it covers all of the countries which are not assigned to other shipping zones
#: build/locale/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.json
#. [src.shipping.components.ShippingZoneDetailsPage.4270729636]
#. defaultMessage is:
#. This is default shipping zone, which means that it covers all of the countries which are not assigned to other shipping zones
msgctxt "description"
msgid "This is default shipping zone, which means that it covers all of the countries which are not assigned to other shipping zones"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.2215090771] - shipping method, switch button
#. defaultMessage is:
#. This is free shipping
msgctxt "shipping method, switch button"
msgid "This is free shipping"
msgstr ""
#: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json
#. [src.attributes.components.AttributeDetails.4107478955] - attribute slug input field helper text #. [src.attributes.components.AttributeDetails.4107478955] - attribute slug input field helper text
#. defaultMessage is: #. defaultMessage is:
@ -4931,6 +5331,38 @@ msgctxt "switch button"
msgid "This product type has variants" msgid "This product type has variants"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.4226393146]
#. defaultMessage is:
#. This rate will apply to all orders of all prices
msgctxt "description"
msgid "This rate will apply to all orders of all prices"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.1388947267]
#. defaultMessage is:
#. This rate will apply to all orders of all weights
msgctxt "description"
msgid "This rate will apply to all orders of all weights"
msgstr ""
#: build/locale/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.json
#. [src.shipping.components.ShippingWeightUnitForm.2863708228]
#. defaultMessage is:
#. This unit will be used as default shipping weight
msgctxt "description"
msgid "This unit will be used as default shipping weight"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.1486599614]
#. defaultMessage is:
#. This will be shown to customers at checkout
msgctxt "description"
msgid "This will be shown to customers at checkout"
msgstr ""
#: build/locale/src/discounts/components/SalePricing/SalePricing.json #: build/locale/src/discounts/components/SalePricing/SalePricing.json
#. [src.discounts.components.SalePricing.2503204759] - time during which sale is active #. [src.discounts.components.SalePricing.2503204759] - time during which sale is active
#. defaultMessage is: #. defaultMessage is:
@ -5311,6 +5743,14 @@ msgctxt "dialog title"
msgid "Unpublish collections" msgid "Unpublish collections"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.1542600502] - button
#. defaultMessage is:
#. Update rate
msgctxt "button"
msgid "Update rate"
msgstr ""
#: build/locale/src/orders/components/OrderHistory/OrderHistory.json #: build/locale/src/orders/components/OrderHistory/OrderHistory.json
#. [src.orders.components.OrderHistory.4265697648] - order history message #. [src.orders.components.OrderHistory.4265697648] - order history message
#. defaultMessage is: #. defaultMessage is:
@ -5447,6 +5887,14 @@ msgctxt "attribute value"
msgid "Value" msgid "Value"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRates/ShippingZoneRates.json
#. [src.shipping.components.ShippingZoneRates.1923873558] - shipping method price range
#. defaultMessage is:
#. Value Range
msgctxt "shipping method price range"
msgid "Value Range"
msgstr ""
#: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json
#. [src.attributes.components.AttributeDetails.2592224946] - check to require attribute to have value #. [src.attributes.components.AttributeDetails.2592224946] - check to require attribute to have value
#. defaultMessage is: #. defaultMessage is:
@ -5463,6 +5911,14 @@ msgctxt "attribute value deleted"
msgid "Value deleted" msgid "Value deleted"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.2533614652] - order price range
#. defaultMessage is:
#. Value range
msgctxt "order price range"
msgid "Value range"
msgstr ""
#: build/locale/src/products/components/ProductAttributes/ProductAttributes.json #: build/locale/src/products/components/ProductAttributes/ProductAttributes.json
#. [src.products.components.ProductAttributes.1207761269] - attribute values #. [src.products.components.ProductAttributes.1207761269] - attribute values
#. defaultMessage is: #. defaultMessage is:
@ -5611,6 +6067,30 @@ msgctxt "description"
msgid "Weight" msgid "Weight"
msgstr "" msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRates/ShippingZoneRates.json
#. [src.shipping.components.ShippingZoneRates.383202459] - weight based shipping methods, section header
#. defaultMessage is:
#. Weight Based Rates
msgctxt "weight based shipping methods, section header"
msgid "Weight Based Rates"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRates/ShippingZoneRates.json
#. [src.shipping.components.ShippingZoneRates.2600677138] - shipping method weight range
#. defaultMessage is:
#. Weight Range
msgctxt "shipping method weight range"
msgid "Weight Range"
msgstr ""
#: build/locale/src/shipping/components/ShippingZoneRateDialog/ShippingZoneRateDialog.json
#. [src.shipping.components.ShippingZoneRateDialog.2324036635] - order weight range
#. defaultMessage is:
#. Weight range
msgctxt "order weight range"
msgid "Weight range"
msgstr ""
#: build/locale/src/orders/components/OrderPayment/OrderPayment.json #: build/locale/src/orders/components/OrderPayment/OrderPayment.json
#. [orderPaymentVATDoesNotApply] - vat not included in order price #. [orderPaymentVATDoesNotApply] - vat not included in order price
#. defaultMessage is: #. defaultMessage is:

View file

@ -3,12 +3,13 @@ import Card from "@material-ui/core/Card";
import CardActions from "@material-ui/core/CardActions"; import CardActions from "@material-ui/core/CardActions";
import CardContent from "@material-ui/core/CardContent"; import CardContent from "@material-ui/core/CardContent";
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import CardTitle from "@saleor/components/CardTitle"; import CardTitle from "@saleor/components/CardTitle";
import Form from "@saleor/components/Form"; import Form from "@saleor/components/Form";
import Hr from "@saleor/components/Hr"; import Hr from "@saleor/components/Hr";
import SingleSelectField from "@saleor/components/SingleSelectField"; import SingleSelectField from "@saleor/components/SingleSelectField";
import i18n from "../../../i18n"; import { buttonMessages, sectionNames } from "@saleor/intl";
import { WeightUnitsEnum } from "../../../types/globalTypes"; import { WeightUnitsEnum } from "../../../types/globalTypes";
export interface FormData { export interface FormData {
@ -24,6 +25,7 @@ export interface ShippingWeightUnitFormProps {
const ShippingWeightUnitForm: React.StatelessComponent< const ShippingWeightUnitForm: React.StatelessComponent<
ShippingWeightUnitFormProps ShippingWeightUnitFormProps
> = ({ defaultWeightUnit, disabled, onSubmit }) => { > = ({ defaultWeightUnit, disabled, onSubmit }) => {
const intl = useIntl();
const initialForm: FormData = { const initialForm: FormData = {
unit: defaultWeightUnit unit: defaultWeightUnit
}; };
@ -31,11 +33,7 @@ const ShippingWeightUnitForm: React.StatelessComponent<
<Form initial={initialForm} onSubmit={formData => onSubmit(formData.unit)}> <Form initial={initialForm} onSubmit={formData => onSubmit(formData.unit)}>
{({ change, data, submit }) => ( {({ change, data, submit }) => (
<Card> <Card>
<CardTitle <CardTitle title={intl.formatMessage(sectionNames.configuration)} />
title={i18n.t("Configuration", {
context: "header"
})}
/>
<CardContent> <CardContent>
<SingleSelectField <SingleSelectField
disabled={disabled} disabled={disabled}
@ -43,15 +41,13 @@ const ShippingWeightUnitForm: React.StatelessComponent<
label: WeightUnitsEnum[unit], label: WeightUnitsEnum[unit],
value: WeightUnitsEnum[unit] value: WeightUnitsEnum[unit]
}))} }))}
label={i18n.t("Shipping Weight Unit", { label={intl.formatMessage({
context: "input label" defaultMessage: "Shipping Weight Unit"
})}
hint={intl.formatMessage({
defaultMessage:
"This unit will be used as default shipping weight"
})} })}
hint={i18n.t(
"This unit will be used as default shipping weight",
{
context: "input help text"
}
)}
name={"unit" as keyof FormData} name={"unit" as keyof FormData}
value={data.unit} value={data.unit}
onChange={change} onChange={change}
@ -60,9 +56,7 @@ const ShippingWeightUnitForm: React.StatelessComponent<
<Hr /> <Hr />
<CardActions> <CardActions>
<Button color="primary" onClick={submit}> <Button color="primary" onClick={submit}>
{i18n.t("Save", { <FormattedMessage {...buttonMessages.save} />
context: "button"
})}
</Button> </Button>
</CardActions> </CardActions>
</Card> </Card>

View file

@ -17,6 +17,7 @@ import TextField from "@material-ui/core/TextField";
import Typography from "@material-ui/core/Typography"; import Typography from "@material-ui/core/Typography";
import { filter } from "fuzzaldrin"; import { filter } from "fuzzaldrin";
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import Checkbox from "@saleor/components/Checkbox"; import Checkbox from "@saleor/components/Checkbox";
import ConfirmButton, { import ConfirmButton, {
@ -27,7 +28,7 @@ import FormSpacer from "@saleor/components/FormSpacer";
import Hr from "@saleor/components/Hr"; import Hr from "@saleor/components/Hr";
// tslint:disable no-submodule-imports // tslint:disable no-submodule-imports
import { ShopInfo_shop_countries } from "@saleor/components/Shop/types/ShopInfo"; import { ShopInfo_shop_countries } from "@saleor/components/Shop/types/ShopInfo";
import i18n from "../../../i18n"; import { buttonMessages } from "@saleor/intl";
interface FormData { interface FormData {
countries: string[]; countries: string[];
@ -77,6 +78,8 @@ const ShippingZoneCountriesAssignDialog = withStyles(styles, {
initial, initial,
onConfirm onConfirm
}: ShippingZoneCountriesAssignDialogProps & WithStyles<typeof styles>) => { }: ShippingZoneCountriesAssignDialogProps & WithStyles<typeof styles>) => {
const intl = useIntl();
const initialForm: FormData = { const initialForm: FormData = {
countries: initial, countries: initial,
query: "", query: "",
@ -95,23 +98,26 @@ const ShippingZoneCountriesAssignDialog = withStyles(styles, {
return ( return (
<> <>
<DialogTitle>{i18n.t("Assign Countries")}</DialogTitle> <DialogTitle>
<FormattedMessage
defaultMessage="Assign Countries"
description="dialog header"
/>
</DialogTitle>
<DialogContent> <DialogContent>
<Typography> <Typography>
{i18n.t( <FormattedMessage defaultMessage="Choose countries you want to add to shipping zone from list below" />
"Choose countries you want to add to shipping zone from list below"
)}
</Typography> </Typography>
<FormSpacer /> <FormSpacer />
<TextField <TextField
name="query" name="query"
value={data.query} value={data.query}
onChange={event => change(event, () => fetch(data.query))} onChange={event => change(event, () => fetch(data.query))}
label={i18n.t("Search Countries", { label={intl.formatMessage({
context: "country search input label" defaultMessage: "Search Countries"
})} })}
placeholder={i18n.t("Search by country name", { placeholder={intl.formatMessage({
context: "country search input placeholder" defaultMessage: "Search by country name"
})} })}
fullWidth fullWidth
/> />
@ -120,17 +126,15 @@ const ShippingZoneCountriesAssignDialog = withStyles(styles, {
<DialogContent className={classes.container}> <DialogContent className={classes.container}>
<Typography className={classes.heading} variant="subtitle1"> <Typography className={classes.heading} variant="subtitle1">
{i18n.t("Quick Pick")} <FormattedMessage defaultMessage="Quick Pick" />
</Typography> </Typography>
<Table className={classes.table}> <Table className={classes.table}>
<TableBody> <TableBody>
<TableRow> <TableRow>
<TableCell className={classes.wideCell}> <TableCell className={classes.wideCell}>
{i18n.t("Rest of the World")} <FormattedMessage defaultMessage="Rest of the World" />
<Typography variant="caption"> <Typography variant="caption">
{i18n.t( <FormattedMessage defaultMessage="If selected, this will add all of the countries not selected to other shipping zones" />
"If selected, this will add all of the countries not selected to other shipping zones"
)}
</Typography> </Typography>
</TableCell> </TableCell>
<TableCell <TableCell
@ -156,9 +160,10 @@ const ShippingZoneCountriesAssignDialog = withStyles(styles, {
<DialogContent className={classes.container}> <DialogContent className={classes.container}>
<Typography className={classes.heading} variant="subtitle1"> <Typography className={classes.heading} variant="subtitle1">
{i18n.t("Countries A to Z", { <FormattedMessage
context: "country selection" defaultMessage="Countries A to Z"
})} description="country selection"
/>
</Typography> </Typography>
<Table className={classes.table}> <Table className={classes.table}>
<TableBody> <TableBody>
@ -209,7 +214,7 @@ const ShippingZoneCountriesAssignDialog = withStyles(styles, {
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>
<Button onClick={onClose}> <Button onClick={onClose}>
{i18n.t("Cancel", { context: "button" })} <FormattedMessage {...buttonMessages.cancel} />
</Button> </Button>
<ConfirmButton <ConfirmButton
transitionState={confirmButtonState} transitionState={confirmButtonState}
@ -217,7 +222,10 @@ const ShippingZoneCountriesAssignDialog = withStyles(styles, {
variant="contained" variant="contained"
type="submit" type="submit"
> >
{i18n.t("Assign countries", { context: "button" })} <FormattedMessage
defaultMessage="Assign countries"
description="button"
/>
</ConfirmButton> </ConfirmButton>
</DialogActions> </DialogActions>
</> </>

View file

@ -1,4 +1,5 @@
import React from "react"; import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader"; import AppHeader from "@saleor/components/AppHeader";
import CardSpacer from "@saleor/components/CardSpacer"; import CardSpacer from "@saleor/components/CardSpacer";
@ -9,7 +10,7 @@ import Form from "@saleor/components/Form";
import Grid from "@saleor/components/Grid"; import Grid from "@saleor/components/Grid";
import PageHeader from "@saleor/components/PageHeader"; import PageHeader from "@saleor/components/PageHeader";
import SaveButtonBar from "@saleor/components/SaveButtonBar"; import SaveButtonBar from "@saleor/components/SaveButtonBar";
import i18n from "../../../i18n"; import { sectionNames } from "@saleor/intl";
import { CountryFragment } from "../../../taxes/types/CountryFragment"; import { CountryFragment } from "../../../taxes/types/CountryFragment";
import { UserError } from "../../../types"; import { UserError } from "../../../types";
import ShippingZoneCountriesAssignDialog from "../ShippingZoneCountriesAssignDialog"; import ShippingZoneCountriesAssignDialog from "../ShippingZoneCountriesAssignDialog";
@ -33,6 +34,7 @@ export interface ShippingZoneCreatePageProps {
const ShippingZoneCreatePage: React.StatelessComponent< const ShippingZoneCreatePage: React.StatelessComponent<
ShippingZoneCreatePageProps ShippingZoneCreatePageProps
> = ({ countries, disabled, errors, onBack, onSubmit, saveButtonBarState }) => { > = ({ countries, disabled, errors, onBack, onSubmit, saveButtonBarState }) => {
const intl = useIntl();
const [isModalOpened, setModalStatus] = React.useState(false); const [isModalOpened, setModalStatus] = React.useState(false);
const toggleModal = () => setModalStatus(!isModalOpened); const toggleModal = () => setModalStatus(!isModalOpened);
@ -47,8 +49,15 @@ const ShippingZoneCreatePage: React.StatelessComponent<
{({ change, data, errors: formErrors, hasChanged, submit }) => ( {({ change, data, errors: formErrors, hasChanged, submit }) => (
<> <>
<Container> <Container>
<AppHeader onBack={onBack}>{i18n.t("Shipping")}</AppHeader> <AppHeader onBack={onBack}>
<PageHeader title={i18n.t("Create New Shipping Zone")} /> {intl.formatMessage(sectionNames.shipping)}
</AppHeader>
<PageHeader
title={intl.formatMessage({
defaultMessage: "Create New Shipping Zone",
description: "header"
})}
/>
<Grid> <Grid>
<div> <div>
<ShippingZoneInfo <ShippingZoneInfo
@ -64,12 +73,14 @@ const ShippingZoneCreatePage: React.StatelessComponent<
disabled={disabled} disabled={disabled}
emptyText={ emptyText={
data.default data.default
? i18n.t( ? intl.formatMessage({
defaultMessage:
"This is default shipping zone, which means that it covers all of the countries which are not assigned to other shipping zones" "This is default shipping zone, which means that it covers all of the countries which are not assigned to other shipping zones"
) })
: i18n.t( : intl.formatMessage({
defaultMessage:
"Currently, there are no countries assigned to this shipping zone" "Currently, there are no countries assigned to this shipping zone"
) })
} }
onCountryAssign={toggleModal} onCountryAssign={toggleModal}
onCountryUnassign={countryCode => onCountryUnassign={countryCode =>
@ -82,7 +93,9 @@ const ShippingZoneCreatePage: React.StatelessComponent<
} }
} as any) } as any)
} }
title={i18n.t("Countries")} title={intl.formatMessage({
defaultMessage: "Countries"
})}
/> />
</div> </div>
</Grid> </Grid>

View file

@ -1,4 +1,5 @@
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader"; import AppHeader from "@saleor/components/AppHeader";
import CardSpacer from "@saleor/components/CardSpacer"; import CardSpacer from "@saleor/components/CardSpacer";
@ -9,7 +10,6 @@ import Form from "@saleor/components/Form";
import Grid from "@saleor/components/Grid"; import Grid from "@saleor/components/Grid";
import PageHeader from "@saleor/components/PageHeader"; import PageHeader from "@saleor/components/PageHeader";
import SaveButtonBar from "@saleor/components/SaveButtonBar"; import SaveButtonBar from "@saleor/components/SaveButtonBar";
import i18n from "../../../i18n";
import { maybe } from "../../../misc"; import { maybe } from "../../../misc";
import { UserError } from "../../../types"; import { UserError } from "../../../types";
import { ShippingMethodTypeEnum } from "../../../types/globalTypes"; import { ShippingMethodTypeEnum } from "../../../types/globalTypes";
@ -56,6 +56,8 @@ const ShippingZoneDetailsPage: React.StatelessComponent<
saveButtonBarState, saveButtonBarState,
shippingZone shippingZone
}) => { }) => {
const intl = useIntl();
const initialForm: FormData = { const initialForm: FormData = {
name: maybe(() => shippingZone.name, "") name: maybe(() => shippingZone.name, "")
}; };
@ -63,7 +65,9 @@ const ShippingZoneDetailsPage: React.StatelessComponent<
<Form errors={errors} initial={initialForm} onSubmit={onSubmit}> <Form errors={errors} initial={initialForm} onSubmit={onSubmit}>
{({ change, data, errors: formErrors, hasChanged, submit }) => ( {({ change, data, errors: formErrors, hasChanged, submit }) => (
<Container> <Container>
<AppHeader onBack={onBack}>{i18n.t("Shipping")}</AppHeader> <AppHeader onBack={onBack}>
<FormattedMessage defaultMessage="Shipping" />
</AppHeader>
<PageHeader title={maybe(() => shippingZone.name)} /> <PageHeader title={maybe(() => shippingZone.name)} />
<Grid> <Grid>
<div> <div>
@ -79,17 +83,21 @@ const ShippingZoneDetailsPage: React.StatelessComponent<
emptyText={maybe( emptyText={maybe(
() => () =>
shippingZone.default shippingZone.default
? i18n.t( ? intl.formatMessage({
defaultMessage:
"This is default shipping zone, which means that it covers all of the countries which are not assigned to other shipping zones" "This is default shipping zone, which means that it covers all of the countries which are not assigned to other shipping zones"
) })
: i18n.t( : intl.formatMessage({
defaultMessage:
"Currently, there are no countries assigned to this shipping zone" "Currently, there are no countries assigned to this shipping zone"
), }),
"..." "..."
)} )}
onCountryAssign={onCountryAdd} onCountryAssign={onCountryAdd}
onCountryUnassign={onCountryRemove} onCountryUnassign={onCountryRemove}
title={i18n.t("Countries")} title={intl.formatMessage({
defaultMessage: "Countries"
})}
/> />
<CardSpacer /> <CardSpacer />
<ShippingZoneRates <ShippingZoneRates

View file

@ -2,9 +2,10 @@ import Card from "@material-ui/core/Card";
import CardContent from "@material-ui/core/CardContent"; import CardContent from "@material-ui/core/CardContent";
import TextField from "@material-ui/core/TextField"; import TextField from "@material-ui/core/TextField";
import React from "react"; import React from "react";
import { useIntl } from "react-intl";
import CardTitle from "@saleor/components/CardTitle"; import CardTitle from "@saleor/components/CardTitle";
import i18n from "../../../i18n"; import { commonMessages } from "@saleor/intl";
import { FormErrors } from "../../../types"; import { FormErrors } from "../../../types";
import { FormData } from "../ShippingZoneDetailsPage"; import { FormData } from "../ShippingZoneDetailsPage";
@ -18,15 +19,22 @@ const ShippingZoneInfo: React.StatelessComponent<ShippingZoneInfoProps> = ({
data, data,
errors, errors,
onChange onChange
}) => ( }) => {
const intl = useIntl();
return (
<Card> <Card>
<CardTitle title={i18n.t("General Information")} /> <CardTitle
title={intl.formatMessage(commonMessages.generalInformations)}
/>
<CardContent> <CardContent>
<TextField <TextField
error={!!errors.name} error={!!errors.name}
fullWidth fullWidth
helperText={errors.name} helperText={errors.name}
label={i18n.t("Shipping Zone Name")} label={intl.formatMessage({
defaultMessage: "Shipping Zone Name"
})}
name={"name" as keyof FormData} name={"name" as keyof FormData}
value={data.name} value={data.name}
onChange={onChange} onChange={onChange}
@ -34,5 +42,6 @@ const ShippingZoneInfo: React.StatelessComponent<ShippingZoneInfoProps> = ({
</CardContent> </CardContent>
</Card> </Card>
); );
};
ShippingZoneInfo.displayName = "ShippingZoneInfo"; ShippingZoneInfo.displayName = "ShippingZoneInfo";
export default ShippingZoneInfo; export default ShippingZoneInfo;

View file

@ -12,6 +12,7 @@ import {
import TextField from "@material-ui/core/TextField"; import TextField from "@material-ui/core/TextField";
import Typography from "@material-ui/core/Typography"; import Typography from "@material-ui/core/Typography";
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import ConfirmButton, { import ConfirmButton, {
ConfirmButtonTransitionState ConfirmButtonTransitionState
@ -21,7 +22,7 @@ import Form from "@saleor/components/Form";
import FormSpacer from "@saleor/components/FormSpacer"; import FormSpacer from "@saleor/components/FormSpacer";
import Hr from "@saleor/components/Hr"; import Hr from "@saleor/components/Hr";
import Skeleton from "@saleor/components/Skeleton"; import Skeleton from "@saleor/components/Skeleton";
import i18n from "../../../i18n"; import { buttonMessages } from "@saleor/intl";
import { maybe } from "../../../misc"; import { maybe } from "../../../misc";
import { FormErrors, UserError } from "../../../types"; import { FormErrors, UserError } from "../../../types";
import { ShippingMethodTypeEnum } from "../../../types/globalTypes"; import { ShippingMethodTypeEnum } from "../../../types/globalTypes";
@ -77,6 +78,8 @@ const ShippingZoneRateDialog = withStyles(styles, {
rate, rate,
variant variant
}: ShippingZoneRateDialogProps & WithStyles<typeof styles>) => { }: ShippingZoneRateDialogProps & WithStyles<typeof styles>) => {
const intl = useIntl();
const initialForm: FormData = const initialForm: FormData =
action === "create" action === "create"
? { ? {
@ -122,11 +125,25 @@ const ShippingZoneRateDialog = withStyles(styles, {
<DialogTitle> <DialogTitle>
{variant === ShippingMethodTypeEnum.PRICE {variant === ShippingMethodTypeEnum.PRICE
? action === "create" ? action === "create"
? i18n.t("Add Price Rate") ? intl.formatMessage({
: i18n.t("Edit Price Rate") defaultMessage: "Add Price Rate",
description: "dialog header"
})
: intl.formatMessage({
defaultMessage: "Edit Price Rate",
description: "dialog header"
})
: action === "create" : action === "create"
? i18n.t("Add Weight Rate") ? intl.formatMessage({
: i18n.t("Edit Weight Rate")} defaultMessage: "Add Weight Rate",
description:
"add weight based shipping method, dialog header"
})
: intl.formatMessage({
defaultMessage: "Edit Weight Rate",
description:
"edit weight based shipping method, dialog header"
})}
</DialogTitle> </DialogTitle>
<DialogContent> <DialogContent>
<TextField <TextField
@ -135,9 +152,15 @@ const ShippingZoneRateDialog = withStyles(styles, {
fullWidth fullWidth
helperText={ helperText={
typedFormErrors.name || typedFormErrors.name ||
i18n.t("This will be shown to customers at checkout") intl.formatMessage({
defaultMessage:
"This will be shown to customers at checkout"
})
} }
label={i18n.t("Rate Name")} label={intl.formatMessage({
defaultMessage: "Rate Name",
description: "shipping method name"
})}
name={"name" as keyof FormData} name={"name" as keyof FormData}
value={data.name} value={data.name}
onChange={change} onChange={change}
@ -152,8 +175,14 @@ const ShippingZoneRateDialog = withStyles(styles, {
variant="subtitle1" variant="subtitle1"
> >
{variant === ShippingMethodTypeEnum.PRICE {variant === ShippingMethodTypeEnum.PRICE
? i18n.t("Value range") ? intl.formatMessage({
: i18n.t("Weight range")} defaultMessage: "Value range",
description: "order price range"
})
: intl.formatMessage({
defaultMessage: "Weight range",
description: "order weight range"
})}
</Typography> </Typography>
<ControlledSwitch <ControlledSwitch
checked={data.noLimits} checked={data.noLimits}
@ -161,15 +190,20 @@ const ShippingZoneRateDialog = withStyles(styles, {
onChange={change} onChange={change}
label={ label={
<> <>
{i18n.t("There are no value limits")} <FormattedMessage
defaultMessage="There are no value limits"
description="shipping method has no value limits"
/>
<Typography variant="caption"> <Typography variant="caption">
{variant === ShippingMethodTypeEnum.PRICE {variant === ShippingMethodTypeEnum.PRICE
? i18n.t( ? intl.formatMessage({
defaultMessage:
"This rate will apply to all orders of all prices" "This rate will apply to all orders of all prices"
) })
: i18n.t( : intl.formatMessage({
defaultMessage:
"This rate will apply to all orders of all weights" "This rate will apply to all orders of all weights"
)} })}
</Typography> </Typography>
</> </>
} }
@ -194,9 +228,13 @@ const ShippingZoneRateDialog = withStyles(styles, {
label={ label={
variant === ShippingMethodTypeEnum.PRICE variant === ShippingMethodTypeEnum.PRICE
? typedFormErrors.minimumOrderPrice || ? typedFormErrors.minimumOrderPrice ||
i18n.t("Minimal Order Value") intl.formatMessage({
defaultMessage: "Minimal Order Value"
})
: typedFormErrors.minimumOrderWeight || : typedFormErrors.minimumOrderWeight ||
i18n.t("Minimal Order Weight") intl.formatMessage({
defaultMessage: "Minimal Order Weight"
})
} }
name={"minValue" as keyof FormData} name={"minValue" as keyof FormData}
type="number" type="number"
@ -219,9 +257,13 @@ const ShippingZoneRateDialog = withStyles(styles, {
label={ label={
variant === ShippingMethodTypeEnum.PRICE variant === ShippingMethodTypeEnum.PRICE
? typedFormErrors.maximumOrderPrice || ? typedFormErrors.maximumOrderPrice ||
i18n.t("Maximal Order Value") intl.formatMessage({
defaultMessage: "Maximal Order Value"
})
: typedFormErrors.maximumOrderWeight || : typedFormErrors.maximumOrderWeight ||
i18n.t("Maximal Order Weight") intl.formatMessage({
defaultMessage: "Maximal Order Weight"
})
} }
name={"maxValue" as keyof FormData} name={"maxValue" as keyof FormData}
type="number" type="number"
@ -242,12 +284,18 @@ const ShippingZoneRateDialog = withStyles(styles, {
className={classes.subheading} className={classes.subheading}
variant="subtitle1" variant="subtitle1"
> >
{i18n.t("Rate")} <FormattedMessage
defaultMessage="Rate"
description="shipping method"
/>
</Typography> </Typography>
<ControlledSwitch <ControlledSwitch
checked={data.isFree} checked={data.isFree}
disabled={disabled} disabled={disabled}
label={i18n.t("This is free shipping")} label={intl.formatMessage({
defaultMessage: "This is free shipping",
description: "shipping method, switch button"
})}
name={"isFree" as keyof FormData} name={"isFree" as keyof FormData}
onChange={change} onChange={change}
/> />
@ -260,7 +308,10 @@ const ShippingZoneRateDialog = withStyles(styles, {
error={!!typedFormErrors.price} error={!!typedFormErrors.price}
fullWidth fullWidth
helperText={typedFormErrors.price} helperText={typedFormErrors.price}
label={i18n.t("Rate Price")} label={intl.formatMessage({
defaultMessage: "Rate Price",
description: "shipping method price"
})}
name={"price" as keyof FormData} name={"price" as keyof FormData}
type="number" type="number"
value={data.price} value={data.price}
@ -275,7 +326,7 @@ const ShippingZoneRateDialog = withStyles(styles, {
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>
<Button onClick={onClose}> <Button onClick={onClose}>
{i18n.t("Cancel", { context: "button" })} <FormattedMessage {...buttonMessages.cancel} />
</Button> </Button>
<ConfirmButton <ConfirmButton
disabled={disabled || !hasChanged} disabled={disabled || !hasChanged}
@ -285,8 +336,14 @@ const ShippingZoneRateDialog = withStyles(styles, {
type="submit" type="submit"
> >
{action === "create" {action === "create"
? i18n.t("Create rate", { context: "button" }) ? intl.formatMessage({
: i18n.t("Update rate", { context: "button" })} defaultMessage: "Create rate",
description: "button"
})
: intl.formatMessage({
defaultMessage: "Update rate",
description: "button"
})}
</ConfirmButton> </ConfirmButton>
</DialogActions> </DialogActions>
</> </>

View file

@ -14,6 +14,7 @@ import TableRow from "@material-ui/core/TableRow";
import DeleteIcon from "@material-ui/icons/Delete"; import DeleteIcon from "@material-ui/icons/Delete";
import EditIcon from "@material-ui/icons/Edit"; import EditIcon from "@material-ui/icons/Edit";
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import CardTitle from "@saleor/components/CardTitle"; import CardTitle from "@saleor/components/CardTitle";
import IconButtonTableCell from "@saleor/components/IconButtonTableCell"; import IconButtonTableCell from "@saleor/components/IconButtonTableCell";
@ -21,7 +22,6 @@ import Money from "@saleor/components/Money";
import MoneyRange from "@saleor/components/MoneyRange"; import MoneyRange from "@saleor/components/MoneyRange";
import Skeleton from "@saleor/components/Skeleton"; import Skeleton from "@saleor/components/Skeleton";
import WeightRange from "@saleor/components/WeightRange"; import WeightRange from "@saleor/components/WeightRange";
import i18n from "../../../i18n";
import { maybe, renderCollection } from "../../../misc"; import { maybe, renderCollection } from "../../../misc";
import { ICONBUTTON_SIZE } from "../../../theme"; import { ICONBUTTON_SIZE } from "../../../theme";
import { ShippingZoneDetailsFragment_shippingMethods } from "../../types/ShippingZoneDetailsFragment"; import { ShippingZoneDetailsFragment_shippingMethods } from "../../types/ShippingZoneDetailsFragment";
@ -60,20 +60,30 @@ const ShippingZoneRates = withStyles(styles, { name: "ShippingZoneRates" })(
onRateRemove, onRateRemove,
rates, rates,
variant variant
}: ShippingZoneRatesProps & WithStyles<typeof styles>) => ( }: ShippingZoneRatesProps & WithStyles<typeof styles>) => {
const intl = useIntl();
return (
<Card> <Card>
<CardTitle <CardTitle
height="const" height="const"
title={ title={
variant === "price" variant === "price"
? i18n.t("Price Based Rates") ? intl.formatMessage({
: i18n.t("Weight Based Rates") defaultMessage: "Price Based Rates",
description: "price based shipping methods, section header"
})
: intl.formatMessage({
defaultMessage: "Weight Based Rates",
description: "weight based shipping methods, section header"
})
} }
toolbar={ toolbar={
<Button color="primary" onClick={onRateAdd}> <Button color="primary" onClick={onRateAdd}>
{i18n.t("Add rate", { <FormattedMessage
context: "button" defaultMessage="Add rate"
})} description="button"
/>
</Button> </Button>
} }
/> />
@ -81,15 +91,27 @@ const ShippingZoneRates = withStyles(styles, { name: "ShippingZoneRates" })(
<TableHead> <TableHead>
<TableRow> <TableRow>
<TableCell className={classes.nameColumn}> <TableCell className={classes.nameColumn}>
{i18n.t("Name", { context: "object" })} <FormattedMessage
defaultMessage="Name"
description="shipping method name"
/>
</TableCell> </TableCell>
<TableCell className={classes.valueColumn}> <TableCell className={classes.valueColumn}>
{variant === "price" {variant === "price"
? i18n.t("Value Range", { context: "object" }) ? intl.formatMessage({
: i18n.t("Weight Range", { context: "object" })} defaultMessage: "Value Range",
description: "shipping method price range"
})
: intl.formatMessage({
defaultMessage: "Weight Range",
description: "shipping method weight range"
})}
</TableCell> </TableCell>
<TableCell className={classes.nameColumn}> <TableCell className={classes.nameColumn}>
{i18n.t("Price", { context: "object" })} <FormattedMessage
defaultMessage="Price"
description="shipping method price"
/>
</TableCell> </TableCell>
<TableCell /> <TableCell />
<TableCell /> <TableCell />
@ -149,7 +171,7 @@ const ShippingZoneRates = withStyles(styles, { name: "ShippingZoneRates" })(
() => ( () => (
<TableRow> <TableRow>
<TableCell colSpan={5}> <TableCell colSpan={5}>
{i18n.t("No shipping rates found")} <FormattedMessage defaultMessage="No shipping rates found" />
</TableCell> </TableCell>
</TableRow> </TableRow>
) )
@ -157,7 +179,8 @@ const ShippingZoneRates = withStyles(styles, { name: "ShippingZoneRates" })(
</TableBody> </TableBody>
</Table> </Table>
</Card> </Card>
) );
}
); );
ShippingZoneRates.displayName = "ShippingZoneRates"; ShippingZoneRates.displayName = "ShippingZoneRates";
export default ShippingZoneRates; export default ShippingZoneRates;

View file

@ -14,13 +14,13 @@ import TableFooter from "@material-ui/core/TableFooter";
import TableRow from "@material-ui/core/TableRow"; import TableRow from "@material-ui/core/TableRow";
import DeleteIcon from "@material-ui/icons/Delete"; import DeleteIcon from "@material-ui/icons/Delete";
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import CardTitle from "@saleor/components/CardTitle"; import CardTitle from "@saleor/components/CardTitle";
import Checkbox from "@saleor/components/Checkbox"; import Checkbox from "@saleor/components/Checkbox";
import Skeleton from "@saleor/components/Skeleton"; import Skeleton from "@saleor/components/Skeleton";
import TableHead from "@saleor/components/TableHead"; import TableHead from "@saleor/components/TableHead";
import TablePagination from "@saleor/components/TablePagination"; import TablePagination from "@saleor/components/TablePagination";
import i18n from "@saleor/i18n";
import { maybe, renderCollection } from "@saleor/misc"; import { maybe, renderCollection } from "@saleor/misc";
import { ICONBUTTON_SIZE } from "@saleor/theme"; import { ICONBUTTON_SIZE } from "@saleor/theme";
import { ListActions, ListProps } from "@saleor/types"; import { ListActions, ListProps } from "@saleor/types";
@ -71,16 +71,23 @@ const ShippingZonesList = withStyles(styles, { name: "ShippingZonesList" })(
toggle, toggle,
toggleAll, toggleAll,
toolbar toolbar
}: ShippingZonesListProps & WithStyles<typeof styles>) => ( }: ShippingZonesListProps & WithStyles<typeof styles>) => {
const intl = useIntl();
return (
<Card> <Card>
<CardTitle <CardTitle
height="const" height="const"
title={i18n.t("Shipping by zone")} title={intl.formatMessage({
defaultMessage: "Shipping by zone",
description: "sort shipping methods by zone, section header"
})}
toolbar={ toolbar={
<Button color="primary" onClick={onAdd}> <Button color="primary" onClick={onAdd}>
{i18n.t("Add shipping zone", { <FormattedMessage
context: "button" defaultMessage="Add shipping zone"
})} description="button"
/>
</Button> </Button>
} }
/> />
@ -94,10 +101,13 @@ const ShippingZonesList = withStyles(styles, { name: "ShippingZonesList" })(
toolbar={toolbar} toolbar={toolbar}
> >
<TableCell className={classes.colName}> <TableCell className={classes.colName}>
{i18n.t("Name", { context: "object" })} <FormattedMessage
defaultMessage="Name"
description="shipping zone"
/>
</TableCell> </TableCell>
<TableCell className={classes.colCountries}> <TableCell className={classes.colCountries}>
{i18n.t("Countries", { context: "object" })} <FormattedMessage defaultMessage="Countries" />
</TableCell> </TableCell>
<TableCell /> <TableCell />
</TableHead> </TableHead>
@ -106,7 +116,9 @@ const ShippingZonesList = withStyles(styles, { name: "ShippingZonesList" })(
<TablePagination <TablePagination
colSpan={4} colSpan={4}
settings={settings} settings={settings}
hasNextPage={pageInfo && !disabled ? pageInfo.hasNextPage : false} hasNextPage={
pageInfo && !disabled ? pageInfo.hasNextPage : false
}
onNextPage={onNextPage} onNextPage={onNextPage}
onUpdateListSettings={onUpdateListSettings} onUpdateListSettings={onUpdateListSettings}
hasPreviousPage={ hasPreviousPage={
@ -170,7 +182,7 @@ const ShippingZonesList = withStyles(styles, { name: "ShippingZonesList" })(
() => ( () => (
<TableRow> <TableRow>
<TableCell colSpan={numberOfColumns}> <TableCell colSpan={numberOfColumns}>
{i18n.t("No shipping zones found")} <FormattedMessage defaultMessage="No shipping zones found" />
</TableCell> </TableCell>
</TableRow> </TableRow>
) )
@ -178,7 +190,8 @@ const ShippingZonesList = withStyles(styles, { name: "ShippingZonesList" })(
</TableBody> </TableBody>
</Table> </Table>
</Card> </Card>
) );
}
); );
ShippingZonesList.displayName = "ShippingZonesList"; ShippingZonesList.displayName = "ShippingZonesList";
export default ShippingZonesList; export default ShippingZonesList;

View file

@ -1,10 +1,11 @@
import React from "react"; import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader"; import AppHeader from "@saleor/components/AppHeader";
import Container from "@saleor/components/Container"; import Container from "@saleor/components/Container";
import Grid from "@saleor/components/Grid"; import Grid from "@saleor/components/Grid";
import PageHeader from "@saleor/components/PageHeader"; import PageHeader from "@saleor/components/PageHeader";
import i18n from "@saleor/i18n"; import { sectionNames } from "@saleor/intl";
import { ListActions, PageListProps } from "@saleor/types"; import { ListActions, PageListProps } from "@saleor/types";
import { WeightUnitsEnum } from "@saleor/types/globalTypes"; import { WeightUnitsEnum } from "@saleor/types/globalTypes";
import { ShippingZoneFragment } from "../../types/ShippingZoneFragment"; import { ShippingZoneFragment } from "../../types/ShippingZoneFragment";
@ -21,12 +22,18 @@ export interface ShippingZonesListPageProps extends PageListProps, ListActions {
const ShippingZonesListPage: React.StatelessComponent< const ShippingZonesListPage: React.StatelessComponent<
ShippingZonesListPageProps ShippingZonesListPageProps
> = ({ defaultWeightUnit, disabled, onBack, onSubmit, ...listProps }) => ( > = ({ defaultWeightUnit, disabled, onBack, onSubmit, ...listProps }) => {
const intl = useIntl();
return (
<Container> <Container>
<AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader> <AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.configuration)}
</AppHeader>
<PageHeader <PageHeader
title={i18n.t("Shipping", { title={intl.formatMessage({
context: "page header" defaultMessage: "Shipping",
description: "header"
})} })}
/> />
<Grid> <Grid>
@ -43,5 +50,6 @@ const ShippingZonesListPage: React.StatelessComponent<
</Grid> </Grid>
</Container> </Container>
); );
};
ShippingZonesListPage.displayName = "ShippingZonesListPage"; ShippingZonesListPage.displayName = "ShippingZonesListPage";
export default ShippingZonesListPage; export default ShippingZonesListPage;

View file

@ -1,9 +1,10 @@
import { parse as parseQs } from "qs"; import { parse as parseQs } from "qs";
import React from "react"; import React from "react";
import { useIntl } from "react-intl";
import { Route, RouteComponentProps, Switch } from "react-router-dom"; import { Route, RouteComponentProps, Switch } from "react-router-dom";
import { sectionNames } from "@saleor/intl";
import { WindowTitle } from "../components/WindowTitle"; import { WindowTitle } from "../components/WindowTitle";
import i18n from "../i18n";
import { import {
shippingZoneAddPath, shippingZoneAddPath,
shippingZonePath, shippingZonePath,
@ -39,14 +40,26 @@ const ShippingZoneDetails: React.StatelessComponent<
); );
}; };
export const ShippingRouter: React.StatelessComponent = () => ( export const ShippingRouter: React.FC = () => {
const intl = useIntl();
return (
<> <>
<WindowTitle title={i18n.t("Shipping")} /> <WindowTitle title={intl.formatMessage(sectionNames.shipping)} />
<Switch> <Switch>
<Route exact path={shippingZonesListPath} component={ShippingZonesList} /> <Route
<Route exact path={shippingZoneAddPath} component={ShippingZoneCreate} /> exact
path={shippingZonesListPath}
component={ShippingZonesList}
/>
<Route
exact
path={shippingZoneAddPath}
component={ShippingZoneCreate}
/>
<Route path={shippingZonePath(":id")} component={ShippingZoneDetails} /> <Route path={shippingZonePath(":id")} component={ShippingZoneDetails} />
</Switch> </Switch>
</> </>
); );
};
export default ShippingRouter; export default ShippingRouter;

View file

@ -1,9 +1,10 @@
import React from "react"; import React from "react";
import { useIntl } from "react-intl";
import useNavigator from "@saleor/hooks/useNavigator"; import useNavigator from "@saleor/hooks/useNavigator";
import useNotifier from "@saleor/hooks/useNotifier"; import useNotifier from "@saleor/hooks/useNotifier";
import useShop from "@saleor/hooks/useShop"; import useShop from "@saleor/hooks/useShop";
import i18n from "../../i18n"; import { commonMessages } from "@saleor/intl";
import { getMutationState, maybe } from "../../misc"; import { getMutationState, maybe } from "../../misc";
import ShippingZoneCreatePage from "../components/ShippingZoneCreatePage"; import ShippingZoneCreatePage from "../components/ShippingZoneCreatePage";
import { TypedCreateShippingZone } from "../mutations"; import { TypedCreateShippingZone } from "../mutations";
@ -14,13 +15,12 @@ const ShippingZoneCreate: React.StatelessComponent<{}> = () => {
const navigate = useNavigator(); const navigate = useNavigator();
const pushMessage = useNotifier(); const pushMessage = useNotifier();
const shop = useShop(); const shop = useShop();
const intl = useIntl();
const onShippingZoneCreate = (data: CreateShippingZone) => { const onShippingZoneCreate = (data: CreateShippingZone) => {
if (data.shippingZoneCreate.errors.length === 0) { if (data.shippingZoneCreate.errors.length === 0) {
pushMessage({ pushMessage({
text: i18n.t("Successfully created new shipping zone", { text: intl.formatMessage(commonMessages.savedChanges)
context: "notification"
})
}); });
navigate(shippingZoneUrl(data.shippingZoneCreate.shippingZone.id)); navigate(shippingZoneUrl(data.shippingZoneCreate.shippingZone.id));
} }

View file

@ -1,11 +1,11 @@
import DialogContentText from "@material-ui/core/DialogContentText"; import DialogContentText from "@material-ui/core/DialogContentText";
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import ActionDialog from "@saleor/components/ActionDialog"; import ActionDialog from "@saleor/components/ActionDialog";
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton"; import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
import useNavigator from "@saleor/hooks/useNavigator"; import useNavigator from "@saleor/hooks/useNavigator";
import useShop from "@saleor/hooks/useShop"; import useShop from "@saleor/hooks/useShop";
import i18n from "../../../i18n";
import { maybe } from "../../../misc"; import { maybe } from "../../../misc";
import { ShippingMethodTypeEnum } from "../../../types/globalTypes"; import { ShippingMethodTypeEnum } from "../../../types/globalTypes";
import ShippingZoneCountriesAssignDialog from "../../components/ShippingZoneCountriesAssignDialog"; import ShippingZoneCountriesAssignDialog from "../../components/ShippingZoneCountriesAssignDialog";
@ -43,6 +43,7 @@ const ShippingZoneDetailsDialogs: React.StatelessComponent<
}) => { }) => {
const navigate = useNavigator(); const navigate = useNavigator();
const shop = useShop(); const shop = useShop();
const intl = useIntl();
const closeModal = () => navigate(shippingZoneUrl(id), true); const closeModal = () => navigate(shippingZoneUrl(id), true);
@ -92,20 +93,22 @@ const ShippingZoneDetailsDialogs: React.StatelessComponent<
}) })
} }
open={params.action === "remove-rate"} open={params.action === "remove-rate"}
title={i18n.t("Delete Shipping Method")} title={intl.formatMessage({
defaultMessage: "Delete Shipping Method",
description: "dialog header"
})}
variant="delete" variant="delete"
> >
<DialogContentText <DialogContentText>
dangerouslySetInnerHTML={{ <FormattedMessage
__html: i18n.t( defaultMessage="Are you sure you want to delete {name}?"
"Are you sure you want to delete <strong>{{ name }}</strong>?", description="delete shipping method"
{ id="shippingZoneDetailsDialogsDeleteShippingMethod"
context: "remove shipping method", values={{
name: maybe(() => rate.name, "...") name: maybe(() => rate.name, "...")
}
)
}} }}
/> />
</DialogContentText>
</ActionDialog> </ActionDialog>
<ShippingZoneRateDialog <ShippingZoneRateDialog
action="create" action="create"
@ -165,20 +168,22 @@ const ShippingZoneDetailsDialogs: React.StatelessComponent<
}) })
} }
open={params.action === "remove"} open={params.action === "remove"}
title={i18n.t("Delete Shipping Zone")} title={intl.formatMessage({
defaultMessage: "Delete Shipping Zone",
description: "dialog header"
})}
variant="delete" variant="delete"
> >
<DialogContentText <DialogContentText>
dangerouslySetInnerHTML={{ <FormattedMessage
__html: i18n.t( defaultMessage="Are you sure you want to delete {name}?"
"Are you sure you want to delete <strong>{{ name }}</strong>?", description="delete shipping zone"
{ id="shippingZoneDetailsDialogsDeleteShippingZone"
context: "remove shipping zone", values={{
name: maybe(() => shippingZone.name) name: <strong>{maybe(() => shippingZone.name, "...")}</strong>
}
)
}} }}
/> />
</DialogContentText>
</ActionDialog> </ActionDialog>
<ShippingZoneCountriesAssignDialog <ShippingZoneCountriesAssignDialog
confirmButtonState={assignCountryTransitionState} confirmButtonState={assignCountryTransitionState}
@ -214,25 +219,31 @@ const ShippingZoneDetailsDialogs: React.StatelessComponent<
}) })
} }
open={params.action === "unassign-country"} open={params.action === "unassign-country"}
title={i18n.t("Remove from shipping zone")} title={intl.formatMessage({
defaultMessage: "Remove from shipping zone",
description: "unassign country, dialog header"
})}
variant="delete" variant="delete"
> >
<DialogContentText <DialogContentText>
dangerouslySetInnerHTML={{ <FormattedMessage
__html: i18n.t( defaultMessage="Are you sure you want to remove {countryName} from this shipping zone?"
"Are you sure you want to remove <strong>{{ name }}</strong> from this shipping zone?", description="unassign country"
{ values={{
context: "unassign country", countryName: (
name: maybe( <strong>
{maybe(
() => () =>
shippingZone.countries.find( shippingZone.countries.find(
country => country.code === params.id country => country.code === params.id
).country ).country,
) "..."
} )}
</strong>
) )
}} }}
/> />
</DialogContentText>
</ActionDialog> </ActionDialog>
</> </>
); );

View file

@ -1,8 +1,9 @@
import React from "react"; import React from "react";
import { useIntl } from "react-intl";
import useNavigator from "@saleor/hooks/useNavigator"; import useNavigator from "@saleor/hooks/useNavigator";
import useNotifier from "@saleor/hooks/useNotifier"; import useNotifier from "@saleor/hooks/useNotifier";
import i18n from "../../../i18n"; import { commonMessages } from "@saleor/intl";
import { getMutationState, maybe } from "../../../misc"; import { getMutationState, maybe } from "../../../misc";
import { ShippingMethodTypeEnum } from "../../../types/globalTypes"; import { ShippingMethodTypeEnum } from "../../../types/globalTypes";
import ShippingZoneDetailsPage from "../../components/ShippingZoneDetailsPage"; import ShippingZoneDetailsPage from "../../components/ShippingZoneDetailsPage";
@ -30,15 +31,14 @@ const ShippingZoneDetails: React.StatelessComponent<
> = ({ id, params }) => { > = ({ id, params }) => {
const navigate = useNavigator(); const navigate = useNavigator();
const notify = useNotifier(); const notify = useNotifier();
const intl = useIntl();
const closeModal = () => navigate(shippingZoneUrl(id)); const closeModal = () => navigate(shippingZoneUrl(id));
const onShippingRateCreate = (data: CreateShippingRate) => { const onShippingRateCreate = (data: CreateShippingRate) => {
if (data.shippingPriceCreate.errors.length === 0) { if (data.shippingPriceCreate.errors.length === 0) {
notify({ notify({
text: i18n.t("Successfully created rate", { text: intl.formatMessage(commonMessages.savedChanges)
context: "shipping method"
})
}); });
closeModal(); closeModal();
} }
@ -47,9 +47,7 @@ const ShippingZoneDetails: React.StatelessComponent<
const onShippingRateUpdate = (data: UpdateShippingRate) => { const onShippingRateUpdate = (data: UpdateShippingRate) => {
if (data.shippingPriceUpdate.errors.length === 0) { if (data.shippingPriceUpdate.errors.length === 0) {
notify({ notify({
text: i18n.t("Successfully updated rate", { text: intl.formatMessage(commonMessages.savedChanges)
context: "shipping method"
})
}); });
closeModal(); closeModal();
} }
@ -58,9 +56,7 @@ const ShippingZoneDetails: React.StatelessComponent<
const onShippingRateDelete = (data: DeleteShippingRate) => { const onShippingRateDelete = (data: DeleteShippingRate) => {
if (data.shippingPriceDelete.errors.length === 0) { if (data.shippingPriceDelete.errors.length === 0) {
notify({ notify({
text: i18n.t("Successfully deleted rate", { text: intl.formatMessage(commonMessages.savedChanges)
context: "shipping method"
})
}); });
closeModal(); closeModal();
} }
@ -69,7 +65,7 @@ const ShippingZoneDetails: React.StatelessComponent<
const onShippingZoneDelete = (data: DeleteShippingZone) => { const onShippingZoneDelete = (data: DeleteShippingZone) => {
if (data.shippingZoneDelete.errors.length === 0) { if (data.shippingZoneDelete.errors.length === 0) {
notify({ notify({
text: i18n.t("Successfully deleted shipping zone") text: intl.formatMessage(commonMessages.savedChanges)
}); });
navigate(shippingZonesListUrl(), true); navigate(shippingZonesListUrl(), true);
} }
@ -78,7 +74,7 @@ const ShippingZoneDetails: React.StatelessComponent<
const onShippingZoneUpdate = (data: UpdateShippingZone) => { const onShippingZoneUpdate = (data: UpdateShippingZone) => {
if (data.shippingZoneUpdate.errors.length === 0) { if (data.shippingZoneUpdate.errors.length === 0) {
notify({ notify({
text: i18n.t("Successfully updated shipping zone") text: intl.formatMessage(commonMessages.savedChanges)
}); });
closeModal(); closeModal();
} }

View file

@ -2,6 +2,7 @@ import DialogContentText from "@material-ui/core/DialogContentText";
import IconButton from "@material-ui/core/IconButton"; import IconButton from "@material-ui/core/IconButton";
import DeleteIcon from "@material-ui/icons/Delete"; import DeleteIcon from "@material-ui/icons/Delete";
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import ActionDialog from "@saleor/components/ActionDialog"; import ActionDialog from "@saleor/components/ActionDialog";
import { configurationMenuUrl } from "@saleor/configuration"; import { configurationMenuUrl } from "@saleor/configuration";
@ -13,7 +14,7 @@ import usePaginator, {
createPaginationState createPaginationState
} from "@saleor/hooks/usePaginator"; } from "@saleor/hooks/usePaginator";
import useShop from "@saleor/hooks/useShop"; import useShop from "@saleor/hooks/useShop";
import i18n from "@saleor/i18n"; import { commonMessages } from "@saleor/intl";
import { getMutationState, maybe } from "@saleor/misc"; import { getMutationState, maybe } from "@saleor/misc";
import { ListViews } from "@saleor/types"; import { ListViews } from "@saleor/types";
import ShippingZonesListPage from "../components/ShippingZonesListPage"; import ShippingZonesListPage from "../components/ShippingZonesListPage";
@ -50,6 +51,7 @@ export const ShippingZonesList: React.StatelessComponent<
const { updateListSettings, settings } = useListSettings( const { updateListSettings, settings } = useListSettings(
ListViews.SHIPPING_METHODS_LIST ListViews.SHIPPING_METHODS_LIST
); );
const intl = useIntl();
const paginationState = createPaginationState(settings.rowNumber, params); const paginationState = createPaginationState(settings.rowNumber, params);
@ -61,9 +63,7 @@ export const ShippingZonesList: React.StatelessComponent<
) => { ) => {
if (data.shopSettingsUpdate.errors.length === 0) { if (data.shopSettingsUpdate.errors.length === 0) {
notify({ notify({
text: i18n.t("Updated default weight unit", { text: intl.formatMessage(commonMessages.savedChanges)
context: "notification"
})
}); });
} }
}; };
@ -81,9 +81,7 @@ export const ShippingZonesList: React.StatelessComponent<
const handleShippingZoneDelete = (data: DeleteShippingZone) => { const handleShippingZoneDelete = (data: DeleteShippingZone) => {
if (data.shippingZoneDelete.errors.length === 0) { if (data.shippingZoneDelete.errors.length === 0) {
notify({ notify({
text: i18n.t("Updated default weight unit", { text: intl.formatMessage(commonMessages.savedChanges)
context: "notification"
})
}); });
closeModal(); closeModal();
refetch(); refetch();
@ -93,9 +91,7 @@ export const ShippingZonesList: React.StatelessComponent<
const handleBulkDeleteShippingZone = (data: BulkDeleteShippingZone) => { const handleBulkDeleteShippingZone = (data: BulkDeleteShippingZone) => {
if (data.shippingZoneBulkDelete.errors.length === 0) { if (data.shippingZoneBulkDelete.errors.length === 0) {
notify({ notify({
text: i18n.t("Removed shipping zones", { text: intl.formatMessage(commonMessages.savedChanges)
context: "notification"
})
}); });
closeModal(); closeModal();
reset(); reset();
@ -205,8 +201,9 @@ export const ShippingZonesList: React.StatelessComponent<
open={params.action === "remove"} open={params.action === "remove"}
confirmButtonState={deleteTransitionState} confirmButtonState={deleteTransitionState}
variant="delete" variant="delete"
title={i18n.t("Delete Shipping Zone", { title={intl.formatMessage({
context: "modal title" defaultMessage: "Delete Shipping Zone",
description: "dialog header"
})} })}
onClose={closeModal} onClose={closeModal}
onConfirm={() => onConfirm={() =>
@ -215,30 +212,32 @@ export const ShippingZonesList: React.StatelessComponent<
}) })
} }
> >
<DialogContentText <DialogContentText>
dangerouslySetInnerHTML={{ <FormattedMessage
__html: i18n.t( defaultMessage="Are you sure you want to delete {shippingZoneName} shipping zone?"
"Are you sure you want to remove <strong>{{ name }}</strong> shipping zone?", values={{
{ shippingZoneName: (
context: "shipping zone removal", <strong>
name: maybe( {maybe(
() => () =>
data.shippingZones.edges.find( data.shippingZones.edges.find(
edge => edge.node.id === params.id edge => edge.node.id === params.id
).node.name, ).node.name,
"..." "..."
) )}
} </strong>
) )
}} }}
/> />
</DialogContentText>
</ActionDialog> </ActionDialog>
<ActionDialog <ActionDialog
open={params.action === "remove-many"} open={params.action === "remove-many"}
confirmButtonState={bulkDeleteTransitionState} confirmButtonState={bulkDeleteTransitionState}
variant="delete" variant="delete"
title={i18n.t("Delete Shipping Zones", { title={intl.formatMessage({
context: "modal title" defaultMessage: "Delete Shipping Zones",
description: "dialog header"
})} })}
onClose={closeModal} onClose={closeModal}
onConfirm={() => onConfirm={() =>
@ -247,19 +246,23 @@ export const ShippingZonesList: React.StatelessComponent<
}) })
} }
> >
<DialogContentText <DialogContentText>
dangerouslySetInnerHTML={{ <FormattedMessage
__html: i18n.t( defaultMessage="Are you sure you want to delete {counter, plural,
"Are you sure you want to remove <strong>{{ number }}</strong> shipping zones?", one {this shipping zone}
{ other {{displayQuantity} shipping zones}
number: maybe( }?"
() => params.ids.length.toString(), description="dialog content"
"..." values={{
) counter: maybe(() => params.ids.length),
} displayQuantity: (
<strong>
{maybe(() => params.ids.length)}
</strong>
) )
}} }}
/> />
</DialogContentText>
</ActionDialog> </ActionDialog>
</> </>
); );