diff --git a/locale/messages.pot b/locale/messages.pot index 429a4052b..ac178b163 100644 --- a/locale/messages.pot +++ b/locale/messages.pot @@ -1,6 +1,6 @@ msgid "" msgstr "" -"POT-Creation-Date: 2019-08-22T16:11:26.423Z\n" +"POT-Creation-Date: 2019-08-23T12:11:14.694Z\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "MIME-Version: 1.0\n" @@ -15,6 +15,14 @@ msgctxt "attribute value edit error" msgid "A value named {name} already exists" msgstr "" +#: build/locale/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.json +#. [customerAddressDialogAddAddress] - dialog title +#. defaultMessage is: +#. Add Address +msgctxt "dialog title" +msgid "Add Address" +msgstr "" + #: build/locale/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.json #. [src.attributes.components.AttributeValueEditDialog.1841790893] - add attribute value #. defaultMessage is: @@ -23,6 +31,14 @@ msgctxt "add attribute value" msgid "Add Value" msgstr "" +#: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json +#. [customerAddressListPageAddAddress] - button +#. defaultMessage is: +#. Add address +msgctxt "button" +msgid "Add address" +msgstr "" + #: build/locale/src/attributes/components/AttributeListPage/AttributeListPage.json #. [src.attributes.components.AttributeListPage.350498821] - button #. defaultMessage is: @@ -55,6 +71,22 @@ msgctxt "button" msgid "Add collection" msgstr "" +#: build/locale/src/customers/components/CustomerCreatePage/CustomerCreatePage.json +#. [customerCreatePageHeader] - page header +#. defaultMessage is: +#. Add customer +msgctxt "page header" +msgid "Add customer" +msgstr "" + +#: build/locale/src/customers/components/CustomerListPage/CustomerListPage.json +#. [customerListPageAddCustomer] - button +#. defaultMessage is: +#. Add customer +msgctxt "button" +msgid "Add customer" +msgstr "" + #: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json #. [src.categories.components.CategoryProducts.3554578821] - button #. defaultMessage is: @@ -123,6 +155,30 @@ msgctxt "description" msgid "Added product to collection" msgstr "" +#: build/locale/src/customers/components/CustomerAddresses/CustomerAddresses.json +#. [customerAddressesAddressSectionHeader] - subsection header +#. defaultMessage is: +#. Address +msgctxt "subsection header" +msgid "Address" +msgstr "" + +#: build/locale/src/customers/components/CustomerAddresses/CustomerAddresses.json +#. [customerAddressesHeader] - header +#. defaultMessage is: +#. Address Information +msgctxt "header" +msgid "Address Information" +msgstr "" + +#: build/locale/src/customers/components/CustomerAddress/CustomerAddress.json +#. [customerAddressHeader] - addres card header +#. defaultMessage is: +#. Address {addressNumber} +msgctxt "addres card header" +msgid "Address {addressNumber}" +msgstr "" + #: build/locale/src/attributes/components/AttributeValues/AttributeValues.json #. [src.attributes.components.AttributeValues.1565474525] - attribute values list: slug column header #. defaultMessage is: @@ -239,6 +295,30 @@ msgctxt "description" msgid "Are you sure you want to publish {counter,plural,one{this collection} other{{displayQuantity} collections}}?" msgstr "" +#: build/locale/src/customers/views/CustomerAddresses.json +#. [customerAddressesRemoveAddressDialogContent] +#. defaultMessage is: +#. Are you sure you want to remove this address from users address book? +msgctxt "description" +msgid "Are you sure you want to remove this address from users address book?" +msgstr "" + +#: build/locale/src/customers/views/CustomerDetails.json +#. [customerDetailsRemoveCustomerDialogContent] - remove customer dialog content +#. defaultMessage is: +#. Are you sure you want to remove {email}? +msgctxt "remove customer dialog content" +msgid "Are you sure you want to remove {email}?" +msgstr "" + +#: build/locale/src/customers/views/CustomerList.json +#. [customerListRemoveCustomersDialogContent] +#. defaultMessage is: +#. Are you sure you want to remove {number} customers? +msgctxt "description" +msgid "Are you sure you want to remove {number} customers?" +msgstr "" + #: build/locale/src/collections/views/CollectionDetails.json #. [src.collections.views.1908998638] #. defaultMessage is: @@ -339,11 +419,19 @@ msgctxt "section header" msgid "Background image (optional)" msgstr "" +#: build/locale/src/customers/components/CustomerAddresses/CustomerAddresses.json +#. [customerAddressesBillingAddressSectionHeader] - subsection header +#. defaultMessage is: +#. Billing address +msgctxt "subsection header" +msgid "Billing address" +msgstr "" + #: build/locale/src/intl.json -#. [src.cancel] +#. [src.cancel] - button #. defaultMessage is: #. Cancel -msgctxt "description" +msgctxt "button" msgid "Cancel" msgstr "" @@ -412,10 +500,18 @@ msgid "Collections" msgstr "" #: build/locale/src/intl.json -#. [src.confirm] +#. [src.configuration] - configuration section name +#. defaultMessage is: +#. Configuration +msgctxt "configuration section name" +msgid "Configuration" +msgstr "" + +#: build/locale/src/intl.json +#. [src.confirm] - button #. defaultMessage is: #. Confirm -msgctxt "description" +msgctxt "button" msgid "Confirm" msgstr "" @@ -451,6 +547,14 @@ msgctxt "window title" msgid "Create collection" msgstr "" +#: build/locale/src/customers/views/CustomerCreate.json +#. [customerCreateWindowTitle] - window title +#. defaultMessage is: +#. Create customer +msgctxt "window title" +msgid "Create customer" +msgstr "" + #: build/locale/src/collections/views/CollectionCreate.json #. [src.collections.views.1597339737] #. defaultMessage is: @@ -459,6 +563,86 @@ msgctxt "description" msgid "Created collection" msgstr "" +#: build/locale/src/customers/components/CustomerList/CustomerList.json +#. [customerListCustomerEmailColumnHeader] - customer list: column header +#. defaultMessage is: +#. Customer Email +msgctxt "customer list: column header" +msgid "Customer Email" +msgstr "" + +#: build/locale/src/customers/components/CustomerStats/CustomerStats.json +#. [customerStatsHeader] - section header +#. defaultMessage is: +#. Customer History +msgctxt "section header" +msgid "Customer History" +msgstr "" + +#: build/locale/src/customers/components/CustomerList/CustomerList.json +#. [customerListCustomerNameColumnHeader] - customer list: column header +#. defaultMessage is: +#. Customer Name +msgctxt "customer list: column header" +msgid "Customer Name" +msgstr "" + +#: build/locale/src/customers/views/CustomerDetails.json +#. [customerDetailsRemoveCustomerSuccess] +#. defaultMessage is: +#. Customer Removed +msgctxt "description" +msgid "Customer Removed" +msgstr "" + +#: build/locale/src/customers/views/CustomerCreate.json +#. [customerCreateSuccess] +#. defaultMessage is: +#. Customer created +msgctxt "description" +msgid "Customer created" +msgstr "" + +#: build/locale/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.json +#. [customerCreateDetailsHeader] - header +#. defaultMessage is: +#. Customer overview +msgctxt "header" +msgid "Customer overview" +msgstr "" + +#: build/locale/src/customers/components/CustomerDetails/CustomerDetails.json +#. [customerDetailsSubheader] - section subheader +#. defaultMessage is: +#. Customer since: {date} +msgctxt "section subheader" +msgid "Customer since: {date}" +msgstr "" + +#: build/locale/src/intl.json +#. [src.customers] - customers section name +#. defaultMessage is: +#. Customers +msgctxt "customers section name" +msgid "Customers" +msgstr "" + +#: build/locale/src/customers/views/CustomerList.json +#. [customerListRemovedCustomers] +#. defaultMessage is: +#. Customers removed +msgctxt "description" +msgid "Customers removed" +msgstr "" + +#: build/locale/src/intl.json +#. [src.dashboard] +#. defaultMessage is: +#. Dashboard +msgctxt "description" +msgid "Dashboard" +msgstr "" + #: build/locale/src/attributes/components/AttributeProperties/AttributeProperties.json #. [src.attributes.components.AttributeProperties.26409543] - attribute properties regarding dashboard #. defaultMessage is: @@ -467,6 +651,30 @@ msgctxt "attribute properties regarding dashboard" msgid "Dashboard Properties" msgstr "" +#: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json +#. [customerOrdersDateColumnHeader] - customer's order list: order date column header +#. defaultMessage is: +#. Date +msgctxt "customer's order list: order date column header" +msgid "Date" +msgstr "" + +#: build/locale/src/customers/components/CustomerAddress/CustomerAddress.json +#. [customerAddressSubheaderDefaultAddress] +#. defaultMessage is: +#. Default Address +msgctxt "description" +msgid "Default Address" +msgstr "" + +#: build/locale/src/customers/components/CustomerAddress/CustomerAddress.json +#. [customerAddressSubheaderDefaultBillingAddress] +#. defaultMessage is: +#. Default Billing Address +msgctxt "description" +msgid "Default Billing Address" +msgstr "" + #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #. [src.attributes.components.AttributeDetails.691600601] - attribute's label #. defaultMessage is: @@ -483,6 +691,14 @@ msgctxt "attribute's label'" msgid "Default Label" msgstr "" +#: build/locale/src/customers/components/CustomerAddress/CustomerAddress.json +#. [customerAddressSubheaderDefaultShippingAddress] +#. defaultMessage is: +#. Default Shipping Address +msgctxt "description" +msgid "Default Shipping Address" +msgstr "" + #: build/locale/src/attributes/components/AttributeValues/AttributeValues.json #. [src.attributes.components.AttributeValues.1397696159] - attribute values list: name column header #. defaultMessage is: @@ -603,6 +819,30 @@ msgctxt "product attribute type" msgid "Dropdown" msgstr "" +#: build/locale/src/intl.json +#. [src.email] +#. defaultMessage is: +#. E-mail Address +msgctxt "description" +msgid "E-mail Address" +msgstr "" + +#: build/locale/src/intl.json +#. [src.edit] - button +#. defaultMessage is: +#. Edit +msgctxt "button" +msgid "Edit" +msgstr "" + +#: build/locale/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.json +#. [customerAddressDialogEditAddress] - dialog title +#. defaultMessage is: +#. Edit Address +msgctxt "dialog title" +msgid "Edit Address" +msgstr "" + #: build/locale/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.json #. [src.attributes.components.AttributeValueEditDialog.1395607402] - edit attribute value #. defaultMessage is: @@ -611,6 +851,14 @@ msgctxt "edit attribute value" msgid "Edit Value" msgstr "" +#: build/locale/src/customers/components/CustomerCreateNote/CustomerCreateNote.json +#. [customerCreateNoteContent] +#. defaultMessage is: +#. Enter any extra infotmation regarding this customer. +msgctxt "description" +msgid "Enter any extra infotmation regarding this customer." +msgstr "" + #: build/locale/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.json #. [src.collections.components.CollectionDetailsPage.2906897537] - switch button #. defaultMessage is: @@ -619,6 +867,14 @@ msgctxt "switch button" msgid "Feature on Homepage" msgstr "" +#: build/locale/src/intl.json +#. [src.firstName] +#. defaultMessage is: +#. First Name +msgctxt "description" +msgid "First Name" +msgstr "" + #: build/locale/src/intl.json #. [src.generalInformations] #. defaultMessage is: @@ -635,6 +891,38 @@ msgctxt "description" msgid "If enabled, you’ll be able to use this attribute to filter products in product list." msgstr "" +#: build/locale/src/intl.json +#. [src.lastName] +#. defaultMessage is: +#. Last Name +msgctxt "description" +msgid "Last Name" +msgstr "" + +#: build/locale/src/customers/components/CustomerStats/CustomerStats.json +#. [customerStatsLastLogin] +#. defaultMessage is: +#. Last login +msgctxt "description" +msgid "Last login" +msgstr "" + +#: build/locale/src/customers/components/CustomerStats/CustomerStats.json +#. [customerStatsLastOrder] +#. defaultMessage is: +#. Last order +msgctxt "description" +msgid "Last order" +msgstr "" + +#: build/locale/src/intl.json +#. [src.manage] - button +#. defaultMessage is: +#. Manage +msgctxt "button" +msgid "Manage" +msgstr "" + #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #. [src.attributes.components.AttributeDetails.3334509011] - product attribute type #. defaultMessage is: @@ -671,6 +959,14 @@ msgctxt "collection name" msgid "Name" msgstr "" +#: build/locale/src/intl.json +#. [src.navigation] - navigation section name +#. defaultMessage is: +#. Navigation +msgctxt "navigation section name" +msgid "Navigation" +msgstr "" + #: build/locale/src/attributes/components/AttributeList/AttributeList.json #. [src.attributes.components.AttributeList.1192828581] #. defaultMessage is: @@ -695,6 +991,22 @@ msgctxt "description" msgid "No collections found" msgstr "" +#: build/locale/src/customers/components/CustomerList/CustomerList.json +#. [customerListNoCustomers] +#. defaultMessage is: +#. No customers found +msgctxt "description" +msgid "No customers found" +msgstr "" + +#: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json +#. [customerOrdersNoOrders] +#. defaultMessage is: +#. No orders found +msgctxt "description" +msgid "No orders found" +msgstr "" + #: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json #. [src.categories.components.CategoryProducts.1657559629] #. defaultMessage is: @@ -723,6 +1035,22 @@ msgctxt "No attribute values found" msgid "No values found" msgstr "" +#: build/locale/src/customers/components/CustomerList/CustomerList.json +#. [customerListOrdersColumnHeader] - customer list: column header +#. defaultMessage is: +#. No. Orders +msgctxt "customer list: column header" +msgid "No. Orders" +msgstr "" + +#: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json +#. [customerOrdersNoOfOrderColumnHeader] - customer's order list: number of order column header +#. defaultMessage is: +#. No. of Order +msgctxt "customer's order list: number of order column header" +msgid "No. of Order" +msgstr "" + #: build/locale/src/categories/components/CategoryList/CategoryList.json #. [src.categories.components.CategoryList.2527742754] - number of products #. defaultMessage is: @@ -755,6 +1083,30 @@ msgctxt "product is not published" msgid "Not published" msgstr "" +#: build/locale/src/customers/components/CustomerCreateNote/CustomerCreateNote.json +#. [customerCreateNoteInputLabel] - note about customer input label +#. defaultMessage is: +#. Note +msgctxt "note about customer input label" +msgid "Note" +msgstr "" + +#: build/locale/src/customers/components/CustomerDetails/CustomerDetails.json +#. [customerDetailsNoteInputLabel] - note about customer +#. defaultMessage is: +#. Note +msgctxt "note about customer" +msgid "Note" +msgstr "" + +#: build/locale/src/customers/components/CustomerCreateNote/CustomerCreateNote.json +#. [customerCreateNoteHeader] - notes about customer header +#. defaultMessage is: +#. Notes +msgctxt "notes about customer header" +msgid "Notes" +msgstr "" + #: build/locale/src/intl.json #. [src.optionalField] - field is optional #. defaultMessage is: @@ -763,6 +1115,14 @@ msgctxt "field is optional" msgid "Optional" msgstr "" +#: build/locale/src/intl.json +#. [src.pages] - pages section name +#. defaultMessage is: +#. Pages +msgctxt "pages section name" +msgid "Pages" +msgstr "" + #: build/locale/src/attributes/components/AttributeProperties/AttributeProperties.json #. [src.attributes.components.AttributeProperties.3590282519] - attribute position in storefront filters #. defaultMessage is: @@ -771,6 +1131,22 @@ msgctxt "attribute position in storefront filters" msgid "Position in faceted navigation" msgstr "" +#: build/locale/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.json +#. [customerCreateAddressHeader] - page header +#. defaultMessage is: +#. Primary address +msgctxt "page header" +msgid "Primary address" +msgstr "" + +#: build/locale/src/intl.json +#. [src.productTypes] - product types section name +#. defaultMessage is: +#. Product Types +msgctxt "product types section name" +msgid "Product Types" +msgstr "" + #: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json #. [src.categories.components.CategoryProducts.2968663655] - section header #. defaultMessage is: @@ -843,6 +1219,14 @@ msgctxt "product is published" msgid "Published" msgstr "" +#: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json +#. [customerOrdersHeader] - section header +#. defaultMessage is: +#. Recent orders +msgctxt "section header" +msgid "Recent orders" +msgstr "" + #: build/locale/src/categories/views/CategoryDetails.json #. [src.categories.views.3488150607] #. defaultMessage is: @@ -855,6 +1239,46 @@ msgctxt "description" msgid "Remember this will also delete all products assigned to this category." msgstr "" +#: build/locale/src/intl.json +#. [src.remove] - button +#. defaultMessage is: +#. Remove +msgctxt "button" +msgid "Remove" +msgstr "" + +#: build/locale/src/customers/views/CustomerAddresses.json +#. [customerAddressesRemoveAddressDialogHeader] - dialog header +#. defaultMessage is: +#. Remove Address +msgctxt "dialog header" +msgid "Remove Address" +msgstr "" + +#: build/locale/src/customers/views/CustomerDetails.json +#. [customerDetailsRemoveCustomerDialogHeader] - dialog header +#. defaultMessage is: +#. Remove customer +msgctxt "dialog header" +msgid "Remove customer" +msgstr "" + +#: build/locale/src/customers/views/CustomerList.json +#. [customerListRemoveCustomersDialogHeader] - dialog header +#. defaultMessage is: +#. Remove customers +msgctxt "dialog header" +msgid "Remove customers" +msgstr "" + +#: build/locale/src/intl.json +#. [src.save] - button +#. defaultMessage is: +#. Save +msgctxt "button" +msgid "Save" +msgstr "" + #: build/locale/src/intl.json #. [src.savedChanges] #. defaultMessage is: @@ -871,6 +1295,62 @@ msgctxt "attribute can be searched in dashboard" msgid "Searchable" msgstr "" +#: build/locale/src/customers/components/CustomerAddress/CustomerAddress.json +#. [customerAddressSetAsDefaultBilling] - button +#. defaultMessage is: +#. Set as default billing address +msgctxt "button" +msgid "Set as default billing address" +msgstr "" + +#: build/locale/src/customers/components/CustomerAddress/CustomerAddress.json +#. [customerAddressSetAsDefaultShipping] - button +#. defaultMessage is: +#. Set as default shipping address +msgctxt "button" +msgid "Set as default shipping address" +msgstr "" + +#: build/locale/src/intl.json +#. [src.shipping] - shipping section name +#. defaultMessage is: +#. Shipping Methods +msgctxt "shipping section name" +msgid "Shipping Methods" +msgstr "" + +#: build/locale/src/customers/components/CustomerAddresses/CustomerAddresses.json +#. [customerAddressesShippingAddressSectionHeader] - subsection header +#. defaultMessage is: +#. Shipping address +msgctxt "subsection header" +msgid "Shipping address" +msgstr "" + +#: build/locale/src/intl.json +#. [src.siteSettings] - site settings section name +#. defaultMessage is: +#. Site Settings +msgctxt "site settings section name" +msgid "Site Settings" +msgstr "" + +#: build/locale/src/intl.json +#. [src.staff] - staff section name +#. defaultMessage is: +#. Staff Members +msgctxt "staff section name" +msgid "Staff Members" +msgstr "" + +#: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json +#. [customerOrdersStatusColumnHeader] - customer's order list: status column header +#. defaultMessage is: +#. Status +msgctxt "customer's order list: status column header" +msgid "Status" +msgstr "" + #: build/locale/src/attributes/components/AttributeProperties/AttributeProperties.json #. [src.attributes.components.AttributeProperties.1877630205] - attribute properties regarding storefront #. defaultMessage is: @@ -903,6 +1383,46 @@ msgctxt "description" msgid "Successfully created attribute" msgstr "" +#: build/locale/src/intl.json +#. [src.taxes] - taxes section name +#. defaultMessage is: +#. Taxes +msgctxt "taxes section name" +msgid "Taxes" +msgstr "" + +#: build/locale/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.json +#. [customerCreateAddressContent] +#. defaultMessage is: +#. The primary address of this customer. +msgctxt "description" +msgid "The primary address of this customer." +msgstr "" + +#: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json +#. [customerAddressListPageNoAddresses] +#. defaultMessage is: +#. There is no address to show for this customer +msgctxt "description" +msgid "There is no address to show for this customer" +msgstr "" + +#: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json +#. [customerAddressListPageNoAddressesAdditionalText] +#. defaultMessage is: +#. This customer doesn’t have any adresses added to his address book. You can add address using the button below. +msgctxt "description" +msgid "This customer doesn’t have any adresses added to his address book. You can add address using the button below." +msgstr "" + +#: build/locale/src/customers/components/CustomerAddresses/CustomerAddresses.json +#. [customerAddressesNoAddresses] +#. defaultMessage is: +#. This customer has no addresses yet +msgctxt "description" +msgid "This customer has no addresses yet" +msgstr "" + #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #. [src.attributes.components.AttributeDetails.4107478955] - attribute slug input field helper text #. defaultMessage is: @@ -911,6 +1431,14 @@ msgctxt "attribute slug input field helper text" msgid "This is used internally. Make sure you don’t use spaces" msgstr "" +#: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json +#. [customerOrdersTotalColumnHeader] - customer's order list: total amount column header +#. defaultMessage is: +#. Total +msgctxt "customer's order list: total amount column header" +msgid "Total" +msgstr "" + #: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json #. [src.categories.components.CategoryProducts.1952810469] - product type #. defaultMessage is: @@ -987,6 +1515,14 @@ msgctxt "attribute can be searched in storefront" msgid "Use in faceted search" msgstr "" +#: build/locale/src/customers/components/CustomerDetails/CustomerDetails.json +#. [customerDetailsAccountActive] - check to mark this account as active +#. defaultMessage is: +#. User account active +msgctxt "check to mark this account as active" +msgid "User account active" +msgstr "" + #: build/locale/src/attributes/components/AttributeDetails/AttributeDetails.json #. [src.attributes.components.AttributeDetails.2592224946] - check to require attribute to have value #. defaultMessage is: @@ -1003,6 +1539,14 @@ msgctxt "attribute value deleted" msgid "Value deleted" msgstr "" +#: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json +#. [customerOrdersViewAllOrders] - button +#. defaultMessage is: +#. View all orders +msgctxt "button" +msgid "View all orders" +msgstr "" + #: build/locale/src/attributes/components/AttributeList/AttributeList.json #. [src.attributes.components.AttributeList.643174786] - attribute is visible #. defaultMessage is: @@ -1019,10 +1563,18 @@ msgctxt "attribute" msgid "Visible on Product Page in Storefront" msgstr "" -#: build/locale/src/intl.json -#. [src.save] +#: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json +#. [customerAddressListPageAppHeader] - header #. defaultMessage is: -#. save -msgctxt "description" -msgid "save" +#. {fullName} Details +msgctxt "header" +msgid "{fullName} Details" +msgstr "" + +#: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json +#. [customerAddressListPageHeader] - header +#. defaultMessage is: +#. {fullName}'s Address Book +msgctxt "header" +msgid "{fullName}'s Address Book" msgstr "" diff --git a/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.tsx b/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.tsx index 861b99c54..c54150edd 100644 --- a/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.tsx +++ b/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.tsx @@ -12,7 +12,7 @@ import ConfirmButton, { } from "@saleor/components/ConfirmButton"; import Form from "@saleor/components/Form"; import useModalDialogErrors from "@saleor/hooks/useModalDialogErrors"; -import { commonMessages } from "@saleor/intl"; +import { buttonMessages } from "@saleor/intl"; import { maybe } from "@saleor/misc"; import { UserError } from "@saleor/types"; import { AttributeDetails_attribute_values } from "../../types/AttributeDetails"; @@ -83,7 +83,7 @@ const AttributeValueEditDialog: React.StatelessComponent< - + diff --git a/src/categories/components/CategoryBackground/CategoryBackground.tsx b/src/categories/components/CategoryBackground/CategoryBackground.tsx index dbda369be..2c5d9925e 100644 --- a/src/categories/components/CategoryBackground/CategoryBackground.tsx +++ b/src/categories/components/CategoryBackground/CategoryBackground.tsx @@ -105,7 +105,10 @@ const CategoryBackground: React.FC = props => { createStyles({ @@ -56,14 +56,14 @@ const CategoryDeleteDialog = withStyles(styles, { diff --git a/src/collections/components/CollectionImage/CollectionImage.tsx b/src/collections/components/CollectionImage/CollectionImage.tsx index 04a4d1446..1ebd5eb85 100644 --- a/src/collections/components/CollectionImage/CollectionImage.tsx +++ b/src/collections/components/CollectionImage/CollectionImage.tsx @@ -124,7 +124,10 @@ export const CollectionImage = withStyles(styles)( ) => ( - - - {i18n.t("Address {{ addressNumber }}", { - addressNumber - })} - - {isDefaultBillingAddress && isDefaultShippingAddress - ? i18n.t("Default Address") - : isDefaultShippingAddress - ? i18n.t("Default Shipping Address") - : isDefaultBillingAddress - ? i18n.t("Default Billing Address") - : null} - - - ) : ( - - ) - } - height="const" - toolbar={ - onSetAsDefault(AddressTypeEnum.SHIPPING) - }, - { - label: i18n.t("Set as default billing address", { - context: "button" - }), - onSelect: () => onSetAsDefault(AddressTypeEnum.BILLING) - } - ]} - /> - } - /> - - - -
- - - - -
-
- ) + }: CustomerAddressProps & WithStyles) => { + const intl = useIntl(); + + return ( + + + + + {isDefaultBillingAddress && isDefaultShippingAddress + ? intl.formatMessage({ + defaultMessage: "Default Address" + }) + : isDefaultShippingAddress + ? intl.formatMessage({ + defaultMessage: "Default Shipping Address" + }) + : isDefaultBillingAddress + ? intl.formatMessage({ + defaultMessage: "Default Billing Address" + }) + : null} + + + ) : ( + + ) + } + height="const" + toolbar={ + onSetAsDefault(AddressTypeEnum.SHIPPING) + }, + { + label: intl.formatMessage({ + defaultMessage: "Set as default billing address", + description: "button" + }), + onSelect: () => onSetAsDefault(AddressTypeEnum.BILLING) + } + ]} + /> + } + /> + + + +
+ + + + +
+
+ ); + } ); CustomerAddress.displayName = "CustomerAddress"; export default CustomerAddress; diff --git a/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.tsx b/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.tsx index 1925f7d8c..530da1de3 100644 --- a/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.tsx +++ b/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.tsx @@ -6,6 +6,7 @@ import DialogTitle from "@material-ui/core/DialogTitle"; import { createStyles, withStyles, WithStyles } from "@material-ui/core/styles"; import AddIcon from "@material-ui/icons/Add"; import React from "react"; +import { FormattedMessage } from "react-intl"; import AddressEdit from "@saleor/components/AddressEdit"; import ConfirmButton, { @@ -13,7 +14,7 @@ import ConfirmButton, { } from "@saleor/components/ConfirmButton"; import Form from "@saleor/components/Form"; import useStateFromProps from "@saleor/hooks/useStateFromProps"; -import i18n from "@saleor/i18n"; +import { buttonMessages } from "@saleor/intl"; import { maybe } from "@saleor/misc"; import { UserError } from "@saleor/types"; import createSingleAutocompleteSelectHandler from "@saleor/utils/handlers/singleAutocompleteSelectChangeHandler"; @@ -97,9 +98,17 @@ const CustomerAddressDialog = withStyles(styles, {})( return ( <> - {variant === "create" - ? i18n.t("Add Address") - : i18n.t("Edit Address")} + {variant === "create" ? ( + + ) : ( + + )} - {i18n.t("Save Address", { context: "button" })} - + + {variant === "create" && } diff --git a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx index 16817416a..36d67eeea 100644 --- a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx +++ b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx @@ -8,11 +8,11 @@ import { import Typography from "@material-ui/core/Typography"; import AddIcon from "@material-ui/icons/Add"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import AppHeader from "@saleor/components/AppHeader"; import Container from "@saleor/components/Container"; import PageHeader from "@saleor/components/PageHeader"; -import i18n from "../../../i18n"; import { maybe, renderCollection } from "../../../misc"; import { AddressTypeEnum } from "../../../types/globalTypes"; import { CustomerAddresses_user } from "../../types/CustomerAddresses"; @@ -62,28 +62,42 @@ const CustomerAddressListPage = withStyles(styles, { onRemove, onSetAsDefault }: CustomerAddressListPageProps & WithStyles) => { + const intl = useIntl(); + const isEmpty = maybe(() => customer.addresses.length) === 0; + const fullName = maybe( + () => [customer.firstName, customer.lastName].join(" "), + "..." + ); + return ( - {i18n.t("Customer Info", { - context: "navigation" - })} + {!isEmpty && ( - i18n.t("{{ firstName }} {{ lastName }} Address Book", { - context: "customer address book", - firstName: customer.firstName, - lastName: customer.lastName - }) + title={intl.formatMessage( + { + defaultMessage: "{fullName}'s Address Book", + description: "customer's address book, header" + }, + { + fullName + } )} > @@ -91,12 +105,10 @@ const CustomerAddressListPage = withStyles(styles, { {isEmpty ? (
- {i18n.t("There is no address to show for this customer")} + - {i18n.t( - "This customer doesn’t have any adresses added to his address book. You can add address using the button below." - )} +
diff --git a/src/customers/components/CustomerAddresses/CustomerAddresses.tsx b/src/customers/components/CustomerAddresses/CustomerAddresses.tsx index 54e1a28bf..500354122 100644 --- a/src/customers/components/CustomerAddresses/CustomerAddresses.tsx +++ b/src/customers/components/CustomerAddresses/CustomerAddresses.tsx @@ -9,11 +9,12 @@ import { } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import AddressFormatter from "@saleor/components/AddressFormatter"; import CardTitle from "@saleor/components/CardTitle"; import { Hr } from "@saleor/components/Hr"; -import i18n from "../../../i18n"; +import { buttonMessages } from "@saleor/intl"; import { maybe } from "../../../misc"; import { CustomerDetails_user } from "../../types/CustomerDetails"; @@ -37,66 +38,85 @@ const CustomerAddresses = withStyles(styles, { name: "CustomerAddresses" })( customer, disabled, onAddressManageClick - }: CustomerAddressesProps) => ( - - - {i18n.t("Manage", { context: "button" })} - - } - /> - {maybe(() => customer.defaultBillingAddress.id) !== - maybe(() => customer.defaultShippingAddress.id) ? ( - <> - {maybe(() => customer.defaultBillingAddress) !== null && ( - - - {i18n.t("Billing address")} - - customer.defaultBillingAddress)} + }: CustomerAddressesProps) => { + const intl = useIntl(); + + return ( + + + + + } + /> + {maybe(() => customer.defaultBillingAddress.id) !== + maybe(() => customer.defaultShippingAddress.id) ? ( + <> + {maybe(() => customer.defaultBillingAddress) !== null && ( + + + + + customer.defaultBillingAddress)} + /> + + )} + {maybe( + () => + customer.defaultBillingAddress && + customer.defaultShippingAddress + ) &&
} + {maybe(() => customer.defaultShippingAddress) && ( + + + + + customer.defaultShippingAddress)} + /> + + )} + + ) : maybe(() => customer.defaultBillingAddress) === null && + maybe(() => customer.defaultShippingAddress) === null ? ( + + + + + + ) : ( + + + - - )} - {maybe( - () => - customer.defaultBillingAddress && customer.defaultShippingAddress - ) &&
} - {maybe(() => customer.defaultShippingAddress) && ( - - - {i18n.t("Shipping address")} - - customer.defaultShippingAddress)} - /> - - )} - - ) : maybe(() => customer.defaultBillingAddress) === null && - maybe(() => customer.defaultShippingAddress) === null ? ( - - - {i18n.t("This customer has no addresses yet")} - - - ) : ( - - {i18n.t("Address")} - customer.defaultBillingAddress)} - /> - - )} -
- ) + + customer.defaultBillingAddress)} + /> +
+ )} +
+ ); + } ); CustomerAddresses.displayName = "CustomerAddresses"; export default CustomerAddresses; diff --git a/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx b/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx index 9ba4fa0c2..40012bae8 100644 --- a/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx +++ b/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx @@ -3,12 +3,12 @@ import CardContent from "@material-ui/core/CardContent"; import { createStyles, WithStyles, withStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import AddressEdit from "@saleor/components/AddressEdit"; import CardTitle from "@saleor/components/CardTitle"; import { FormSpacer } from "@saleor/components/FormSpacer"; import { SingleAutocompleteChoiceType } from "@saleor/components/SingleAutocompleteSelectField"; -import i18n from "../../../i18n"; import { FormErrors } from "../../../types"; import { AddressTypeInput } from "../../types"; @@ -40,26 +40,35 @@ const CustomerCreateAddress = withStyles(styles, { errors, onChange, onCountryChange - }: CustomerCreateAddressProps) => ( - - - - - {i18n.t("The primary address of this customer.")} - - - { + const intl = useIntl(); + + return ( + + - - - ) + + + + + + + + + ); + } ); CustomerCreateAddress.displayName = "CustomerCreateAddress"; export default CustomerCreateAddress; diff --git a/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx b/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx index db1ffec62..b64276b28 100644 --- a/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx +++ b/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.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 { FormErrors } from "../../../types"; import { CustomerCreatePageFormData } from "../CustomerCreatePage"; @@ -40,48 +41,57 @@ const CustomerCreateDetails = withStyles(styles, { disabled, errors, onChange - }: CustomerCreateDetailsProps) => ( - - - -
- - - -
-
-
- ) + }: CustomerCreateDetailsProps) => { + const intl = useIntl(); + + return ( + + + +
+ + + +
+
+
+ ); + } ); CustomerCreateDetails.displayName = "CustomerCreateDetails"; export default CustomerCreateDetails; diff --git a/src/customers/components/CustomerCreateNote/CustomerCreateNote.tsx b/src/customers/components/CustomerCreateNote/CustomerCreateNote.tsx index e40d3bd48..3a4e9967c 100644 --- a/src/customers/components/CustomerCreateNote/CustomerCreateNote.tsx +++ b/src/customers/components/CustomerCreateNote/CustomerCreateNote.tsx @@ -3,10 +3,10 @@ import CardContent from "@material-ui/core/CardContent"; 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 { FormSpacer } from "@saleor/components/FormSpacer"; -import i18n from "../../../i18n"; export interface CustomerCreateNoteProps { data: { @@ -24,27 +24,39 @@ const CustomerCreateNote: React.StatelessComponent = ({ disabled, errors, onChange -}) => ( - - - - - {i18n.t("Enter any extra infotmation regarding this customer.")} - - - { + const intl = useIntl(); + + return ( + + - - -); + + + + + + + + + ); +}; CustomerCreateNote.displayName = "CustomerCreateNote"; export default CustomerCreateNote; diff --git a/src/customers/components/CustomerCreatePage/CustomerCreatePage.tsx b/src/customers/components/CustomerCreatePage/CustomerCreatePage.tsx index a38cc3cbb..c40bb6929 100644 --- a/src/customers/components/CustomerCreatePage/CustomerCreatePage.tsx +++ b/src/customers/components/CustomerCreatePage/CustomerCreatePage.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import AppHeader from "@saleor/components/AppHeader"; import { CardSpacer } from "@saleor/components/CardSpacer"; @@ -8,8 +9,8 @@ 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 { sectionNames } from "@saleor/intl"; import createSingleAutocompleteSelectHandler from "@saleor/utils/handlers/singleAutocompleteSelectChangeHandler"; -import i18n from "../../../i18n"; import { UserError } from "../../../types"; import { AddressTypeInput } from "../../types"; import { CustomerCreateData_shop_countries } from "../../types/CustomerCreateData"; @@ -59,6 +60,8 @@ const CustomerCreatePage: React.StatelessComponent = ({ onBack, onSubmit }: CustomerCreatePageProps) => { + const intl = useIntl(); + const [countryDisplayName, setCountryDisplayName] = React.useState(""); const countryChoices = countries.map(country => ({ label: country.country, @@ -81,8 +84,15 @@ const CustomerCreatePage: React.StatelessComponent = ({ return ( - {i18n.t("Customers")} - + + + +
@@ -58,88 +59,99 @@ const CustomerDetails = withStyles(styles, { name: "CustomerDetails" })( disabled, errors, onChange - }: CustomerDetailsProps) => ( - - - {i18n.t("General Information")} - {customer && customer.dateJoined ? ( - - {i18n.t("Customer since: {{ month }} {{ year }}", { - month: moment(customer.dateJoined).format("MMM"), - year: moment(customer.dateJoined).format("YYYY") - })} - - ) : ( - - )} - - } - /> - - { + const intl = useIntl(); + + return ( + + + + {customer && customer.dateJoined ? ( + + + + ) : ( + + )} + + } /> - -
- + + +
+ + +
+ -
- - - - -
-
- ) + + + + + ); + } ); CustomerDetails.displayName = "CustomerDetails"; export default CustomerDetails; diff --git a/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx b/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx index ca41daeeb..b36c7ff54 100644 --- a/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx +++ b/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.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 { getUserName, maybe } from "../../../misc"; import { UserError } from "../../../types"; import { CustomerDetails_user } from "../../types/CustomerDetails"; @@ -51,59 +52,67 @@ const CustomerDetailsPage: React.StatelessComponent< onRowClick, onAddressManageClick, onDelete -}: CustomerDetailsPageProps) => ( -
customer.email, ""), - firstName: maybe(() => customer.firstName, ""), - isActive: maybe(() => customer.isActive, false), - lastName: maybe(() => customer.lastName, ""), - note: maybe(() => customer.note, "") - }} - onSubmit={onSubmit} - confirmLeave - > - {({ change, data, errors: formErrors, hasChanged, submit }) => ( - - {i18n.t("Customers")} - - -
- - - customer.orders.edges.map(edge => edge.node))} - onViewAllOrdersClick={onViewAllOrdersClick} - onRowClick={onRowClick} - /> -
-
- - - -
-
- -
- )} -
-); +}: CustomerDetailsPageProps) => { + const intl = useIntl(); + + return ( +
customer.email, ""), + firstName: maybe(() => customer.firstName, ""), + isActive: maybe(() => customer.isActive, false), + lastName: maybe(() => customer.lastName, ""), + note: maybe(() => customer.note, "") + }} + onSubmit={onSubmit} + confirmLeave + > + {({ change, data, errors: formErrors, hasChanged, submit }) => ( + + + {intl.formatMessage(sectionNames.customers)} + + + +
+ + + + customer.orders.edges.map(edge => edge.node) + )} + onViewAllOrdersClick={onViewAllOrdersClick} + onRowClick={onRowClick} + /> +
+
+ + + +
+
+ +
+ )} +
+ ); +}; CustomerDetailsPage.displayName = "CustomerDetailsPage"; export default CustomerDetailsPage; diff --git a/src/customers/components/CustomerList/CustomerList.tsx b/src/customers/components/CustomerList/CustomerList.tsx index 5381f23f6..084825438 100644 --- a/src/customers/components/CustomerList/CustomerList.tsx +++ b/src/customers/components/CustomerList/CustomerList.tsx @@ -11,12 +11,12 @@ 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 Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; -import i18n from "@saleor/i18n"; import { getUserName, maybe, renderCollection } from "@saleor/misc"; import { ListActions, ListProps } from "@saleor/types"; import { ListCustomers_customers_edges_node } from "../../types/ListCustomers"; @@ -77,13 +77,13 @@ const CustomerList = withStyles(styles, { name: "CustomerList" })( toolbar={toolbar} > - {i18n.t("Customer Name", { context: "table header" })} + - {i18n.t("Customer e-mail", { context: "table header" })} + - {i18n.t("Orders", { context: "table header" })} + @@ -141,7 +141,7 @@ const CustomerList = withStyles(styles, { name: "CustomerList" })( () => ( - {i18n.t("No customers found")} + ) diff --git a/src/customers/components/CustomerListPage/CustomerListPage.tsx b/src/customers/components/CustomerListPage/CustomerListPage.tsx index e39dad20c..02085d39a 100644 --- a/src/customers/components/CustomerListPage/CustomerListPage.tsx +++ b/src/customers/components/CustomerListPage/CustomerListPage.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 { ListCustomers_customers_edges_node } from "../../types/ListCustomers"; import CustomerList from "../CustomerList/CustomerList"; @@ -18,27 +19,32 @@ const CustomerListPage: React.StatelessComponent = ({ disabled, onAdd, ...customerListProps -}) => ( - - - + + - {i18n.t("Add customer", { - context: "button" - })}{" "} - - - - - -); + {...customerListProps} + /> + + ); +}; CustomerListPage.displayName = "CustomerListPage"; export default CustomerListPage; diff --git a/src/customers/components/CustomerOrders/CustomerOrders.tsx b/src/customers/components/CustomerOrders/CustomerOrders.tsx index f6883ca34..931b23e1e 100644 --- a/src/customers/components/CustomerOrders/CustomerOrders.tsx +++ b/src/customers/components/CustomerOrders/CustomerOrders.tsx @@ -7,13 +7,13 @@ import TableCell from "@material-ui/core/TableCell"; import TableHead from "@material-ui/core/TableHead"; import TableRow from "@material-ui/core/TableRow"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import { DateTime } from "@saleor/components/Date"; import Money from "@saleor/components/Money"; import Skeleton from "@saleor/components/Skeleton"; import StatusLabel from "@saleor/components/StatusLabel"; -import i18n from "../../../i18n"; import { maybe, renderCollection, transformPaymentStatus } from "../../../misc"; import { CustomerDetails_user_orders_edges_node } from "../../types/CustomerDetails"; @@ -39,6 +39,8 @@ const CustomerOrders = withStyles(styles, { name: "CustomerOrders" })( onRowClick, onViewAllOrdersClick }: CustomerOrdersProps) => { + const intl = useIntl(); + const orderList = orders ? orders.map(order => ({ ...order, @@ -48,14 +50,20 @@ const CustomerOrders = withStyles(styles, { name: "CustomerOrders" })( return ( - {i18n.t("View all orders")} + } /> @@ -63,16 +71,28 @@ const CustomerOrders = withStyles(styles, { name: "CustomerOrders" })( - {i18n.t("No. of Order", { context: "table header" })} + - {i18n.t("Date", { context: "table header" })} + - {i18n.t("Status", { context: "table header" })} + - {i18n.t("Total", { context: "table header" })} + @@ -123,7 +143,9 @@ const CustomerOrders = withStyles(styles, { name: "CustomerOrders" })( ), () => ( - {i18n.t("No orders found")} + + + ) )} diff --git a/src/customers/components/CustomerStats/CustomerStats.tsx b/src/customers/components/CustomerStats/CustomerStats.tsx index 1a2a0b4a6..3cdfdd5b3 100644 --- a/src/customers/components/CustomerStats/CustomerStats.tsx +++ b/src/customers/components/CustomerStats/CustomerStats.tsx @@ -8,12 +8,12 @@ import { } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import { DateTime } from "@saleor/components/Date"; import { Hr } from "@saleor/components/Hr"; import Skeleton from "@saleor/components/Skeleton"; -import i18n from "../../../i18n"; import { maybe } from "../../../misc"; import { CustomerDetails_user } from "../../types/CustomerDetails"; @@ -32,48 +32,60 @@ export interface CustomerStatsProps extends WithStyles { } const CustomerStats = withStyles(styles, { name: "CustomerStats" })( - ({ classes, customer }: CustomerStatsProps) => ( - - - - - {i18n.t("Last login")} - - {maybe( - () => ( - - {customer.lastLogin === null ? ( - i18n.t("-") - ) : ( - - )} - - ), - - )} - -
- - - {i18n.t("Last order")} - - {maybe( - () => ( - - {customer.lastPlacedOrder.edges.length === 0 ? ( - i18n.t("-") - ) : ( - - )} - - ), - - )} - -
- ) + ({ classes, customer }: CustomerStatsProps) => { + const intl = useIntl(); + + return ( + + + + + + + {maybe( + () => ( + + {customer.lastLogin === null ? ( + "-" + ) : ( + + )} + + ), + + )} + +
+ + + + + {maybe( + () => ( + + {customer.lastPlacedOrder.edges.length === 0 ? ( + "-" + ) : ( + + )} + + ), + + )} + +
+ ); + } ); CustomerStats.displayName = "CustomerStats"; export default CustomerStats; diff --git a/src/customers/index.tsx b/src/customers/index.tsx index 7ea77efda..7816ca508 100644 --- a/src/customers/index.tsx +++ b/src/customers/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 { customerAddPath, customerAddressesPath, @@ -60,17 +61,21 @@ const CustomerAddressesView: React.StatelessComponent< ); }; -export const CustomerSection: React.StatelessComponent<{}> = () => ( - <> - - - - - - - - -); +export const CustomerSection: React.StatelessComponent<{}> = () => { + const intl = useIntl(); + + return ( + <> + + + + + + + + + ); +}; diff --git a/src/customers/views/CustomerAddresses.tsx b/src/customers/views/CustomerAddresses.tsx index 9f72bce6a..da7c30019 100644 --- a/src/customers/views/CustomerAddresses.tsx +++ b/src/customers/views/CustomerAddresses.tsx @@ -1,12 +1,13 @@ import DialogContentText from "@material-ui/core/DialogContentText"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import ActionDialog from "@saleor/components/ActionDialog"; 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 { commonMessages } from "@saleor/intl"; import { getMutationState, maybe } from "../../misc"; import CustomerAddressDialog from "../components/CustomerAddressDialog"; import CustomerAddressListPage from "../components/CustomerAddressListPage"; @@ -40,6 +41,7 @@ const CustomerAddresses: React.FC = ({ const navigate = useNavigator(); const notify = useNotifier(); const shop = useShop(); + const intl = useIntl(); const closeModal = () => navigate(customerAddressesUrl(id), true); const openModal = (action: CustomerAddressesUrlDialog, addressId?: string) => @@ -49,9 +51,7 @@ const CustomerAddresses: React.FC = ({ if (data.addressSetDefault.errors.length === 0) { closeModal(); notify({ - text: i18n.t("Set address as default", { - context: "notification" - }) + text: intl.formatMessage(commonMessages.savedChanges) }); } }; @@ -66,9 +66,7 @@ const CustomerAddresses: React.FC = ({ if (data.addressUpdate.errors.length === 0) { closeModal(); notify({ - text: i18n.t("Updated address", { - context: "notification" - }) + text: intl.formatMessage(commonMessages.savedChanges) }); } }; @@ -77,9 +75,7 @@ const CustomerAddresses: React.FC = ({ if (data.addressDelete.errors.length === 0) { closeModal(); notify({ - text: i18n.t("Removed address", { - context: "notification" - }) + text: intl.formatMessage(commonMessages.savedChanges) }); } }; @@ -214,7 +210,10 @@ const CustomerAddresses: React.FC = ({ @@ -226,9 +225,7 @@ const CustomerAddresses: React.FC = ({ } > - {i18n.t( - "Are you sure you want to remove this address from users address book?" - )} + diff --git a/src/customers/views/CustomerCreate.tsx b/src/customers/views/CustomerCreate.tsx index 10b5719d0..e0a273f51 100644 --- a/src/customers/views/CustomerCreate.tsx +++ b/src/customers/views/CustomerCreate.tsx @@ -1,9 +1,9 @@ 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 i18n from "../../i18n"; import { maybe } from "../../misc"; import CustomerCreatePage from "../components/CustomerCreatePage"; import { TypedCreateCustomerMutation } from "../mutations"; @@ -14,12 +14,13 @@ import { customerListUrl, customerUrl } from "../urls"; export const CustomerCreate: React.StatelessComponent<{}> = () => { const navigate = useNavigator(); const notify = useNotifier(); + const intl = useIntl(); const handleCreateCustomerSuccess = (data: CreateCustomer) => { if (data.customerCreate.errors.length === 0) { notify({ - text: i18n.t("Customer created", { - context: "notification" + text: intl.formatMessage({ + defaultMessage: "Customer created" }) }); navigate(customerUrl(data.customerCreate.user.id)); @@ -31,7 +32,12 @@ export const CustomerCreate: React.StatelessComponent<{}> = () => { {(createCustomer, createCustomerOpts) => ( <> - + data.shop.countries, [])} disabled={loading || createCustomerOpts.loading} diff --git a/src/customers/views/CustomerDetails.tsx b/src/customers/views/CustomerDetails.tsx index d1e1b57b5..35bd8e17f 100644 --- a/src/customers/views/CustomerDetails.tsx +++ b/src/customers/views/CustomerDetails.tsx @@ -1,11 +1,12 @@ import DialogContentText from "@material-ui/core/DialogContentText"; import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import ActionDialog from "@saleor/components/ActionDialog"; import { WindowTitle } from "@saleor/components/WindowTitle"; import useNavigator from "@saleor/hooks/useNavigator"; import useNotifier from "@saleor/hooks/useNotifier"; -import i18n from "../../i18n"; +import { commonMessages } from "@saleor/intl"; import { getMutationState, maybe } from "../../misc"; import { orderListUrl, orderUrl } from "../../orders/urls"; import CustomerDetailsPage from "../components/CustomerDetailsPage/CustomerDetailsPage"; @@ -33,21 +34,20 @@ export const CustomerDetailsView: React.StatelessComponent< > = ({ id, params }) => { const navigate = useNavigator(); const notify = useNotifier(); + const intl = useIntl(); const handleCustomerUpdateSuccess = (data: UpdateCustomer) => { if (data.customerUpdate.errors.length === 0) { notify({ - text: i18n.t("Customer updated", { - context: "notification" - }) + text: intl.formatMessage(commonMessages.savedChanges) }); } }; const handleCustomerRemoveSuccess = (data: RemoveCustomer) => { if (data.customerDelete.errors.length === 0) { notify({ - text: i18n.t("Customer removed", { - context: "notification" + text: intl.formatMessage({ + defaultMessage: "Customer Removed" }) }); navigate(customerListUrl()); @@ -132,26 +132,29 @@ export const CustomerDetailsView: React.StatelessComponent< confirmButtonState={removeTransitionState} onClose={() => navigate(customerUrl(id), true)} onConfirm={() => removeCustomer()} - title={i18n.t("Remove customer", { - context: "modal title" + title={intl.formatMessage({ + defaultMessage: "Delete customer", + description: "dialog header" })} variant="delete" open={params.action === "remove"} > - {{ email }}?", - { - context: "modal content", - email: maybe( - () => customerDetails.data.user.email, - "..." - ) - } - ) - }} - /> + + + {maybe( + () => customerDetails.data.user.email, + "..." + )} + + ) + }} + /> + ); diff --git a/src/customers/views/CustomerList.tsx b/src/customers/views/CustomerList.tsx index b36ed9e2a..0ee6d578b 100644 --- a/src/customers/views/CustomerList.tsx +++ b/src/customers/views/CustomerList.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 useBulkActions from "@saleor/hooks/useBulkActions"; @@ -11,7 +12,7 @@ import useNotifier from "@saleor/hooks/useNotifier"; import usePaginator, { createPaginationState } from "@saleor/hooks/usePaginator"; -import i18n from "@saleor/i18n"; +import { commonMessages } from "@saleor/intl"; import { getMutationState, maybe } from "@saleor/misc"; import { ListViews } from "@saleor/types"; import CustomerListPage from "../components/CustomerListPage"; @@ -41,6 +42,7 @@ export const CustomerList: React.StatelessComponent = ({ const { updateListSettings, settings } = useListSettings( ListViews.CUSTOMER_LIST ); + const intl = useIntl(); const closeModal = () => navigate( @@ -66,7 +68,7 @@ export const CustomerList: React.StatelessComponent = ({ const handleBulkCustomerDelete = (data: BulkRemoveCustomers) => { if (data.customerBulkDelete.errors.length === 0) { notify({ - text: i18n.t("Customers removed") + text: intl.formatMessage(commonMessages.savedChanges) }); reset(); refetch(); @@ -120,7 +122,10 @@ export const CustomerList: React.StatelessComponent = ({ toggleAll={toggleAll} /> params.ids.length > 0) + } onClose={closeModal} confirmButtonState={removeTransitionState} onConfirm={() => @@ -131,21 +136,25 @@ export const CustomerList: React.StatelessComponent = ({ }) } variant="delete" - title={i18n.t("Remove customers")} + title={intl.formatMessage({ + defaultMessage: "Delete customers", + description: "dialog header" + })} > - {{ number }} customers?", - { - number: maybe( - () => params.ids.length.toString(), - "..." - ) - } - ) - }} - /> + + params.ids.length), + displayQuantity: ( + {maybe(() => params.ids.length)} + ) + }} + /> + ); diff --git a/src/intl.ts b/src/intl.ts index ef2aba5ff..ce6aabb09 100644 --- a/src/intl.ts +++ b/src/intl.ts @@ -4,28 +4,27 @@ export const commonMessages = defineMessages({ availability: { defaultMessage: "Availability" }, - cancel: { - defaultMessage: "Cancel" - }, - confirm: { - defaultMessage: "Confirm" + dashboard: { + defaultMessage: "Dashboard" }, description: { defaultMessage: "Description" }, + email: { + defaultMessage: "E-mail Address" + }, + firstName: { + defaultMessage: "First Name" + }, generalInformations: { defaultMessage: "General Informations" }, - optionalField: { - defaultMessage: "Optional", - description: "field is optional" + lastName: { + defaultMessage: "Last Name" }, properties: { defaultMessage: "Properties" }, - save: { - defaultMessage: "save" - }, savedChanges: { defaultMessage: "Saved changes" }, @@ -35,6 +34,33 @@ export const commonMessages = defineMessages({ } }); +export const buttonMessages = defineMessages({ + cancel: { + defaultMessage: "Cancel", + description: "button" + }, + confirm: { + defaultMessage: "Confirm", + description: "button" + }, + edit: { + defaultMessage: "Edit", + description: "button" + }, + manage: { + defaultMessage: "Manage", + description: "button" + }, + remove: { + defaultMessage: "Remove", + description: "button" + }, + save: { + defaultMessage: "Save", + description: "button" + } +}); + export const sectionNames = defineMessages({ attributes: { defaultMessage: "Attributes", @@ -47,5 +73,41 @@ export const sectionNames = defineMessages({ collections: { defaultMessage: "Collections", description: "collections section name" + }, + configuration: { + defaultMessage: "Configuration", + description: "configuration section name" + }, + customers: { + defaultMessage: "Customers", + description: "customers section name" + }, + navigation: { + defaultMessage: "Navigation", + description: "navigation section name" + }, + pages: { + defaultMessage: "Pages", + description: "pages section name" + }, + productTypes: { + defaultMessage: "Product Types", + description: "product types section name" + }, + shipping: { + defaultMessage: "Shipping Methods", + description: "shipping section name" + }, + siteSettings: { + defaultMessage: "Site Settings", + description: "site settings section name" + }, + staff: { + defaultMessage: "Staff Members", + description: "staff section name" + }, + taxes: { + defaultMessage: "Taxes", + description: "taxes section name" } });