diff --git a/locale/messages.pot b/locale/messages.pot index 1f70ae604..c7c7a5d94 100644 --- a/locale/messages.pot +++ b/locale/messages.pot @@ -1,6 +1,6 @@ msgid "" msgstr "" -"POT-Creation-Date: 2019-08-26T12:14:21.560Z\n" +"POT-Creation-Date: 2019-08-26T13:08:05.181Z\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "MIME-Version: 1.0\n" @@ -27,6 +27,14 @@ msgctxt "attribute value edit error" msgid "A value named {name} already exists" msgstr "" +#: build/locale/src/discounts/components/VoucherDates/VoucherDates.json +#. [src.discounts.components.VoucherDates.1662220323] - time during voucher is active, header +#. defaultMessage is: +#. Active Dates +msgctxt "time during voucher is active, header" +msgid "Active Dates" +msgstr "" + #: build/locale/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.json #. [src.customers.components.CustomerAddressDialog.3769321414] - dialog title #. defaultMessage is: @@ -35,6 +43,14 @@ msgctxt "dialog title" msgid "Add Address" msgstr "" +#: build/locale/src/discounts/components/SaleListPage/SaleListPage.json +#. [src.discounts.components.SaleListPage.1742771332] - button +#. defaultMessage is: +#. Add Sale +msgctxt "button" +msgid "Add Sale" +msgstr "" + #: build/locale/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.json #. [src.attributes.components.AttributeValueEditDialog.1841790893] - add attribute value #. defaultMessage is: @@ -151,6 +167,14 @@ msgctxt "add attribute value button" msgid "Add value" msgstr "" +#: build/locale/src/discounts/components/VoucherListPage/VoucherListPage.json +#. [src.discounts.components.VoucherListPage.1536809153] - button +#. defaultMessage is: +#. Add voucher +msgctxt "button" +msgid "Add voucher" +msgstr "" + #: build/locale/src/attributes/views/AttributeDetails/AttributeDetails.json #. [src.attributes.views.AttributeDetails.634268988] - added new attribute value #. defaultMessage is: @@ -207,6 +231,14 @@ msgctxt "section header" msgid "All Subcategories" msgstr "" +#: build/locale/src/discounts/components/VoucherSummary/VoucherSummary.json +#. [src.discounts.components.VoucherSummary.2735425668] - voucher +#. defaultMessage is: +#. Applies to +msgctxt "voucher" +msgid "Applies to" +msgstr "" + #: build/locale/src/attributes/components/AttributeValueDeleteDialog/AttributeValueDeleteDialog.json #. [src.attributes.components.AttributeValueDeleteDialog.273524270] - delete attribute value #. defaultMessage is: @@ -315,6 +347,22 @@ msgctxt "description" msgid "Are you sure you want to delete {counter,plural,one{this customer} other{{displayQuantity} customers}}?" msgstr "" +#: build/locale/src/discounts/views/SaleList.json +#. [src.discounts.views.2516361175] - dialog content +#. defaultMessage is: +#. Are you sure you want to delete {counter,plural,one{this sale} other{{displayQuantity} sales}}? +msgctxt "dialog content" +msgid "Are you sure you want to delete {counter,plural,one{this sale} other{{displayQuantity} sales}}?" +msgstr "" + +#: build/locale/src/discounts/views/VoucherList.json +#. [src.discounts.views.1791926983] - dialog content +#. defaultMessage is: +#. Are you sure you want to delete {counter,plural,one{this voucher} other{{displayQuantity} vouchers}}? +msgctxt "dialog content" +msgid "Are you sure you want to delete {counter,plural,one{this voucher} other{{displayQuantity} vouchers}}?" +msgstr "" + #: build/locale/src/customers/views/CustomerDetails.json #. [src.customers.views.1927691511] - delete customer, dialog content #. defaultMessage is: @@ -323,6 +371,22 @@ msgctxt "delete customer, dialog content" msgid "Are you sure you want to delete {email}?" msgstr "" +#: build/locale/src/discounts/views/SaleDetails.json +#. [src.discounts.views.1457489953] - dialog content +#. defaultMessage is: +#. Are you sure you want to delete {saleName}? +msgctxt "dialog content" +msgid "Are you sure you want to delete {saleName}?" +msgstr "" + +#: build/locale/src/discounts/views/VoucherDetails.json +#. [src.discounts.views.3261917848] - dialog content +#. defaultMessage is: +#. Are you sure you want to delete {voucherCode}? +msgctxt "dialog content" +msgid "Are you sure you want to delete {voucherCode}?" +msgstr "" + #: build/locale/src/collections/views/CollectionList.json #. [src.collections.views.1348793822] #. defaultMessage is: @@ -331,6 +395,30 @@ msgctxt "description" msgid "Are you sure you want to publish {counter,plural,one{this collection} other{{displayQuantity} collections}}?" msgstr "" +#: build/locale/src/discounts/views/SaleDetails.json +#. [src.discounts.views.376977560] - dialog content +#. defaultMessage is: +#. Are you sure you want to unassign {counter,plural,one{this category} other{{displayQuantity} categories}}? +#: build/locale/src/discounts/views/VoucherDetails.json +#. [src.discounts.views.376977560] - dialog content +#. defaultMessage is: +#. Are you sure you want to unassign {counter,plural,one{this category} other{{displayQuantity} categories}}? +msgctxt "dialog content" +msgid "Are you sure you want to unassign {counter,plural,one{this category} other{{displayQuantity} categories}}?" +msgstr "" + +#: build/locale/src/discounts/views/SaleDetails.json +#. [src.discounts.views.396618268] - dialog content +#. defaultMessage is: +#. Are you sure you want to unassign {counter,plural,one{this collection} other{{displayQuantity} collections}}? +#: build/locale/src/discounts/views/VoucherDetails.json +#. [src.discounts.views.396618268] - dialog content +#. defaultMessage is: +#. Are you sure you want to unassign {counter,plural,one{this collection} other{{displayQuantity} collections}}? +msgctxt "dialog content" +msgid "Are you sure you want to unassign {counter,plural,one{this collection} other{{displayQuantity} collections}}?" +msgstr "" + #: build/locale/src/collections/views/CollectionDetails.json #. [src.collections.views.1908998638] #. defaultMessage is: @@ -339,6 +427,18 @@ msgctxt "description" msgid "Are you sure you want to unassign {counter,plural,one{this product} other{{displayQuantity} products}}?" msgstr "" +#: build/locale/src/discounts/views/SaleDetails.json +#. [src.discounts.views.786949385] - dialog content +#. defaultMessage is: +#. Are you sure you want to unassign {counter,plural,one{this product} other{{displayQuantity} products}}? +#: build/locale/src/discounts/views/VoucherDetails.json +#. [src.discounts.views.786949385] - dialog content +#. defaultMessage is: +#. Are you sure you want to unassign {counter,plural,one{this product} other{{displayQuantity} products}}? +msgctxt "dialog content" +msgid "Are you sure you want to unassign {counter,plural,one{this product} other{{displayQuantity} products}}?" +msgstr "" + #: build/locale/src/collections/views/CollectionList.json #. [src.collections.views.3944356444] #. defaultMessage is: @@ -347,6 +447,38 @@ msgctxt "description" msgid "Are you sure you want to unpublish {counter,plural,one{this collection} other{{displayQuantity} collections}}?" msgstr "" +#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json +#. [src.discounts.components.DiscountCountrySelectDialog.1585396479] - dialog header +#. defaultMessage is: +#. Assign Countries +msgctxt "dialog header" +msgid "Assign Countries" +msgstr "" + +#: build/locale/src/discounts/components/DiscountCategories/DiscountCategories.json +#. [src.discounts.components.DiscountCategories.3973677075] - button +#. defaultMessage is: +#. Assign categories +msgctxt "button" +msgid "Assign categories" +msgstr "" + +#: build/locale/src/discounts/components/DiscountCollections/DiscountCollections.json +#. [src.discounts.components.DiscountCollections.1035511604] - button +#. defaultMessage is: +#. Assign collections +msgctxt "button" +msgid "Assign collections" +msgstr "" + +#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json +#. [src.discounts.components.DiscountCountrySelectDialog.2747492886] - button +#. defaultMessage is: +#. Assign countries +msgctxt "button" +msgid "Assign countries" +msgstr "" + #: build/locale/src/collections/components/CollectionProducts/CollectionProducts.json #. [src.collections.components.CollectionProducts.460524544] - button #. defaultMessage is: @@ -355,6 +487,14 @@ msgctxt "button" msgid "Assign product" msgstr "" +#: build/locale/src/discounts/components/DiscountProducts/DiscountProducts.json +#. [src.discounts.components.DiscountProducts.2100305525] - button +#. defaultMessage is: +#. Assign products +msgctxt "button" +msgid "Assign products" +msgstr "" + #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #. [src.attributes.components.AttributeDetails.3605174225] - attribute's slug short code label #. defaultMessage is: @@ -463,6 +603,18 @@ msgctxt "categories section name" msgid "Categories" msgstr "" +#: build/locale/src/discounts/components/SaleDetailsPage/SaleDetailsPage.json +#. [saleDetailsPageCategoriesQuantity] - number of categories +#. defaultMessage is: +#. Categories ({quantity}) +#: build/locale/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.json +#. [src.discounts.components.VoucherDetailsPage.346170541] - number of categories +#. defaultMessage is: +#. Categories ({quantity}) +msgctxt "number of categories" +msgid "Categories ({quantity})" +msgstr "" + #: build/locale/src/categories/components/CategoryDetailsForm/CategoryDetailsForm.json #. [src.categories.components.CategoryDetailsForm.4037703468] #. defaultMessage is: @@ -503,6 +655,42 @@ msgctxt "description" msgid "Category deleted" msgstr "" +#: build/locale/src/discounts/components/DiscountCategories/DiscountCategories.json +#. [src.discounts.components.DiscountCategories.1567318211] +#. defaultMessage is: +#. Category name +msgctxt "description" +msgid "Category name" +msgstr "" + +#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json +#. [src.discounts.components.DiscountCountrySelectDialog.2177165134] +#. defaultMessage is: +#. Choose countries, you want voucher to be limited to, from the list below +msgctxt "description" +msgid "Choose countries, you want voucher to be limited to, from the list below" +msgstr "" + +#: build/locale/src/discounts/components/VoucherList/VoucherList.json +#. [src.discounts.components.VoucherList.78726751] - voucher code +#. defaultMessage is: +#. Code +#: build/locale/src/discounts/components/VoucherSummary/VoucherSummary.json +#. [src.discounts.components.VoucherSummary.78726751] - voucher code +#. defaultMessage is: +#. Code +msgctxt "voucher code" +msgid "Code" +msgstr "" + +#: build/locale/src/discounts/components/DiscountCollections/DiscountCollections.json +#. [src.discounts.components.DiscountCollections.3011396316] +#. defaultMessage is: +#. Collection name +msgctxt "description" +msgid "Collection name" +msgstr "" + #: build/locale/src/intl.json #. [src.collections] - collections section name #. defaultMessage is: @@ -511,6 +699,18 @@ msgctxt "collections section name" msgid "Collections" msgstr "" +#: build/locale/src/discounts/components/SaleDetailsPage/SaleDetailsPage.json +#. [saleDetailsPageCollectionsQuantity] - number of collections +#. defaultMessage is: +#. Collections ({quantity}) +#: build/locale/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.json +#. [src.discounts.components.VoucherDetailsPage.3673147015] - number of collections +#. defaultMessage is: +#. Collections ({quantity}) +msgctxt "number of collections" +msgid "Collections ({quantity})" +msgstr "" + #: build/locale/src/intl.json #. [src.configuration] - configuration section name #. defaultMessage is: @@ -527,6 +727,22 @@ msgctxt "button" msgid "Confirm" msgstr "" +#: build/locale/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.json +#. [src.discounts.components.VoucherDetailsPage.3109712047] - voucher country range +#. defaultMessage is: +#. Countries +msgctxt "voucher country range" +msgid "Countries" +msgstr "" + +#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json +#. [src.discounts.components.DiscountCountrySelectDialog.2777439857] - country selection +#. defaultMessage is: +#. Countries A to Z +msgctxt "country selection" +msgid "Countries A to Z" +msgstr "" + #: build/locale/src/attributes/components/AttributePage/AttributePage.json #. [src.attributes.components.AttributePage.2855501559] - page title #. defaultMessage is: @@ -543,6 +759,22 @@ msgctxt "page header" msgid "Create New Category" msgstr "" +#: build/locale/src/discounts/components/SaleCreatePage/SaleCreatePage.json +#. [src.discounts.components.SaleCreatePage.3866518732] - page header +#. defaultMessage is: +#. Create Sale +msgctxt "page header" +msgid "Create Sale" +msgstr "" + +#: build/locale/src/discounts/components/VoucherCreatePage/VoucherCreatePage.json +#. [src.discounts.components.VoucherCreatePage.1357216572] - page header +#. defaultMessage is: +#. Create Voucher +msgctxt "page header" +msgid "Create Voucher" +msgstr "" + #: build/locale/src/categories/views/CategoryCreate.json #. [src.categories.views.1140231710] - window title #. defaultMessage is: @@ -743,6 +975,38 @@ msgctxt "dialog title" msgid "Delete Collection" msgstr "" +#: build/locale/src/discounts/views/SaleDetails.json +#. [src.discounts.views.506030254] - dialog header +#. defaultMessage is: +#. Delete Sale +msgctxt "dialog header" +msgid "Delete Sale" +msgstr "" + +#: build/locale/src/discounts/views/SaleList.json +#. [src.discounts.views.2809303671] - dialog header +#. defaultMessage is: +#. Delete Sales +msgctxt "dialog header" +msgid "Delete Sales" +msgstr "" + +#: build/locale/src/discounts/views/VoucherDetails.json +#. [src.discounts.views.895379508] - dialog header +#. defaultMessage is: +#. Delete Voucher +msgctxt "dialog header" +msgid "Delete Voucher" +msgstr "" + +#: build/locale/src/discounts/views/VoucherList.json +#. [src.discounts.views.367317371] - dialog header +#. defaultMessage is: +#. Delete Vouchers +msgctxt "dialog header" +msgid "Delete Vouchers" +msgstr "" + #: build/locale/src/attributes/components/AttributeDeleteDialog/AttributeDeleteDialog.json #. [src.attributes.components.AttributeDeleteDialog.1889602489] - dialog title #. defaultMessage is: @@ -847,6 +1111,14 @@ msgctxt "description" msgid "Deleted product from collection" msgstr "" +#: build/locale/src/discounts/views/VoucherDetails.json +#. [src.discounts.views.1162257691] +#. defaultMessage is: +#. Deleted voucher +msgctxt "description" +msgid "Deleted voucher" +msgstr "" + #: build/locale/src/intl.json #. [src.description] #. defaultMessage is: @@ -863,6 +1135,42 @@ msgctxt "description" msgid "Determine attributes used to create product types" msgstr "" +#: build/locale/src/discounts/components/VoucherInfo/VoucherInfo.json +#. [src.discounts.components.VoucherInfo.1262795626] +#. defaultMessage is: +#. Discount Code +msgctxt "description" +msgid "Discount Code" +msgstr "" + +#: build/locale/src/discounts/components/VoucherValue/VoucherValue.json +#. [src.discounts.components.VoucherValue.1971417066] +#. defaultMessage is: +#. Discount Specific Information +msgctxt "description" +msgid "Discount Specific Information" +msgstr "" + +#: build/locale/src/discounts/components/VoucherTypes/VoucherTypes.json +#. [src.discounts.components.VoucherTypes.3216816841] - header +#. defaultMessage is: +#. Discount Type +msgctxt "header" +msgid "Discount Type" +msgstr "" + +#: build/locale/src/discounts/components/SalePricing/SalePricing.json +#. [src.discounts.components.SalePricing.1205967018] +#. defaultMessage is: +#. Discount Value +#: build/locale/src/discounts/components/VoucherValue/VoucherValue.json +#. [src.discounts.components.VoucherValue.1205967018] +#. defaultMessage is: +#. Discount Value +msgctxt "description" +msgid "Discount Value" +msgstr "" + #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #. [src.attributes.components.AttributeDetails.1336738461] - product attribute type #. defaultMessage is: @@ -903,6 +1211,62 @@ msgctxt "edit attribute value" msgid "Edit Value" msgstr "" +#: build/locale/src/discounts/components/DiscountCategories/DiscountCategories.json +#. [src.discounts.components.DiscountCategories.1681512341] - section header +#. defaultMessage is: +#. Eligible Categories +msgctxt "section header" +msgid "Eligible Categories" +msgstr "" + +#: build/locale/src/discounts/components/DiscountCollections/DiscountCollections.json +#. [src.discounts.components.DiscountCollections.452750900] - section header +#. defaultMessage is: +#. Eligible Collections +msgctxt "section header" +msgid "Eligible Collections" +msgstr "" + +#: build/locale/src/discounts/components/DiscountProducts/DiscountProducts.json +#. [src.discounts.components.DiscountProducts.919175218] - section header +#. defaultMessage is: +#. Eligible Products +msgctxt "section header" +msgid "Eligible Products" +msgstr "" + +#: build/locale/src/intl.json +#. [src.endDate] +#. defaultMessage is: +#. End Date +msgctxt "description" +msgid "End Date" +msgstr "" + +#: build/locale/src/intl.json +#. [src.endHour] +#. defaultMessage is: +#. End Hour +msgctxt "description" +msgid "End Hour" +msgstr "" + +#: build/locale/src/discounts/components/SaleList/SaleList.json +#. [src.discounts.components.SaleList.3715522424] - sale end date +#. defaultMessage is: +#. Ends +msgctxt "sale end date" +msgid "Ends" +msgstr "" + +#: build/locale/src/discounts/components/VoucherList/VoucherList.json +#. [src.discounts.components.VoucherList.3715522424] - voucher is active until date +#. defaultMessage is: +#. Ends +msgctxt "voucher is active until date" +msgid "Ends" +msgstr "" + #: build/locale/src/customers/components/CustomerCreateNote/CustomerCreateNote.json #. [src.customers.components.CustomerCreateNote.932844352] #. defaultMessage is: @@ -919,6 +1283,14 @@ msgctxt "switch button" msgid "Feature on Homepage" msgstr "" +#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json +#. [src.discounts.components.DiscountCountrySelectDialog.2566713432] - search box label +#. defaultMessage is: +#. Filter Countries +msgctxt "search box label" +msgid "Filter Countries" +msgstr "" + #: build/locale/src/intl.json #. [src.firstName] #. defaultMessage is: @@ -927,6 +1299,22 @@ msgctxt "description" msgid "First Name" msgstr "" +#: build/locale/src/discounts/components/VoucherTypes/VoucherTypes.json +#. [src.discounts.components.VoucherTypes.46415128] - voucher discount type +#. defaultMessage is: +#. Fixed Amount +msgctxt "voucher discount type" +msgid "Fixed Amount" +msgstr "" + +#: build/locale/src/discounts/components/VoucherTypes/VoucherTypes.json +#. [src.discounts.components.VoucherTypes.3289659291] - voucher discount type +#. defaultMessage is: +#. Free Shipping +msgctxt "voucher discount type" +msgid "Free Shipping" +msgstr "" + #: build/locale/src/intl.json #. [src.generalInformations] #. defaultMessage is: @@ -935,6 +1323,14 @@ msgctxt "description" msgid "General Informations" msgstr "" +#: build/locale/src/discounts/components/VoucherInfo/VoucherInfo.json +#. [src.discounts.components.VoucherInfo.1944363009] - voucher code, button +#. defaultMessage is: +#. Generate Code +msgctxt "voucher code, button" +msgid "Generate Code" +msgstr "" + #: build/locale/src/attributes/components/AttributeProperties/AttributeProperties.json #. [src.attributes.components.AttributeProperties.787251583] #. defaultMessage is: @@ -943,6 +1339,14 @@ msgctxt "description" msgid "If enabled, you’ll be able to use this attribute to filter products in product list." msgstr "" +#: build/locale/src/discounts/components/VoucherValue/VoucherValue.json +#. [src.discounts.components.VoucherValue.4189095909] +#. defaultMessage is: +#. If this option is disabled, discount will be counted for every eligible product +msgctxt "description" +msgid "If this option is disabled, discount will be counted for every eligible product" +msgstr "" + #: build/locale/src/intl.json #. [src.lastName] #. defaultMessage is: @@ -967,6 +1371,30 @@ msgctxt "description" msgid "Last order" msgstr "" +#: build/locale/src/discounts/components/VoucherLimits/VoucherLimits.json +#. [src.discounts.components.VoucherLimits.2215544659] +#. defaultMessage is: +#. Limit number of times this discount can be used in total +msgctxt "description" +msgid "Limit number of times this discount can be used in total" +msgstr "" + +#: build/locale/src/discounts/components/VoucherLimits/VoucherLimits.json +#. [src.discounts.components.VoucherLimits.557552777] - voucher +#. defaultMessage is: +#. Limit of Uses +msgctxt "voucher" +msgid "Limit of Uses" +msgstr "" + +#: build/locale/src/discounts/components/VoucherLimits/VoucherLimits.json +#. [src.discounts.components.VoucherLimits.3459612469] - limit voucher +#. defaultMessage is: +#. Limit to one use per customer +msgctxt "limit voucher" +msgid "Limit to one use per customer" +msgstr "" + #: build/locale/src/intl.json #. [src.manage] - button #. defaultMessage is: @@ -1007,6 +1435,46 @@ msgctxt "description" msgid "Manage your employees and their permissions" msgstr "" +#: build/locale/src/discounts/components/VoucherSummary/VoucherSummary.json +#. [src.discounts.components.VoucherSummary.1836123577] - voucher value requirement +#. defaultMessage is: +#. Min. Order Value +msgctxt "voucher value requirement" +msgid "Min. Order Value" +msgstr "" + +#: build/locale/src/discounts/components/VoucherList/VoucherList.json +#. [src.discounts.components.VoucherList.2427377316] - minimum amount of spent money to activate voucher +#. defaultMessage is: +#. Min. Spent +msgctxt "minimum amount of spent money to activate voucher" +msgid "Min. Spent" +msgstr "" + +#: build/locale/src/discounts/components/VoucherRequirements/VoucherRequirements.json +#. [src.discounts.components.VoucherRequirements.653777456] - voucher requirement +#. defaultMessage is: +#. Minimal order value +msgctxt "voucher requirement" +msgid "Minimal order value" +msgstr "" + +#: build/locale/src/discounts/components/VoucherRequirements/VoucherRequirements.json +#. [src.discounts.components.VoucherRequirements.2746532349] - voucher requirements, header +#. defaultMessage is: +#. Minimum Requirements +msgctxt "voucher requirements, header" +msgid "Minimum Requirements" +msgstr "" + +#: build/locale/src/discounts/components/VoucherRequirements/VoucherRequirements.json +#. [src.discounts.components.VoucherRequirements.3740704788] - voucher requirement +#. defaultMessage is: +#. Minimum quantity of items +msgctxt "voucher requirement" +msgid "Minimum quantity of items" +msgstr "" + #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #. [src.attributes.components.AttributeDetails.3334509011] - product attribute type #. defaultMessage is: @@ -1043,6 +1511,22 @@ msgctxt "collection name" msgid "Name" msgstr "" +#: build/locale/src/discounts/components/SaleInfo/SaleInfo.json +#. [src.discounts.components.SaleInfo.636461959] - sale name +#. defaultMessage is: +#. Name +#: build/locale/src/discounts/components/SaleList/SaleList.json +#. [src.discounts.components.SaleList.636461959] - sale name +#. defaultMessage is: +#. Name +#: build/locale/src/discounts/components/SaleSummary/SaleSummary.json +#. [src.discounts.components.SaleSummary.636461959] - sale name +#. defaultMessage is: +#. Name +msgctxt "sale name" +msgid "Name" +msgstr "" + #: build/locale/src/intl.json #. [src.navigation] - navigation section name #. defaultMessage is: @@ -1063,6 +1547,10 @@ msgstr "" #. [src.categories.components.CategoryList.2054128296] #. defaultMessage is: #. No categories found +#: build/locale/src/discounts/components/DiscountCategories/DiscountCategories.json +#. [src.discounts.components.DiscountCategories.2054128296] +#. defaultMessage is: +#. No categories found msgctxt "description" msgid "No categories found" msgstr "" @@ -1071,6 +1559,10 @@ msgstr "" #. [src.collections.components.CollectionList.2137803833] #. defaultMessage is: #. No collections found +#: build/locale/src/discounts/components/DiscountCollections/DiscountCollections.json +#. [src.discounts.components.DiscountCollections.2137803833] +#. defaultMessage is: +#. No collections found msgctxt "description" msgid "No collections found" msgstr "" @@ -1099,10 +1591,22 @@ msgstr "" #. [src.collections.components.CollectionProducts.1657559629] #. defaultMessage is: #. No products found +#: build/locale/src/discounts/components/DiscountProducts/DiscountProducts.json +#. [src.discounts.components.DiscountProducts.1657559629] +#. defaultMessage is: +#. No products found msgctxt "description" msgid "No products found" msgstr "" +#: build/locale/src/discounts/components/SaleList/SaleList.json +#. [src.discounts.components.SaleList.4101565527] +#. defaultMessage is: +#. No sales found +msgctxt "description" +msgid "No sales found" +msgstr "" + #: build/locale/src/categories/components/CategoryList/CategoryList.json #. [src.categories.components.CategoryList.2155313053] #. defaultMessage is: @@ -1119,6 +1623,14 @@ msgctxt "No attribute values found" msgid "No values found" msgstr "" +#: build/locale/src/discounts/components/VoucherList/VoucherList.json +#. [src.discounts.components.VoucherList.79160621] +#. defaultMessage is: +#. No vouchers found +msgctxt "description" +msgid "No vouchers found" +msgstr "" + #: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json #. [src.customers.components.CustomerOrders.2889196282] - number of order #. defaultMessage is: @@ -1151,6 +1663,14 @@ msgctxt "description" msgid "No. of Products" msgstr "" +#: build/locale/src/discounts/components/VoucherRequirements/VoucherRequirements.json +#. [src.discounts.components.VoucherRequirements.3069107721] - voucher has no requirements +#. defaultMessage is: +#. None +msgctxt "voucher has no requirements" +msgid "None" +msgstr "" + #: build/locale/src/collections/components/CollectionList/CollectionList.json #. [src.collections.components.CollectionList.2341910657] - collection is not published #. defaultMessage is: @@ -1163,6 +1683,10 @@ msgstr "" #. [src.collections.components.CollectionProducts.2341910657] - product is not published #. defaultMessage is: #. Not published +#: build/locale/src/discounts/components/DiscountProducts/DiscountProducts.json +#. [src.discounts.components.DiscountProducts.2341910657] - product is not published +#. defaultMessage is: +#. Not published msgctxt "product is not published" msgid "Not published" msgstr "" @@ -1187,6 +1711,14 @@ msgctxt "notes about customer header" msgid "Notes" msgstr "" +#: build/locale/src/discounts/components/VoucherValue/VoucherValue.json +#. [src.discounts.components.VoucherValue.1492866942] - voucher application, switch button +#. defaultMessage is: +#. Only once per order +msgctxt "voucher application, switch button" +msgid "Only once per order" +msgstr "" + #: build/locale/src/intl.json #. [src.pages] - pages section name #. defaultMessage is: @@ -1195,6 +1727,14 @@ msgctxt "pages section name" msgid "Pages" msgstr "" +#: build/locale/src/discounts/components/VoucherTypes/VoucherTypes.json +#. [src.discounts.components.VoucherTypes.3688224049] - voucher discount type +#. defaultMessage is: +#. Percentage +msgctxt "voucher discount type" +msgid "Percentage" +msgstr "" + #: build/locale/src/attributes/components/AttributeProperties/AttributeProperties.json #. [src.attributes.components.AttributeProperties.3590282519] - attribute position in storefront filters #. defaultMessage is: @@ -1203,6 +1743,14 @@ msgctxt "attribute position in storefront filters" msgid "Position in faceted navigation" msgstr "" +#: build/locale/src/discounts/components/SalePricing/SalePricing.json +#. [src.discounts.components.SalePricing.1099355007] - sale pricing, header +#. defaultMessage is: +#. Pricing +msgctxt "sale pricing, header" +msgid "Pricing" +msgstr "" + #: build/locale/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.json #. [src.customers.components.CustomerCreateAddress.1922654050] - page header #. defaultMessage is: @@ -1211,6 +1759,22 @@ msgctxt "page header" msgid "Primary address" msgstr "" +#: build/locale/src/discounts/components/DiscountProducts/DiscountProducts.json +#. [src.discounts.components.DiscountProducts.2697405188] +#. defaultMessage is: +#. Product Name +msgctxt "description" +msgid "Product Name" +msgstr "" + +#: build/locale/src/discounts/components/DiscountProducts/DiscountProducts.json +#. [src.discounts.components.DiscountProducts.4257289053] +#. defaultMessage is: +#. Product Type +msgctxt "description" +msgid "Product Type" +msgstr "" + #: build/locale/src/intl.json #. [src.productTypes] - product types section name #. defaultMessage is: @@ -1235,6 +1799,30 @@ msgctxt "number of products in category" msgid "Products" msgstr "" +#: build/locale/src/discounts/components/DiscountCategories/DiscountCategories.json +#. [src.discounts.components.DiscountCategories.2968663655] - number of products +#. defaultMessage is: +#. Products +#: build/locale/src/discounts/components/DiscountCollections/DiscountCollections.json +#. [src.discounts.components.DiscountCollections.2968663655] - number of products +#. defaultMessage is: +#. Products +msgctxt "number of products" +msgid "Products" +msgstr "" + +#: build/locale/src/discounts/components/SaleDetailsPage/SaleDetailsPage.json +#. [saleDetailsPageProductsQuantity] - number of products +#. defaultMessage is: +#. Products ({quantity}) +#: build/locale/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.json +#. [src.discounts.components.VoucherDetailsPage.846927739] - number of products +#. defaultMessage is: +#. Products ({quantity}) +msgctxt "number of products" +msgid "Products ({quantity})" +msgstr "" + #: build/locale/src/categories/components/CategoryProductsCard/CategoryProductsCard.json #. [src.categories.components.CategoryProductsCard.4164156574] - section header #. defaultMessage is: @@ -1287,6 +1875,10 @@ msgstr "" #. [src.collections.components.CollectionProducts.3640454975] - product is published #. defaultMessage is: #. Published +#: build/locale/src/discounts/components/DiscountProducts/DiscountProducts.json +#. [src.discounts.components.DiscountProducts.3640454975] - product is published +#. defaultMessage is: +#. Published msgctxt "product is published" msgid "Published" msgstr "" @@ -1319,6 +1911,22 @@ msgctxt "button" msgid "Remove" msgstr "" +#: build/locale/src/discounts/views/SaleDetails.json +#. [src.discounts.views.2534378844] +#. defaultMessage is: +#. Removed sale +msgctxt "description" +msgid "Removed sale" +msgstr "" + +#: build/locale/src/intl.json +#. [src.sales] - sales section name +#. defaultMessage is: +#. Sales +msgctxt "sales section name" +msgid "Sales" +msgstr "" + #: build/locale/src/intl.json #. [src.save] - button #. defaultMessage is: @@ -1335,6 +1943,14 @@ msgctxt "description" msgid "Saved changes" msgstr "" +#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json +#. [src.discounts.components.DiscountCountrySelectDialog.2110418881] - search box placeholder +#. defaultMessage is: +#. Search by country name +msgctxt "search box placeholder" +msgid "Search by country name" +msgstr "" + #: build/locale/src/attributes/components/AttributeList/AttributeList.json #. [src.attributes.components.AttributeList.2235596452] - attribute can be searched in dashboard #. defaultMessage is: @@ -1359,6 +1975,14 @@ msgctxt "button" msgid "Set as default shipping address" msgstr "" +#: build/locale/src/discounts/components/VoucherDates/VoucherDates.json +#. [src.discounts.components.VoucherDates.1596226028] - voucher end date, switch button +#. defaultMessage is: +#. Set end date +msgctxt "voucher end date, switch button" +msgid "Set end date" +msgstr "" + #: build/locale/src/intl.json #. [src.shipping] - shipping section name #. defaultMessage is: @@ -1391,6 +2015,38 @@ msgctxt "staff section name" msgid "Staff Members" msgstr "" +#: build/locale/src/intl.json +#. [src.startDate] +#. defaultMessage is: +#. Start Date +msgctxt "description" +msgid "Start Date" +msgstr "" + +#: build/locale/src/intl.json +#. [src.startHour] +#. defaultMessage is: +#. Start Hour +msgctxt "description" +msgid "Start Hour" +msgstr "" + +#: build/locale/src/discounts/components/SaleList/SaleList.json +#. [src.discounts.components.SaleList.47059407] - sale start date +#. defaultMessage is: +#. Starts +msgctxt "sale start date" +msgid "Starts" +msgstr "" + +#: build/locale/src/discounts/components/VoucherList/VoucherList.json +#. [src.discounts.components.VoucherList.47059407] - voucher is active from date +#. defaultMessage is: +#. Starts +msgctxt "voucher is active from date" +msgid "Starts" +msgstr "" + #: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json #. [src.customers.components.CustomerOrders.1756106276] - order status #. defaultMessage is: @@ -1431,6 +2087,30 @@ msgctxt "description" msgid "Successfully created attribute" msgstr "" +#: build/locale/src/discounts/views/SaleCreate.json +#. [src.discounts.views.3707049729] +#. defaultMessage is: +#. Successfully created sale +msgctxt "description" +msgid "Successfully created sale" +msgstr "" + +#: build/locale/src/discounts/views/VoucherCreate.json +#. [src.discounts.views.655651329] +#. defaultMessage is: +#. Successfully created voucher +msgctxt "description" +msgid "Successfully created voucher" +msgstr "" + +#: build/locale/src/intl.json +#. [src.summary] +#. defaultMessage is: +#. Summary +msgctxt "description" +msgid "Summary" +msgstr "" + #: build/locale/src/intl.json #. [src.taxes] - taxes section name #. defaultMessage is: @@ -1479,6 +2159,14 @@ msgctxt "attribute slug input field helper text" msgid "This is used internally. Make sure you don’t use spaces" msgstr "" +#: build/locale/src/discounts/components/SalePricing/SalePricing.json +#. [src.discounts.components.SalePricing.2503204759] - time during which sale is active +#. defaultMessage is: +#. Time Frame +msgctxt "time during which sale is active" +msgid "Time Frame" +msgstr "" + #: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json #. [src.customers.components.CustomerOrders.878013594] - order total amount #. defaultMessage is: @@ -1507,6 +2195,102 @@ msgctxt "unassign product from collection, button" msgid "Unassign" msgstr "" +#: build/locale/src/discounts/views/SaleDetails.json +#. [saleDetailsUnassignCategory] - unassign category from sale, button +#. defaultMessage is: +#. Unassign +msgctxt "unassign category from sale, button" +msgid "Unassign" +msgstr "" + +#: build/locale/src/discounts/views/SaleDetails.json +#. [saleDetailsUnassignCollection] - unassign collection from sale, button +#. defaultMessage is: +#. Unassign +msgctxt "unassign collection from sale, button" +msgid "Unassign" +msgstr "" + +#: build/locale/src/discounts/views/SaleDetails.json +#. [saleDetailsUnassignProduct] - unassign product from sale, button +#. defaultMessage is: +#. Unassign +msgctxt "unassign product from sale, button" +msgid "Unassign" +msgstr "" + +#: build/locale/src/discounts/views/VoucherDetails.json +#. [voucherDetailsUnassignCategory] - unassign category from voucher, button +#. defaultMessage is: +#. Unassign +msgctxt "unassign category from voucher, button" +msgid "Unassign" +msgstr "" + +#: build/locale/src/discounts/views/VoucherDetails.json +#. [voucherDetailsUnassignCollection] - unassign collection from voucher, button +#. defaultMessage is: +#. Unassign +msgctxt "unassign collection from voucher, button" +msgid "Unassign" +msgstr "" + +#: build/locale/src/discounts/views/VoucherDetails.json +#. [voucherDetailsUnassignProduct] - unassign product from voucher, button +#. defaultMessage is: +#. Unassign +msgctxt "unassign product from voucher, button" +msgid "Unassign" +msgstr "" + +#: build/locale/src/discounts/views/SaleDetails.json +#. [src.discounts.views.1827854264] - dialog header +#. defaultMessage is: +#. Unassign Categories From Sale +msgctxt "dialog header" +msgid "Unassign Categories From Sale" +msgstr "" + +#: build/locale/src/discounts/views/VoucherDetails.json +#. [src.discounts.views.2669520431] - dialog header +#. defaultMessage is: +#. Unassign Categories From Voucher +msgctxt "dialog header" +msgid "Unassign Categories From Voucher" +msgstr "" + +#: build/locale/src/discounts/views/SaleDetails.json +#. [src.discounts.views.1952217501] - dialog header +#. defaultMessage is: +#. Unassign Collections From Sale +msgctxt "dialog header" +msgid "Unassign Collections From Sale" +msgstr "" + +#: build/locale/src/discounts/views/VoucherDetails.json +#. [src.discounts.views.1402402714] - dialog header +#. defaultMessage is: +#. Unassign Collections From Voucher +msgctxt "dialog header" +msgid "Unassign Collections From Voucher" +msgstr "" + +#: build/locale/src/discounts/views/SaleDetails.json +#. [src.discounts.views.3395246518] - dialog header +#. defaultMessage is: +#. Unassign Products From Sale +msgctxt "dialog header" +msgid "Unassign Products From Sale" +msgstr "" + +#: build/locale/src/discounts/views/VoucherDetails.json +#. [src.discounts.views.2072403265] - dialog header +#. defaultMessage is: +#. Unassign Products From Voucher +msgctxt "dialog header" +msgid "Unassign Products From Voucher" +msgstr "" + #: build/locale/src/collections/views/CollectionDetails.json #. [src.collections.views.3791354625] - dialog title #. defaultMessage is: @@ -1539,6 +2323,22 @@ msgctxt "button" msgid "Upload image" msgstr "" +#: build/locale/src/discounts/components/VoucherLimits/VoucherLimits.json +#. [src.discounts.components.VoucherLimits.3751756157] - voucher usage limit, header +#. defaultMessage is: +#. Usage Limit +msgctxt "voucher usage limit, header" +msgid "Usage Limit" +msgstr "" + +#: build/locale/src/discounts/components/VoucherSummary/VoucherSummary.json +#. [src.discounts.components.VoucherSummary.3751756157] - voucher value requirement +#. defaultMessage is: +#. Usage Limit +msgctxt "voucher value requirement" +msgid "Usage Limit" +msgstr "" + #: build/locale/src/attributes/components/AttributeProperties/AttributeProperties.json #. [src.attributes.components.AttributeProperties.714335445] - use attribute in filtering #. defaultMessage is: @@ -1571,6 +2371,46 @@ msgctxt "check to mark this account as active" msgid "User account active" msgstr "" +#: build/locale/src/discounts/components/VoucherList/VoucherList.json +#. [src.discounts.components.VoucherList.3917820600] - voucher uses +#. defaultMessage is: +#. Uses +msgctxt "voucher uses" +msgid "Uses" +msgstr "" + +#: build/locale/src/discounts/components/SaleList/SaleList.json +#. [src.discounts.components.SaleList.1148029984] - sale value +#. defaultMessage is: +#. Value +#: build/locale/src/discounts/components/SaleSummary/SaleSummary.json +#. [src.discounts.components.SaleSummary.1148029984] - sale value +#. defaultMessage is: +#. Value +msgctxt "sale value" +msgid "Value" +msgstr "" + +#: build/locale/src/discounts/components/VoucherList/VoucherList.json +#. [src.discounts.components.VoucherList.1148029984] - voucher value +#. defaultMessage is: +#. Value +#: build/locale/src/discounts/components/VoucherSummary/VoucherSummary.json +#. [src.discounts.components.VoucherSummary.1148029984] - voucher value +#. defaultMessage is: +#. Value +msgctxt "voucher value" +msgid "Value" +msgstr "" + +#: build/locale/src/discounts/components/VoucherValue/VoucherValue.json +#. [src.discounts.components.VoucherValue.1148029984] - section header +#. defaultMessage is: +#. Value +msgctxt "section header" +msgid "Value" +msgstr "" + #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #. [src.attributes.components.AttributeDetails.2592224946] - check to require attribute to have value #. defaultMessage is: @@ -1619,6 +2459,30 @@ msgctxt "attribute" msgid "Visible on Product Page in Storefront" msgstr "" +#: build/locale/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.json +#. [src.discounts.components.VoucherDetailsPage.2071139683] +#. defaultMessage is: +#. Voucher applies to all countries +msgctxt "description" +msgid "Voucher applies to all countries" +msgstr "" + +#: build/locale/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.json +#. [src.discounts.components.VoucherDetailsPage.2102960822] +#. defaultMessage is: +#. Voucher is limited to these countries +msgctxt "description" +msgid "Voucher is limited to these countries" +msgstr "" + +#: build/locale/src/intl.json +#. [src.vouchers] - vouchers section name +#. defaultMessage is: +#. Vouchers +msgctxt "vouchers section name" +msgid "Vouchers" +msgstr "" + #: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json #. [src.customers.components.CustomerAddressListPage.489918044] - customer details, header #. defaultMessage is: diff --git a/react-intl.d.ts b/react-intl.d.ts index e6939af65..efafa921d 100644 --- a/react-intl.d.ts +++ b/react-intl.d.ts @@ -5,6 +5,7 @@ declare module "react-intl" { export interface MessageDescriptor { description?: string; defaultMessage: string; + id?: string; } type Messages = Record< Names, diff --git a/src/discounts/components/DiscountCategories/DiscountCategories.tsx b/src/discounts/components/DiscountCategories/DiscountCategories.tsx index 80189cf00..70eaa1cd9 100644 --- a/src/discounts/components/DiscountCategories/DiscountCategories.tsx +++ b/src/discounts/components/DiscountCategories/DiscountCategories.tsx @@ -14,13 +14,13 @@ import TableFooter from "@material-ui/core/TableFooter"; import TableRow from "@material-ui/core/TableRow"; import DeleteIcon from "@material-ui/icons/Delete"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import Checkbox from "@saleor/components/Checkbox"; import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; -import i18n from "../../../i18n"; import { maybe, renderCollection } from "../../../misc"; import { ListActions, ListProps } from "../../../types"; import { SaleDetails_sale } from "../../types/SaleDetails"; @@ -71,105 +71,123 @@ const DiscountCategories = withStyles(styles, { toggleAll, selected, isChecked - }: DiscountCategoriesProps & WithStyles) => ( - - - {i18n.t("Assign categories")} - - } - /> - - sale.categories.edges.map(edge => edge.node))} - toggleAll={toggleAll} - toolbar={toolbar} - > - <> - - {i18n.t("Category name")} - - - {i18n.t("Products")} - - - - - - - - - - - {renderCollection( - maybe(() => sale.categories.edges.map(edge => edge.node)), - category => { - const isSelected = category ? isChecked(category.id) : false; + }: DiscountCategoriesProps & WithStyles) => { + const intl = useIntl(); - return ( - - - toggle(category.id)} - /> - - - {maybe(() => category.name, )} - - - {maybe( - () => category.products.totalCount, - - )} - - - { - event.stopPropagation(); - onCategoryUnassign(category.id); - }} - > - - + return ( + + + + + } + /> +
+ sale.categories.edges.map(edge => edge.node))} + toggleAll={toggleAll} + toolbar={toolbar} + > + <> + + + + + + + + + + + + + + + + {renderCollection( + maybe(() => sale.categories.edges.map(edge => edge.node)), + category => { + const isSelected = category ? isChecked(category.id) : false; + + return ( + + + toggle(category.id)} + /> + + + {maybe( + () => category.name, + + )} + + + {maybe( + () => category.products.totalCount, + + )} + + + { + event.stopPropagation(); + onCategoryUnassign(category.id); + }} + > + + + + + ); + }, + () => ( + + + - ); - }, - () => ( - - - {i18n.t("No categories found")} - - - ) - )} - -
-
- ) + ) + )} + + + + ); + } ); DiscountCategories.displayName = "DiscountCategories"; export default DiscountCategories; diff --git a/src/discounts/components/DiscountCollections/DiscountCollections.tsx b/src/discounts/components/DiscountCollections/DiscountCollections.tsx index f863204db..196b5eefa 100644 --- a/src/discounts/components/DiscountCollections/DiscountCollections.tsx +++ b/src/discounts/components/DiscountCollections/DiscountCollections.tsx @@ -14,13 +14,13 @@ import TableFooter from "@material-ui/core/TableFooter"; import TableRow from "@material-ui/core/TableRow"; import DeleteIcon from "@material-ui/icons/Delete"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import Checkbox from "@saleor/components/Checkbox"; import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; -import i18n from "../../../i18n"; import { maybe, renderCollection } from "../../../misc"; import { ListActions, ListProps } from "../../../types"; import { SaleDetails_sale } from "../../types/SaleDetails"; @@ -71,105 +71,122 @@ const DiscountCollections = withStyles(styles, { toggle, toggleAll, toolbar - }: DiscountCollectionsProps & WithStyles) => ( - - - {i18n.t("Assign collections")} - - } - /> - - sale.collections.edges.map(edge => edge.node))} - toggleAll={toggleAll} - toolbar={toolbar} - > - - {i18n.t("Collection name")} - - - {i18n.t("Products")} - - - - - - - - - - {renderCollection( - maybe(() => sale.collections.edges.map(edge => edge.node)), - collection => { - const isSelected = collection ? isChecked(collection.id) : false; - return ( - - - toggle(collection.id)} - /> - - - {maybe( - () => collection.name, - - )} - - - {maybe( - () => collection.products.totalCount, - - )} - - - { - event.stopPropagation(); - onCollectionUnassign(collection.id); - }} - > - - + }: DiscountCollectionsProps & WithStyles) => { + const intl = useIntl(); + + return ( + + + + + } + /> +
+ sale.collections.edges.map(edge => edge.node))} + toggleAll={toggleAll} + toolbar={toolbar} + > + + + + + + + + + + + + + + + {renderCollection( + maybe(() => sale.collections.edges.map(edge => edge.node)), + collection => { + const isSelected = collection + ? isChecked(collection.id) + : false; + return ( + + + toggle(collection.id)} + /> + + + {maybe( + () => collection.name, + + )} + + + {maybe( + () => collection.products.totalCount, + + )} + + + { + event.stopPropagation(); + onCollectionUnassign(collection.id); + }} + > + + + + + ); + }, + () => ( + + + - ); - }, - () => ( - - - {i18n.t("No collections found")} - - - ) - )} - -
-
- ) + ) + )} + + + + ); + } ); DiscountCollections.displayName = "DiscountCollections"; export default DiscountCollections; diff --git a/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx b/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx index 58a650be3..6a4556f54 100644 --- a/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx +++ b/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx @@ -17,6 +17,7 @@ import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import { filter } from "fuzzaldrin"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import Checkbox from "@saleor/components/Checkbox"; import ConfirmButton, { @@ -27,7 +28,7 @@ import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; // tslint:disable no-submodule-imports import { ShopInfo_shop_countries } from "@saleor/components/Shop/types/ShopInfo"; -import i18n from "../../../i18n"; +import { buttonMessages } from "@saleor/intl"; interface FormData { allCountries: boolean; @@ -72,6 +73,8 @@ const DiscountCountrySelectDialog = withStyles(styles, { initial, onConfirm }: DiscountCountrySelectDialogProps & WithStyles) => { + const intl = useIntl(); + const initialForm: FormData = { allCountries: true, countries: initial, @@ -90,23 +93,28 @@ const DiscountCountrySelectDialog = withStyles(styles, { return ( <> - {i18n.t("Assign Countries")} + + + - {i18n.t( - "Choose countries, you want voucher to be limited to, from the list below" - )} + change(event, () => fetch(data.query))} - label={i18n.t("Search Countries", { - context: "country search input label" + label={intl.formatMessage({ + defaultMessage: "Filter Countries", + description: "search box label" })} - placeholder={i18n.t("Search by country name", { - context: "country search input placeholder" + placeholder={intl.formatMessage({ + defaultMessage: "Search by country name", + description: "search box placeholder" })} fullWidth /> @@ -114,9 +122,10 @@ const DiscountCountrySelectDialog = withStyles(styles, {
- {i18n.t("Countries A to Z", { - context: "country selection" - })} + @@ -167,7 +176,7 @@ const DiscountCountrySelectDialog = withStyles(styles, { - {i18n.t("Assign countries", { context: "button" })} + diff --git a/src/discounts/components/DiscountProducts/DiscountProducts.tsx b/src/discounts/components/DiscountProducts/DiscountProducts.tsx index 3910cfad9..a39a1ba4c 100644 --- a/src/discounts/components/DiscountProducts/DiscountProducts.tsx +++ b/src/discounts/components/DiscountProducts/DiscountProducts.tsx @@ -14,6 +14,7 @@ import TableFooter from "@material-ui/core/TableFooter"; import TableRow from "@material-ui/core/TableRow"; import DeleteIcon from "@material-ui/icons/Delete"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import Checkbox from "@saleor/components/Checkbox"; @@ -24,7 +25,6 @@ import TableCellAvatar, { } from "@saleor/components/TableCellAvatar"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; -import i18n from "../../../i18n"; import { maybe, renderCollection } from "../../../misc"; import { ListActions, ListProps } from "../../../types"; import { SaleDetails_sale } from "../../types/SaleDetails"; @@ -84,126 +84,145 @@ const DiscountProducts = withStyles(styles, { toggle, toggleAll, toolbar - }: SaleProductsProps & WithStyles) => ( - - - {i18n.t("Assign products")} - - } - /> -
- sale.products.edges.map(edge => edge.node))} - toggleAll={toggleAll} - toolbar={toolbar} - > - - - {i18n.t("Product name")} - - - - {i18n.t("Product Type")} - - - {i18n.t("Published")} - - - - - - - - - - {renderCollection( - maybe(() => sale.products.edges.map(edge => edge.node)), - product => { - const isSelected = product ? isChecked(product.id) : false; - return ( - - - toggle(product.id)} - /> - - product.thumbnail.url)} + }: SaleProductsProps & WithStyles) => { + const intl = useIntl(); + + return ( + + + + + } + /> +
+ sale.products.edges.map(edge => edge.node))} + toggleAll={toggleAll} + toolbar={toolbar} + > + + + + + + + + + + + + + + + + + + + + {renderCollection( + maybe(() => sale.products.edges.map(edge => edge.node)), + product => { + const isSelected = product ? isChecked(product.id) : false; + return ( + - {maybe(() => product.name, )} - - - {maybe( - () => product.productType.name, - - )} - - - {product && product.isPublished !== undefined ? ( - + toggle(product.id)} /> - ) : ( - - )} - - - { - event.stopPropagation(); - onProductUnassign(product.id); - }} + + product.thumbnail.url)} > - - + {maybe(() => product.name, )} + + + {maybe( + () => product.productType.name, + + )} + + + {product && product.isPublished !== undefined ? ( + + ) : ( + + )} + + + { + event.stopPropagation(); + onProductUnassign(product.id); + }} + > + + + + + ); + }, + () => ( + + + - ); - }, - () => ( - - - {i18n.t("No products found")} - - - ) - )} - -
- - ) + ) + )} + + + + ); + } ); DiscountProducts.displayName = "DiscountProducts"; export default DiscountProducts; diff --git a/src/discounts/components/SaleCreatePage/SaleCreatePage.tsx b/src/discounts/components/SaleCreatePage/SaleCreatePage.tsx index 04bff4adb..67577afc6 100644 --- a/src/discounts/components/SaleCreatePage/SaleCreatePage.tsx +++ b/src/discounts/components/SaleCreatePage/SaleCreatePage.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { useIntl } from "react-intl"; import AppHeader from "@saleor/components/AppHeader"; import CardSpacer from "@saleor/components/CardSpacer"; @@ -8,7 +9,7 @@ import Form from "@saleor/components/Form"; import Grid from "@saleor/components/Grid"; import PageHeader from "@saleor/components/PageHeader"; import SaveButtonBar from "@saleor/components/SaveButtonBar"; -import i18n from "../../../i18n"; +import { sectionNames } from "@saleor/intl"; import { UserError } from "../../../types"; import { SaleType } from "../../../types/globalTypes"; import SaleInfo from "../SaleInfo"; @@ -39,6 +40,8 @@ const SaleCreatePage: React.StatelessComponent = ({ saveButtonBarState, onBack }) => { + const intl = useIntl(); + const initialForm: FormData = { endDate: "", name: "", @@ -50,8 +53,15 @@ const SaleCreatePage: React.StatelessComponent = ({
{({ change, data, errors: formErrors, hasChanged, submit }) => ( - {i18n.t("Sales")} - + + {intl.formatMessage(sectionNames.sales)} + +
= ({ toggle, toggleAll }) => { + const intl = useIntl(); + const initialForm: FormData = { endDate: maybe(() => (sale.endDate ? sale.endDate : ""), ""), name: maybe(() => sale.name, ""), @@ -113,7 +116,9 @@ const SaleDetailsPage: React.StatelessComponent = ({ {({ change, data, errors: formErrors, hasChanged, submit }) => ( - {i18n.t("Sales")} + + {intl.formatMessage(sectionNames.sales)} + sale.name)} />
@@ -137,34 +142,55 @@ const SaleDetailsPage: React.StatelessComponent = ({ isActive={activeTab === SaleDetailsPageTab.categories} changeTab={onTabClick} > - {i18n.t("Categories ({{ number }})", { - number: maybe( - () => sale.categories.totalCount.toString(), - "…" - ) - })} + {intl.formatMessage( + { + defaultMessage: "Categories ({quantity})", + description: "number of categories", + id: "saleDetailsPageCategoriesQuantity" + }, + { + quantity: maybe( + () => sale.categories.totalCount.toString(), + "…" + ) + } + )} - {i18n.t("Collections ({{ number }})", { - number: maybe( - () => sale.collections.totalCount.toString(), - "…" - ) - })} + {intl.formatMessage( + { + defaultMessage: "Collections ({quantity})", + description: "number of collections", + id: "saleDetailsPageCollectionsQuantity" + }, + { + quantity: maybe( + () => sale.collections.totalCount.toString(), + "…" + ) + } + )} - {i18n.t("Products ({{ number }})", { - number: maybe( - () => sale.products.totalCount.toString(), - "…" - ) - })} + {intl.formatMessage( + { + defaultMessage: "Products ({quantity})", + description: "number of products", + id: "saleDetailsPageProductsQuantity" + }, + { + quantity: maybe( + () => sale.products.totalCount.toString(), + "…" + ) + } + )} diff --git a/src/discounts/components/SaleInfo/SaleInfo.tsx b/src/discounts/components/SaleInfo/SaleInfo.tsx index 2b7a646ff..676884e4b 100644 --- a/src/discounts/components/SaleInfo/SaleInfo.tsx +++ b/src/discounts/components/SaleInfo/SaleInfo.tsx @@ -8,9 +8,10 @@ import { } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import React from "react"; +import { useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; -import i18n from "../../../i18n"; +import { commonMessages } from "@saleor/intl"; import { FormData } from "../SaleDetailsPage"; export interface SaleInfoProps { @@ -40,23 +41,32 @@ const SaleInfo = withStyles(styles, { disabled, errors, onChange - }: SaleInfoProps & WithStyles) => ( - - - - ) => { + const intl = useIntl(); + + return ( + + - - - ) + + + + + ); + } ); SaleInfo.displayName = "SaleInfo"; export default SaleInfo; diff --git a/src/discounts/components/SaleList/SaleList.tsx b/src/discounts/components/SaleList/SaleList.tsx index 54669a3f1..7f07d9d64 100644 --- a/src/discounts/components/SaleList/SaleList.tsx +++ b/src/discounts/components/SaleList/SaleList.tsx @@ -11,6 +11,7 @@ import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; import TableRow from "@material-ui/core/TableRow"; import React from "react"; +import { FormattedMessage } from "react-intl"; import Checkbox from "@saleor/components/Checkbox"; import Date from "@saleor/components/Date"; @@ -19,7 +20,6 @@ import Percent from "@saleor/components/Percent"; import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; -import i18n from "@saleor/i18n"; import { maybe, renderCollection } from "@saleor/misc"; import { ListActions, ListProps } from "@saleor/types"; import { SaleType } from "@saleor/types/globalTypes"; @@ -92,24 +92,22 @@ const SaleList = withStyles(styles, { toolbar={toolbar} > - {i18n.t("Name", { - context: "sale list table header" - })} + - {i18n.t("Starts", { - context: "sale list table header" - })} + - {i18n.t("Ends", { - context: "sale list table header" - })} + - {i18n.t("Value", { - context: "sale list table header" - })} + @@ -193,7 +191,7 @@ const SaleList = withStyles(styles, { () => ( - {i18n.t("No sales found")} + ) diff --git a/src/discounts/components/SaleListPage/SaleListPage.tsx b/src/discounts/components/SaleListPage/SaleListPage.tsx index bf0eca395..88d15f1d3 100644 --- a/src/discounts/components/SaleListPage/SaleListPage.tsx +++ b/src/discounts/components/SaleListPage/SaleListPage.tsx @@ -1,10 +1,11 @@ import Button from "@material-ui/core/Button"; import AddIcon from "@material-ui/icons/Add"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import Container from "@saleor/components/Container"; import PageHeader from "@saleor/components/PageHeader"; -import i18n from "@saleor/i18n"; +import { sectionNames } from "@saleor/intl"; import { ListActions, PageListProps } from "@saleor/types"; import { SaleList_sales_edges_node } from "../../types/SaleList"; import SaleList from "../SaleList"; @@ -17,16 +18,22 @@ export interface SaleListPageProps extends PageListProps, ListActions { const SaleListPage: React.StatelessComponent = ({ onAdd, ...listProps -}) => ( - - - - - - -); +}) => { + const intl = useIntl(); + + return ( + + + + + + + ); +}; SaleListPage.displayName = "SaleListPage"; export default SaleListPage; diff --git a/src/discounts/components/SalePricing/SalePricing.tsx b/src/discounts/components/SalePricing/SalePricing.tsx index 4f5fb3790..ae63b90d3 100644 --- a/src/discounts/components/SalePricing/SalePricing.tsx +++ b/src/discounts/components/SalePricing/SalePricing.tsx @@ -9,11 +9,12 @@ import { import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import Hr from "@saleor/components/Hr"; import TextFieldWithChoice from "@saleor/components/TextFieldWithChoice"; -import i18n from "../../../i18n"; +import { commonMessages } from "@saleor/intl"; import { FormErrors } from "../../../types"; import { SaleType } from "../../../types/globalTypes"; import { FormData } from "../SaleDetailsPage"; @@ -49,75 +50,89 @@ const SalePricing = withStyles(styles, { disabled, errors, onChange - }: SalePricingProps & WithStyles) => ( - - - - ) => { + const intl = useIntl(); + + return ( + + - -
- - - {i18n.t("Time Frame")} - - - - -
- ) + + + +
+ + + + + + + + + ); + } ); SalePricing.displayName = "SalePricing"; export default SalePricing; diff --git a/src/discounts/components/SaleSummary/SaleSummary.tsx b/src/discounts/components/SaleSummary/SaleSummary.tsx index 939b291c9..f5ad7968c 100644 --- a/src/discounts/components/SaleSummary/SaleSummary.tsx +++ b/src/discounts/components/SaleSummary/SaleSummary.tsx @@ -2,6 +2,7 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import Typography from "@material-ui/core/Typography"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import CardSpacer from "@saleor/components/CardSpacer"; import CardTitle from "@saleor/components/CardTitle"; @@ -11,7 +12,7 @@ import Hr from "@saleor/components/Hr"; import Money from "@saleor/components/Money"; import Percent from "@saleor/components/Percent"; import Skeleton from "@saleor/components/Skeleton"; -import i18n from "../../../i18n"; +import { commonMessages } from "@saleor/intl"; import { maybe } from "../../../misc"; import { SaleType } from "../../../types/globalTypes"; import { SaleDetails_sale } from "../../types/SaleDetails"; @@ -24,59 +25,71 @@ export interface SaleSummaryProps { const SaleSummary: React.StatelessComponent = ({ defaultCurrency, sale -}) => ( - - - - {i18n.t("Name")} - - {maybe(() => sale.name, )} - - +}) => { + const intl = useIntl(); - {i18n.t("Value")} - - {maybe( - () => - sale.type === SaleType.FIXED ? ( - - ) : ( - + return ( + + + + + + + + {maybe(() => sale.name, )} + + + + + + + + {maybe( + () => + sale.type === SaleType.FIXED ? ( + + ) : ( + + ), + + )} + + + +
+ + + + + + + {maybe( + () => ( + ), - - )} - + + )} +
+ - -
- - - {i18n.t("Start Date")} - - {maybe( - () => ( - - ), - - )} - - - - {i18n.t("End Date")} - - {maybe( - () => - sale.endDate === null ? "-" : , - - )} - -
-
-); + + + + + {maybe( + () => + sale.endDate === null ? "-" : , + + )} + + + + ); +}; SaleSummary.displayName = "SaleSummary"; export default SaleSummary; diff --git a/src/discounts/components/VoucherCreatePage/VoucherCreatePage.tsx b/src/discounts/components/VoucherCreatePage/VoucherCreatePage.tsx index c04902833..7bb1d3e9b 100644 --- a/src/discounts/components/VoucherCreatePage/VoucherCreatePage.tsx +++ b/src/discounts/components/VoucherCreatePage/VoucherCreatePage.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { useIntl } from "react-intl"; import AppHeader from "@saleor/components/AppHeader"; import CardSpacer from "@saleor/components/CardSpacer"; @@ -8,7 +9,6 @@ import Form from "@saleor/components/Form"; import Grid from "@saleor/components/Grid"; import PageHeader from "@saleor/components/PageHeader"; import SaveButtonBar from "@saleor/components/SaveButtonBar"; -import i18n from "../../../i18n"; import { UserError } from "../../../types"; import { DiscountValueTypeEnum, @@ -21,6 +21,7 @@ import VoucherLimits from "../VoucherLimits"; import VoucherRequirements from "../VoucherRequirements"; import VoucherTypes from "../VoucherTypes"; +import { sectionNames } from "@saleor/intl"; import VoucherValue from "../VoucherValue"; export interface FormData { applyOncePerCustomer: boolean; @@ -58,6 +59,8 @@ const VoucherCreatePage: React.StatelessComponent = ({ onBack, onSubmit }) => { + const intl = useIntl(); + const initialForm: FormData = { applyOncePerCustomer: false, applyOncePerOrder: false, @@ -81,8 +84,15 @@ const VoucherCreatePage: React.StatelessComponent = ({ {({ change, data, errors: formErrors, hasChanged, submit }) => ( - {i18n.t("Vouchers")} - + + {intl.formatMessage(sectionNames.vouchers)} + +
{ + const intl = useIntl(); + return ( - + @@ -72,7 +83,7 @@ const VoucherDates = ({ helperText={errors.endDate} name={"endDate" as keyof FormData} onChange={onChange} - label={i18n.t("End Date")} + label={intl.formatMessage(commonMessages.endDate)} value={data.endDate} type="date" InputLabelProps={{ @@ -86,7 +97,7 @@ const VoucherDates = ({ helperText={errors.endDate} name={"endTime" as keyof FormData} onChange={onChange} - label={i18n.t("End Hour")} + label={intl.formatMessage(commonMessages.endHour)} value={data.endTime} type="time" InputLabelProps={{ diff --git a/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx b/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx index b8b621a72..780ba974e 100644 --- a/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx +++ b/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx @@ -1,5 +1,6 @@ import Typography from "@material-ui/core/Typography"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import AppHeader from "@saleor/components/AppHeader"; import CardSpacer from "@saleor/components/CardSpacer"; @@ -12,7 +13,7 @@ import PageHeader from "@saleor/components/PageHeader"; import SaveButtonBar from "@saleor/components/SaveButtonBar"; import { Tab, TabContainer } from "@saleor/components/Tab"; import { RequirementsPicker } from "@saleor/discounts/types"; -import i18n from "../../../i18n"; +import { sectionNames } from "@saleor/intl"; import { maybe, splitDateTime } from "../../../misc"; import { ListProps, TabListActions, UserError } from "../../../types"; import { @@ -128,6 +129,8 @@ const VoucherDetailsPage: React.StatelessComponent = ({ collectionListToolbar, productListToolbar }) => { + const intl = useIntl(); + let requirementsPickerInitValue; if (maybe(() => voucher.minAmountSpent.amount) > 0) { requirementsPickerInitValue = RequirementsPicker.ORDER; @@ -166,7 +169,9 @@ const VoucherDetailsPage: React.StatelessComponent = ({ {({ change, data, errors: formErrors, hasChanged, submit }) => ( - {i18n.t("Vouchers")} + + {intl.formatMessage(sectionNames.vouchers)} + voucher.code)} />
@@ -204,34 +209,52 @@ const VoucherDetailsPage: React.StatelessComponent = ({ isActive={activeTab === VoucherDetailsPageTab.categories} changeTab={onTabClick} > - {i18n.t("Categories ({{ number }})", { - number: maybe( - () => voucher.categories.totalCount.toString(), - "…" - ) - })} + {intl.formatMessage( + { + defaultMessage: "Categories ({quantity})", + description: "number of categories" + }, + { + quantity: maybe( + () => voucher.categories.totalCount.toString(), + "…" + ) + } + )} - {i18n.t("Collections ({{ number }})", { - number: maybe( - () => voucher.collections.totalCount.toString(), - "…" - ) - })} + {intl.formatMessage( + { + defaultMessage: "Collections ({quantity})", + description: "number of collections" + }, + { + quantity: maybe( + () => voucher.collections.totalCount.toString(), + "…" + ) + } + )} - {i18n.t("Products ({{ number }})", { - number: maybe( - () => voucher.products.totalCount.toString(), - "…" - ) - })} + {intl.formatMessage( + { + defaultMessage: "Products ({quantity})", + description: "number of products" + }, + { + quantity: maybe( + () => voucher.products.totalCount.toString(), + "…" + ) + } + )} @@ -291,12 +314,17 @@ const VoucherDetailsPage: React.StatelessComponent = ({ voucher.countries)} disabled={disabled} - emptyText={i18n.t("Voucher applies to all countries")} + emptyText={intl.formatMessage({ + defaultMessage: "Voucher applies to all countries" + })} title={ <> - {i18n.t("Countries")} + {intl.formatMessage({ + defaultMessage: "Countries", + description: "voucher country range" + })} - {i18n.t("Vouchers limited to these countries")} + } diff --git a/src/discounts/components/VoucherInfo/VoucherInfo.tsx b/src/discounts/components/VoucherInfo/VoucherInfo.tsx index 6b93e08ae..0251afac7 100644 --- a/src/discounts/components/VoucherInfo/VoucherInfo.tsx +++ b/src/discounts/components/VoucherInfo/VoucherInfo.tsx @@ -2,10 +2,11 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import TextField from "@material-ui/core/TextField"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import Button from "@material-ui/core/Button"; import CardTitle from "@saleor/components/CardTitle"; -import i18n from "../../../i18n"; +import { commonMessages } from "@saleor/intl"; import { generateCode } from "../../../misc"; import { FormErrors } from "../../../types"; import { FormData } from "../VoucherDetailsPage"; @@ -25,6 +26,8 @@ const VoucherInfo = ({ variant, onChange }: VoucherInfoProps) => { + const intl = useIntl(); + const onGenerateCode = () => onChange({ target: { @@ -36,11 +39,14 @@ const VoucherInfo = ({ return ( - {i18n.t("Generate Code")} + ) } @@ -52,7 +58,9 @@ const VoucherInfo = ({ fullWidth helperText={errors.code} name={"code" as keyof FormData} - label={i18n.t("Discount Code")} + label={intl.formatMessage({ + defaultMessage: "Discount Code" + })} value={data.code} onChange={onChange} /> diff --git a/src/discounts/components/VoucherLimits/VoucherLimits.tsx b/src/discounts/components/VoucherLimits/VoucherLimits.tsx index 224c8e360..995e3da57 100644 --- a/src/discounts/components/VoucherLimits/VoucherLimits.tsx +++ b/src/discounts/components/VoucherLimits/VoucherLimits.tsx @@ -2,10 +2,10 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import TextField from "@material-ui/core/TextField"; import React from "react"; +import { useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import { ControlledCheckbox } from "@saleor/components/ControlledCheckbox"; -import i18n from "../../../i18n"; import { FormErrors } from "../../../types"; import { FormData } from "../VoucherDetailsPage"; @@ -23,15 +23,23 @@ const VoucherLimits = ({ errors, onChange }: VoucherLimitsProps) => { + const intl = useIntl(); + return ( - + @@ -40,7 +48,10 @@ const VoucherLimits = ({ disabled={disabled} error={!!errors.usageLimit} helperText={errors.usageLimit} - label={i18n.t("Limit of Uses")} + label={intl.formatMessage({ + defaultMessage: "Limit of Uses", + description: "voucher" + })} name={"usageLimit" as keyof FormData} value={data.usageLimit} onChange={onChange} @@ -53,7 +64,10 @@ const VoucherLimits = ({ )} diff --git a/src/discounts/components/VoucherList/VoucherList.tsx b/src/discounts/components/VoucherList/VoucherList.tsx index 0c8dda994..5c30a56c1 100644 --- a/src/discounts/components/VoucherList/VoucherList.tsx +++ b/src/discounts/components/VoucherList/VoucherList.tsx @@ -11,6 +11,7 @@ import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; import TableRow from "@material-ui/core/TableRow"; import React from "react"; +import { FormattedMessage } from "react-intl"; import Checkbox from "@saleor/components/Checkbox"; import Date from "@saleor/components/Date"; @@ -19,7 +20,6 @@ import Percent from "@saleor/components/Percent"; import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; -import i18n from "@saleor/i18n"; import { maybe, renderCollection } from "@saleor/misc"; import { ListActions, ListProps } from "@saleor/types"; import { DiscountValueTypeEnum } from "@saleor/types/globalTypes"; @@ -107,34 +107,40 @@ const VoucherList = withStyles(styles, { toolbar={toolbar} > - {i18n.t("Code", { - context: "voucher list table header" - })} + - {i18n.t("Min. Spent", { - context: "voucher list table header" - })} + - {i18n.t("Starts", { - context: "voucher list table header" - })} + - {i18n.t("Ends", { - context: "voucher list table header" - })} + - {i18n.t("Value", { - context: "voucher list table header" - })} + - {i18n.t("Uses", { - context: "voucher list table header" - })} + @@ -239,7 +245,7 @@ const VoucherList = withStyles(styles, { () => ( - {i18n.t("No vouchers found")} + ) diff --git a/src/discounts/components/VoucherListPage/VoucherListPage.tsx b/src/discounts/components/VoucherListPage/VoucherListPage.tsx index f8b75c59a..6b37bc62c 100644 --- a/src/discounts/components/VoucherListPage/VoucherListPage.tsx +++ b/src/discounts/components/VoucherListPage/VoucherListPage.tsx @@ -1,10 +1,11 @@ import Button from "@material-ui/core/Button"; import AddIcon from "@material-ui/icons/Add"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import Container from "@saleor/components/Container"; import PageHeader from "@saleor/components/PageHeader"; -import i18n from "@saleor/i18n"; +import { sectionNames } from "@saleor/intl"; import { ListActions, PageListProps } from "@saleor/types"; import { VoucherList_vouchers_edges_node } from "../../types/VoucherList"; import VoucherList from "../VoucherList"; @@ -30,31 +31,35 @@ const VoucherListPage: React.StatelessComponent = ({ toggle, toggleAll, toolbar -}) => ( - - - - - - -); +}) => { + const intl = useIntl(); + + return ( + + + + + + + ); +}; VoucherListPage.displayName = "VoucherListPage"; export default VoucherListPage; diff --git a/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx b/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx index 4ff9a8aa3..ee9e0b50b 100644 --- a/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx +++ b/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx @@ -2,12 +2,12 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import TextField from "@material-ui/core/TextField"; import React from "react"; +import { useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import { FormSpacer } from "@saleor/components/FormSpacer"; import RadioGroupField from "@saleor/components/RadioGroupField"; import { RequirementsPicker } from "@saleor/discounts/types"; -import i18n from "@saleor/i18n"; import { FormErrors } from "@saleor/types"; import { FormData } from "../VoucherDetailsPage"; @@ -25,24 +25,43 @@ const VoucherRequirements = ({ errors, onChange }: VoucherRequirementsProps) => { + const intl = useIntl(); + + const minimalOrderValueText = intl.formatMessage({ + defaultMessage: "Minimal order value", + description: "voucher requirement" + }); + const minimalQuantityText = intl.formatMessage({ + defaultMessage: "Minimum quantity of items", + description: "voucher requirement" + }); + const requirementsPickerChoices = [ { - label: i18n.t("None"), + label: intl.formatMessage({ + defaultMessage: "None", + description: "voucher has no requirements" + }), value: RequirementsPicker.NONE }, { - label: i18n.t("Minimal order value"), + label: minimalOrderValueText, value: RequirementsPicker.ORDER }, { - label: i18n.t("Minimum quantity of items"), + label: minimalQuantityText, value: RequirementsPicker.ITEM } ]; return ( - + = ({ defaultCurrency, voucher }) => { + const intl = useIntl(); + const translatedVoucherTypes = translateVoucherTypes(); return ( - + - {i18n.t("Code")} + + + {maybe(() => voucher.code, )} - {i18n.t("Applies to")} + + + {maybe( () => translatedVoucherTypes[voucher.type], @@ -47,7 +54,12 @@ const VoucherSummary: React.StatelessComponent = ({ - {i18n.t("Value")} + + + {maybe( () => @@ -69,7 +81,9 @@ const VoucherSummary: React.StatelessComponent = ({
- {i18n.t("Start Date")} + + {intl.formatMessage(commonMessages.startDate)} + {maybe( () => ( @@ -80,7 +94,9 @@ const VoucherSummary: React.StatelessComponent = ({ - {i18n.t("End Date")} + + {intl.formatMessage(commonMessages.endDate)} + {maybe( () => @@ -97,7 +113,12 @@ const VoucherSummary: React.StatelessComponent = ({
- {i18n.t("Min. Order Value")} + + + {maybe( () => @@ -111,7 +132,12 @@ const VoucherSummary: React.StatelessComponent = ({ - {i18n.t("Usage Limit")} + + + {maybe( () => (voucher.usageLimit === null ? "-" : voucher.usageLimit), diff --git a/src/discounts/components/VoucherTypes/VoucherTypes.tsx b/src/discounts/components/VoucherTypes/VoucherTypes.tsx index 65074806e..8108ecdb4 100644 --- a/src/discounts/components/VoucherTypes/VoucherTypes.tsx +++ b/src/discounts/components/VoucherTypes/VoucherTypes.tsx @@ -1,11 +1,11 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import React from "react"; +import { useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import Grid from "@saleor/components/Grid"; import RadioGroupField from "@saleor/components/RadioGroupField"; -import i18n from "../../../i18n"; import { FormErrors } from "../../../types"; import { DiscountValueTypeEnum } from "../../../types/globalTypes"; import { FormData } from "../VoucherDetailsPage"; @@ -23,24 +23,40 @@ const VoucherTypes = ({ errors, onChange }: VoucherTypesProps) => { + const intl = useIntl(); + const voucherTypeChoices = [ { - label: i18n.t("Fixed Amount"), + label: intl.formatMessage({ + defaultMessage: "Fixed Amount", + description: "voucher discount type" + }), value: DiscountValueTypeEnum.FIXED }, { - label: i18n.t("Percentage"), + label: intl.formatMessage({ + defaultMessage: "Percentage", + description: "voucher discount type" + }), value: DiscountValueTypeEnum.PERCENTAGE }, { - label: i18n.t("Free Shipping"), + label: intl.formatMessage({ + defaultMessage: "Free Shipping", + description: "voucher discount type" + }), value: "SHIPPING" } ]; return ( - + { + const intl = useIntl(); + const translatedVoucherTypes = translateVoucherTypes(); const voucherTypeChoices = Object.values(VoucherType).map(type => ({ label: translatedVoucherTypes[type], @@ -45,7 +47,12 @@ const VoucherValue = ({ return ( - + - {i18n.t("Only once per order", { - context: "voucher application" - })} + - {i18n.t( - "If this option is disabled, discount will be counted for every eligible product" - )} + } diff --git a/src/discounts/index.tsx b/src/discounts/index.tsx index 81d336ff4..22c95c9bd 100644 --- a/src/discounts/index.tsx +++ b/src/discounts/index.tsx @@ -1,9 +1,10 @@ import { parse as parseQs } from "qs"; import React from "react"; +import { useIntl } from "react-intl"; import { Route, RouteComponentProps, Switch } from "react-router-dom"; +import { sectionNames } from "@saleor/intl"; import { WindowTitle } from "../components/WindowTitle"; -import i18n from "../i18n"; import { saleDetailsPageTab } from "./components/SaleDetailsPage"; import { voucherDetailsPageTab } from "./components/VoucherDetailsPage"; import { @@ -73,17 +74,21 @@ const VoucherDetailsView: React.StatelessComponent< ); }; -export const DiscountSection: React.StatelessComponent<{}> = () => ( - <> - - - - - - - - - - -); +export const DiscountSection: React.StatelessComponent<{}> = () => { + const intl = useIntl(); + + return ( + <> + + + + + + + + + + + ); +}; export default DiscountSection; diff --git a/src/discounts/views/SaleCreate.tsx b/src/discounts/views/SaleCreate.tsx index 445a07bbc..ec9e40e61 100644 --- a/src/discounts/views/SaleCreate.tsx +++ b/src/discounts/views/SaleCreate.tsx @@ -1,10 +1,11 @@ import React from "react"; +import { useIntl } from "react-intl"; import { WindowTitle } from "@saleor/components/WindowTitle"; import useNavigator from "@saleor/hooks/useNavigator"; import useNotifier from "@saleor/hooks/useNotifier"; import useShop from "@saleor/hooks/useShop"; -import i18n from "../../i18n"; +import { sectionNames } from "@saleor/intl"; import { decimal, getMutationState, maybe } from "../../misc"; import { DiscountValueTypeEnum, SaleType } from "../../types/globalTypes"; import SaleCreatePage from "../components/SaleCreatePage"; @@ -22,12 +23,13 @@ export const SaleDetails: React.StatelessComponent = () => { const navigate = useNavigator(); const pushMessage = useNotifier(); const shop = useShop(); + const intl = useIntl(); const handleSaleCreate = (data: SaleCreate) => { if (data.saleCreate.errors.length === 0) { pushMessage({ - text: i18n.t("Successfully created sale", { - context: "notification" + text: intl.formatMessage({ + defaultMessage: "Successfully created sale" }) }); navigate(saleUrl(data.saleCreate.sale.id), true); @@ -45,7 +47,7 @@ export const SaleDetails: React.StatelessComponent = () => { return ( <> - + shop.defaultCurrency)} disabled={saleCreateOpts.loading} diff --git a/src/discounts/views/SaleDetails.tsx b/src/discounts/views/SaleDetails.tsx index d74c74531..63d677479 100644 --- a/src/discounts/views/SaleDetails.tsx +++ b/src/discounts/views/SaleDetails.tsx @@ -1,6 +1,7 @@ import Button from "@material-ui/core/Button"; import DialogContentText from "@material-ui/core/DialogContentText"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import ActionDialog from "@saleor/components/ActionDialog"; import AssignCategoriesDialog from "@saleor/components/AssignCategoryDialog"; @@ -14,13 +15,13 @@ import usePaginator, { createPaginationState } from "@saleor/hooks/usePaginator"; import useShop from "@saleor/hooks/useShop"; +import { commonMessages, sectionNames } from "@saleor/intl"; import { categoryUrl } from "../../categories/urls"; import { collectionUrl } from "../../collections/urls"; import { DEFAULT_INITIAL_SEARCH_DATA, PAGINATE_BY } from "../../config"; import SearchCategories from "../../containers/SearchCategories"; import SearchCollections from "../../containers/SearchCollections"; import SearchProducts from "../../containers/SearchProducts"; -import i18n from "../../i18n"; import { decimal, getMutationState, maybe } from "../../misc"; import { productUrl } from "../../products/urls"; import { DiscountValueTypeEnum, SaleType } from "../../types/globalTypes"; @@ -67,6 +68,7 @@ export const SaleDetails: React.StatelessComponent = ({ const { isSelected, listElements, reset, toggle, toggleAll } = useBulkActions( params.ids ); + const intl = useIntl(); const paginationState = createPaginationState(PAGINATE_BY, params); const changeTab = (tab: SaleDetailsPageTab) => { @@ -81,8 +83,8 @@ export const SaleDetails: React.StatelessComponent = ({ const handleSaleDelete = (data: SaleDelete) => { if (data.saleDelete.errors.length === 0) { notify({ - text: i18n.t("Removed sale", { - context: "notification" + text: intl.formatMessage({ + defaultMessage: "Removed sale" }) }); navigate(saleListUrl(), true); @@ -92,9 +94,7 @@ export const SaleDetails: React.StatelessComponent = ({ const handleSaleUpdate = (data: SaleUpdate) => { if (data.saleUpdate.errors.length === 0) { notify({ - text: i18n.t("Updated sale", { - context: "notification" - }) + text: intl.formatMessage(commonMessages.savedChanges) }); } }; @@ -131,6 +131,8 @@ export const SaleDetails: React.StatelessComponent = ({ } }; + const canOpenBulkActionDialog = maybe(() => params.ids.length > 0); + return ( {(saleCataloguesRemove, saleCataloguesRemoveOpts) => ( @@ -222,7 +224,9 @@ export const SaleDetails: React.StatelessComponent = ({ return ( <> - + shop.defaultCurrency @@ -295,7 +299,11 @@ export const SaleDetails: React.StatelessComponent = ({ openModal("unassign-category", listElements) } > - {i18n.t("Unassign")} + } collectionListToolbar={ @@ -308,7 +316,11 @@ export const SaleDetails: React.StatelessComponent = ({ ) } > - {i18n.t("Unassign")} + } productListToolbar={ @@ -318,7 +330,11 @@ export const SaleDetails: React.StatelessComponent = ({ openModal("unassign-product", listElements) } > - {i18n.t("Unassign")} + } isChecked={isSelected} @@ -437,77 +453,111 @@ export const SaleDetails: React.StatelessComponent = ({ )} handleCategoriesUnassign(params.ids) } > - {{ saleName }} categories?", - { - saleName: maybe( - () => params.ids.length.toString(), - "..." + {canOpenBulkActionDialog && ( + + {params.ids.length} ) - } - ) - }} - /> + }} + /> + + )} handleCollectionsUnassign(params.ids) } > - {{ saleName }} collections?", - { - saleName: maybe( - () => params.ids.length.toString(), - "..." + {canOpenBulkActionDialog && ( + + {params.ids.length} ) - } - ) - }} - /> + }} + /> + + )} handleProductsUnassign(params.ids) } > - {{ saleName }} products?", - { - saleName: maybe( - () => params.ids.length.toString(), - "..." + {canOpenBulkActionDialog && ( + + {params.ids.length} ) - } - ) - }} - /> + }} + /> + + )} = ({ }) } > - {{ saleName }}?", - { - saleName: maybe( - () => data.sale.name, - "..." - ) - } - ) - }} - /> + + + {maybe(() => data.sale.name, "...")} + + ) + }} + /> + ); diff --git a/src/discounts/views/SaleList.tsx b/src/discounts/views/SaleList.tsx index c159bf502..319b908dc 100644 --- a/src/discounts/views/SaleList.tsx +++ b/src/discounts/views/SaleList.tsx @@ -2,6 +2,7 @@ import DialogContentText from "@material-ui/core/DialogContentText"; import IconButton from "@material-ui/core/IconButton"; import DeleteIcon from "@material-ui/icons/Delete"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import ActionDialog from "@saleor/components/ActionDialog"; import { WindowTitle } from "@saleor/components/WindowTitle"; @@ -13,7 +14,7 @@ import usePaginator, { createPaginationState } from "@saleor/hooks/usePaginator"; import useShop from "@saleor/hooks/useShop"; -import i18n from "@saleor/i18n"; +import { commonMessages, sectionNames } from "@saleor/intl"; import { getMutationState, maybe } from "@saleor/misc"; import { ListViews } from "@saleor/types"; import SaleListPage from "../components/SaleListPage"; @@ -44,10 +45,12 @@ export const SaleList: React.StatelessComponent = ({ const { updateListSettings, settings } = useListSettings( ListViews.SALES_LIST ); + const intl = useIntl(); const closeModal = () => navigate(saleListUrl(), true); const paginationState = createPaginationState(settings.rowNumber, params); + const canOpenBulkActionDialog = maybe(() => params.ids.length > 0); return ( @@ -61,7 +64,7 @@ export const SaleList: React.StatelessComponent = ({ const handleSaleBulkDelete = (data: SaleBulkDelete) => { if (data.saleBulkDelete.errors.length === 0) { notify({ - text: i18n.t("Removed sales") + text: intl.formatMessage(commonMessages.savedChanges) }); reset(); closeModal(); @@ -86,7 +89,7 @@ export const SaleList: React.StatelessComponent = ({ return ( <> - + shop.defaultCurrency)} sales={maybe(() => data.sales.edges.map(edge => edge.node))} @@ -122,23 +125,30 @@ export const SaleList: React.StatelessComponent = ({ confirmButtonState={bulkRemoveTransitionState} onClose={closeModal} onConfirm={onSaleBulkDelete} - open={params.action === "remove"} - title={i18n.t("Remove Sales")} + open={params.action === "remove" && canOpenBulkActionDialog} + title={intl.formatMessage({ + defaultMessage: "Delete Sales", + description: "dialog header" + })} variant="delete" > - {{ number }} sales?", - { - number: maybe( - () => params.ids.length.toString(), - "..." + {canOpenBulkActionDialog && ( + + {params.ids.length} ) - } - ) - }} - /> + }} + /> + + )} ); diff --git a/src/discounts/views/VoucherCreate.tsx b/src/discounts/views/VoucherCreate.tsx index cc4a7bc33..5d55c6273 100644 --- a/src/discounts/views/VoucherCreate.tsx +++ b/src/discounts/views/VoucherCreate.tsx @@ -1,10 +1,11 @@ import React from "react"; +import { useIntl } from "react-intl"; import { WindowTitle } from "@saleor/components/WindowTitle"; import useNavigator from "@saleor/hooks/useNavigator"; import useNotifier from "@saleor/hooks/useNotifier"; import useShop from "@saleor/hooks/useShop"; -import i18n from "../../i18n"; +import { sectionNames } from "@saleor/intl"; import { decimal, getMutationState, joinDateTime, maybe } from "../../misc"; import { DiscountValueTypeEnum, @@ -20,12 +21,13 @@ export const VoucherDetails: React.StatelessComponent = () => { const navigate = useNavigator(); const notify = useNotifier(); const shop = useShop(); + const intl = useIntl(); const handleVoucherCreate = (data: VoucherCreate) => { if (data.voucherCreate.errors.length === 0) { notify({ - text: i18n.t("Successfully created voucher", { - context: "notification" + text: intl.formatMessage({ + defaultMessage: "Successfully created voucher" }) }); navigate(voucherUrl(data.voucherCreate.voucher.id), true); @@ -43,7 +45,7 @@ export const VoucherDetails: React.StatelessComponent = () => { return ( <> - + shop.defaultCurrency)} disabled={voucherCreateOpts.loading} diff --git a/src/discounts/views/VoucherDetails.tsx b/src/discounts/views/VoucherDetails.tsx index c7f90799e..9584f07de 100644 --- a/src/discounts/views/VoucherDetails.tsx +++ b/src/discounts/views/VoucherDetails.tsx @@ -1,6 +1,7 @@ import Button from "@material-ui/core/Button"; import DialogContentText from "@material-ui/core/DialogContentText"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import ActionDialog from "@saleor/components/ActionDialog"; import AssignCategoriesDialog from "@saleor/components/AssignCategoryDialog"; @@ -14,13 +15,13 @@ import usePaginator, { createPaginationState } from "@saleor/hooks/usePaginator"; import useShop from "@saleor/hooks/useShop"; +import { commonMessages, sectionNames } from "@saleor/intl"; import { categoryUrl } from "../../categories/urls"; import { collectionUrl } from "../../collections/urls"; import { DEFAULT_INITIAL_SEARCH_DATA, PAGINATE_BY } from "../../config"; import SearchCategories from "../../containers/SearchCategories"; import SearchCollections from "../../containers/SearchCollections"; import SearchProducts from "../../containers/SearchProducts"; -import i18n from "../../i18n"; import { decimal, getMutationState, joinDateTime, maybe } from "../../misc"; import { productUrl } from "../../products/urls"; import { @@ -66,6 +67,7 @@ export const VoucherDetails: React.StatelessComponent = ({ const { isSelected, listElements, reset, toggle, toggleAll } = useBulkActions( params.ids ); + const intl = useIntl(); const paginationState = createPaginationState(PAGINATE_BY, params); const changeTab = (tab: VoucherDetailsPageTab) => { @@ -80,8 +82,8 @@ export const VoucherDetails: React.StatelessComponent = ({ const handleVoucherDelete = (data: VoucherDelete) => { if (data.voucherDelete.errors.length === 0) { notify({ - text: i18n.t("Removed voucher", { - context: "notification" + text: intl.formatMessage({ + defaultMessage: "Deleted voucher" }) }); navigate(voucherListUrl(), true); @@ -92,9 +94,7 @@ export const VoucherDetails: React.StatelessComponent = ({ if (data.voucherUpdate.errors.length === 0) { closeModal(); notify({ - text: i18n.t("Updated voucher", { - context: "notification" - }) + text: intl.formatMessage(commonMessages.savedChanges) }); } }; @@ -130,6 +130,8 @@ export const VoucherDetails: React.StatelessComponent = ({ } }; + const canOpenBulkActionDialog = maybe(() => params.ids.length > 0); + return ( {(voucherCataloguesRemove, voucherCataloguesRemoveOpts) => ( @@ -225,7 +227,9 @@ export const VoucherDetails: React.StatelessComponent = ({ return ( <> - + shop.defaultCurrency @@ -374,7 +378,11 @@ export const VoucherDetails: React.StatelessComponent = ({ openModal("unassign-category", listElements) } > - {i18n.t("Unassign")} + } collectionListToolbar={ @@ -387,7 +395,11 @@ export const VoucherDetails: React.StatelessComponent = ({ ) } > - {i18n.t("Unassign")} + } productListToolbar={ @@ -397,7 +409,11 @@ export const VoucherDetails: React.StatelessComponent = ({ openModal("unassign-product", listElements) } > - {i18n.t("Unassign")} + } isChecked={isSelected} @@ -539,77 +555,113 @@ export const VoucherDetails: React.StatelessComponent = ({ )} handleCategoriesUnassign(params.ids) } > - {{ saleName }} categories?", - { - saleName: maybe( - () => params.ids.length.toString(), - "..." + {canOpenBulkActionDialog && ( + + {params.ids.length} ) - } - ) - }} - /> + }} + /> + + )} handleCollectionsUnassign(params.ids) } > - {{ saleName }} collections?", - { - saleName: maybe( - () => params.ids.length.toString(), - "..." + {canOpenBulkActionDialog && ( + + {params.ids.length} ) - } - ) - }} - /> + }} + /> + + )} handleProductsUnassign(params.ids) } > - {{ saleName }} products?", - { - saleName: maybe( - () => params.ids.length.toString(), - "..." + {canOpenBulkActionDialog && ( + + {params.ids.length} ) - } - ) - }} - /> + }} + /> + + )} = ({ }) } > - {{ voucherCode }}?", - { - voucherCode: maybe( - () => data.voucher.code, - "..." - ) - } - ) - }} - /> + + + {maybe(() => data.voucher.code, "...")} + + ) + }} + /> + ); diff --git a/src/discounts/views/VoucherList.tsx b/src/discounts/views/VoucherList.tsx index fe47592a2..e70830261 100644 --- a/src/discounts/views/VoucherList.tsx +++ b/src/discounts/views/VoucherList.tsx @@ -2,6 +2,7 @@ import DialogContentText from "@material-ui/core/DialogContentText"; import IconButton from "@material-ui/core/IconButton"; import DeleteIcon from "@material-ui/icons/Delete"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import ActionDialog from "@saleor/components/ActionDialog"; import { WindowTitle } from "@saleor/components/WindowTitle"; @@ -13,7 +14,7 @@ import usePaginator, { createPaginationState } from "@saleor/hooks/usePaginator"; import useShop from "@saleor/hooks/useShop"; -import i18n from "@saleor/i18n"; +import { commonMessages, sectionNames } from "@saleor/intl"; import { getMutationState, maybe } from "@saleor/misc"; import { ListViews } from "@saleor/types"; import VoucherListPage from "../components/VoucherListPage"; @@ -44,10 +45,12 @@ export const VoucherList: React.StatelessComponent = ({ const { updateListSettings, settings } = useListSettings( ListViews.VOUCHER_LIST ); + const intl = useIntl(); const closeModal = () => navigate(voucherListUrl(), true); const paginationState = createPaginationState(settings.rowNumber, params); + const canOpenBulkActionDialog = maybe(() => params.ids.length > 0); return ( @@ -61,7 +64,7 @@ export const VoucherList: React.StatelessComponent = ({ const handleVoucherBulkDelete = (data: VoucherBulkDelete) => { if (data.voucherBulkDelete.errors.length === 0) { notify({ - text: i18n.t("Removed vouchers") + text: intl.formatMessage(commonMessages.savedChanges) }); reset(); closeModal(); @@ -85,7 +88,9 @@ export const VoucherList: React.StatelessComponent = ({ }); return ( <> - + shop.defaultCurrency)} settings={settings} @@ -123,23 +128,30 @@ export const VoucherList: React.StatelessComponent = ({ confirmButtonState={bulkRemoveTransitionState} onClose={closeModal} onConfirm={onVoucherBulkDelete} - open={params.action === "remove"} - title={i18n.t("Remove Vouchers")} + open={params.action === "remove" && canOpenBulkActionDialog} + title={intl.formatMessage({ + defaultMessage: "Delete Vouchers", + description: "dialog header" + })} variant="delete" > - {{ number }} vouchers?", - { - number: maybe( - () => params.ids.length.toString(), - "..." + {canOpenBulkActionDialog && ( + + {params.ids.length} ) - } - ) - }} - /> + }} + /> + + )} ); diff --git a/src/intl.ts b/src/intl.ts index ce6aabb09..2643f8bb0 100644 --- a/src/intl.ts +++ b/src/intl.ts @@ -13,6 +13,12 @@ export const commonMessages = defineMessages({ email: { defaultMessage: "E-mail Address" }, + endDate: { + defaultMessage: "End Date" + }, + endHour: { + defaultMessage: "End Hour" + }, firstName: { defaultMessage: "First Name" }, @@ -28,6 +34,15 @@ export const commonMessages = defineMessages({ savedChanges: { defaultMessage: "Saved changes" }, + startDate: { + defaultMessage: "Start Date" + }, + startHour: { + defaultMessage: "Start Hour" + }, + summary: { + defaultMessage: "Summary" + }, uploadImage: { defaultMessage: "Upload image", description: "button" @@ -94,6 +109,10 @@ export const sectionNames = defineMessages({ defaultMessage: "Product Types", description: "product types section name" }, + sales: { + defaultMessage: "Sales", + description: "sales section name" + }, shipping: { defaultMessage: "Shipping Methods", description: "shipping section name" @@ -109,5 +128,9 @@ export const sectionNames = defineMessages({ taxes: { defaultMessage: "Taxes", description: "taxes section name" + }, + vouchers: { + defaultMessage: "Vouchers", + description: "vouchers section name" } });