Refactor navigation section translations (#117)
* Refactor navigation section translations * Add missing id * Update pot file
This commit is contained in:
parent
290f6ca396
commit
f78e5aea31
11 changed files with 506 additions and 179 deletions
|
@ -1,6 +1,6 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"POT-Creation-Date: 2019-08-26T14:18:06.591Z\n"
|
||||
"POT-Creation-Date: 2019-08-26T14:24:42.452Z\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -51,6 +51,30 @@ msgctxt "dialog title"
|
|||
msgid "Add Address"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuItemDialog/MenuItemDialog.json
|
||||
#. [menuItemDialogAddItem] - create new menu item, header
|
||||
#. defaultMessage is:
|
||||
#. Add Item
|
||||
msgctxt "create new menu item, header"
|
||||
msgid "Add Item"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuCreateDialog/MenuCreateDialog.json
|
||||
#. [menuCreateDialogHeader] - dialog header
|
||||
#. defaultMessage is:
|
||||
#. Add Menu
|
||||
msgctxt "dialog header"
|
||||
msgid "Add Menu"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuListPage/MenuListPage.json
|
||||
#. [menuListPageAddMenu] - button
|
||||
#. defaultMessage is:
|
||||
#. Add Menu
|
||||
msgctxt "button"
|
||||
msgid "Add Menu"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/discounts/components/SaleListPage/SaleListPage.json
|
||||
#. [src.discounts.components.SaleListPage.1742771332] - button
|
||||
#. defaultMessage is:
|
||||
|
@ -123,6 +147,22 @@ msgctxt "button"
|
|||
msgid "Add customer"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuItems/MenuItems.json
|
||||
#. [menuItemsAddItem] - add new menu item
|
||||
#. defaultMessage is:
|
||||
#. Add new item
|
||||
msgctxt "add new menu item"
|
||||
msgid "Add new item"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuItems/MenuItems.json
|
||||
#. [menuItemsPlaceholder]
|
||||
#. defaultMessage is:
|
||||
#. Add new menu item to begin creating menu
|
||||
msgctxt "description"
|
||||
msgid "Add new menu item to begin creating menu"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json
|
||||
#. [src.categories.components.CategoryProducts.3554578821] - button
|
||||
#. defaultMessage is:
|
||||
|
@ -271,6 +311,14 @@ msgctxt "description"
|
|||
msgid "Are you sure you want to delete collection's image?"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/views/MenuDetails/index.json
|
||||
#. [menuDetailsDeleteMenuContent]
|
||||
#. defaultMessage is:
|
||||
#. Are you sure you want to delete menu {menuName}?
|
||||
msgctxt "description"
|
||||
msgid "Are you sure you want to delete menu {menuName}?"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/customers/views/CustomerAddresses.json
|
||||
#. [src.customers.views.3689332763]
|
||||
#. defaultMessage is:
|
||||
|
@ -355,6 +403,14 @@ msgctxt "description"
|
|||
msgid "Are you sure you want to delete {counter,plural,one{this customer} other{{displayQuantity} customers}}?"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/views/MenuList.json
|
||||
#. [menuListDeleteMenusContent]
|
||||
#. defaultMessage is:
|
||||
#. Are you sure you want to delete {counter,plural,one{this menu} other{{displayQuantity} menus}}?
|
||||
msgctxt "description"
|
||||
msgid "Are you sure you want to delete {counter,plural,one{this menu} other{{displayQuantity} menus}}?"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/discounts/views/SaleList.json
|
||||
#. [src.discounts.views.2516361175] - dialog content
|
||||
#. defaultMessage is:
|
||||
|
@ -379,6 +435,14 @@ msgctxt "delete customer, dialog content"
|
|||
msgid "Are you sure you want to delete {email}?"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/views/MenuList.json
|
||||
#. [menuListDeleteMenuContent]
|
||||
#. defaultMessage is:
|
||||
#. Are you sure you want to delete {menuName}?
|
||||
msgctxt "description"
|
||||
msgid "Are you sure you want to delete {menuName}?"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/discounts/views/SaleDetails.json
|
||||
#. [src.discounts.views.1457489953] - dialog content
|
||||
#. defaultMessage is:
|
||||
|
@ -588,7 +652,7 @@ msgid "Billing address"
|
|||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [src.cancel] - button
|
||||
#. [cancel] - button
|
||||
#. defaultMessage is:
|
||||
#. Cancel
|
||||
msgctxt "button"
|
||||
|
@ -728,7 +792,7 @@ msgid "Configuration"
|
|||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [src.confirm] - button
|
||||
#. [confirm] - button
|
||||
#. defaultMessage is:
|
||||
#. Confirm
|
||||
msgctxt "button"
|
||||
|
@ -815,6 +879,22 @@ msgctxt "description"
|
|||
msgid "Created collection"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/views/MenuList.json
|
||||
#. [menuListCreatedMenu]
|
||||
#. defaultMessage is:
|
||||
#. Created menu
|
||||
msgctxt "description"
|
||||
msgid "Created menu"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuDetailsPage/MenuDetailsPage.json
|
||||
#. [menuDetailsPageHelperText]
|
||||
#. defaultMessage is:
|
||||
#. Creating the navigation structure is done by dragging and dropping. Simply create a new menu item and then drag it into its destined place. You can move items inside one another to create a tree structure and drag items up and down to create a hierarchy
|
||||
msgctxt "description"
|
||||
msgid "Creating the navigation structure is done by dragging and dropping. Simply create a new menu item and then drag it into its destined place. You can move items inside one another to create a tree structure and drag items up and down to create a hierarchy"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/customers/components/CustomerList/CustomerList.json
|
||||
#. [src.customers.components.CustomerList.2339105195]
|
||||
#. defaultMessage is:
|
||||
|
@ -1095,6 +1175,26 @@ msgctxt "dialog title"
|
|||
msgid "Delete image"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/views/MenuDetails/index.json
|
||||
#. [menuDetailsDeleteMenuHeader] - dialog header
|
||||
#. defaultMessage is:
|
||||
#. Delete menu
|
||||
#: build/locale/src/navigation/views/MenuList.json
|
||||
#. [menuListDeleteMenuHeader] - dialog header
|
||||
#. defaultMessage is:
|
||||
#. Delete menu
|
||||
msgctxt "dialog header"
|
||||
msgid "Delete menu"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/views/MenuList.json
|
||||
#. [menuListDeleteMenusHeader] - dialog header
|
||||
#. defaultMessage is:
|
||||
#. Delete menus
|
||||
msgctxt "dialog header"
|
||||
msgid "Delete menus"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/categories/views/CategoryDetails.json
|
||||
#. [src.categories.views.2507763081] - dialog title
|
||||
#. defaultMessage is:
|
||||
|
@ -1111,6 +1211,14 @@ msgctxt "description"
|
|||
msgid "Deleted collection"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/views/MenuList.json
|
||||
#. [menuListDeletedMenu]
|
||||
#. defaultMessage is:
|
||||
#. Deleted menu
|
||||
msgctxt "description"
|
||||
msgid "Deleted menu"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/collections/views/CollectionDetails.json
|
||||
#. [src.collections.views.3482612628]
|
||||
#. defaultMessage is:
|
||||
|
@ -1204,7 +1312,7 @@ msgid "E-mail Address"
|
|||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [src.edit] - button
|
||||
#. [edit] - button
|
||||
#. defaultMessage is:
|
||||
#. Edit
|
||||
msgctxt "button"
|
||||
|
@ -1219,6 +1327,14 @@ msgctxt "dialog title"
|
|||
msgid "Edit Address"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuItemDialog/MenuItemDialog.json
|
||||
#. [menuItemDialogEditItem] - edit menu item, header
|
||||
#. defaultMessage is:
|
||||
#. Edit Item
|
||||
msgctxt "edit menu item, header"
|
||||
msgid "Edit Item"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/attributes/components/AttributeValueEditDialog/AttributeValueEditDialog.json
|
||||
#. [src.attributes.components.AttributeValueEditDialog.1395607402] - edit attribute value
|
||||
#. defaultMessage is:
|
||||
|
@ -1383,6 +1499,14 @@ msgctxt "description"
|
|||
msgid "If this option is disabled, discount will be counted for every eligible product"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuList/MenuList.json
|
||||
#. [menuListItems] - number of menu items
|
||||
#. defaultMessage is:
|
||||
#. Items
|
||||
msgctxt "number of menu items"
|
||||
msgid "Items"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [src.lastName]
|
||||
#. defaultMessage is:
|
||||
|
@ -1431,8 +1555,24 @@ msgctxt "limit voucher"
|
|||
msgid "Limit to one use per customer"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuItemDialog/MenuItemDialog.json
|
||||
#. [menuItemDialogLinkLabel] - label
|
||||
#. defaultMessage is:
|
||||
#. Link
|
||||
msgctxt "label"
|
||||
msgid "Link"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuItemDialog/MenuItemDialog.json
|
||||
#. [menuItemDialogAddLink] - add link to navigation
|
||||
#. defaultMessage is:
|
||||
#. Link to: {url}
|
||||
msgctxt "add link to navigation"
|
||||
msgid "Link to: {url}"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [src.manage] - button
|
||||
#. [manage] - button
|
||||
#. defaultMessage is:
|
||||
#. Manage
|
||||
msgctxt "button"
|
||||
|
@ -1471,6 +1611,30 @@ msgctxt "description"
|
|||
msgid "Manage your employees and their permissions"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuItems/MenuItems.json
|
||||
#. [menuItemsHeader] - header
|
||||
#. defaultMessage is:
|
||||
#. Menu Items
|
||||
msgctxt "header"
|
||||
msgid "Menu Items"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuCreateDialog/MenuCreateDialog.json
|
||||
#. [menuCreateDialogMenuTitleLabel]
|
||||
#. defaultMessage is:
|
||||
#. Menu Title
|
||||
#: build/locale/src/navigation/components/MenuList/MenuList.json
|
||||
#. [menuListMenutitle]
|
||||
#. defaultMessage is:
|
||||
#. Menu Title
|
||||
#: build/locale/src/navigation/components/MenuProperties/MenuProperties.json
|
||||
#. [menuPropertiesMenuTitle]
|
||||
#. defaultMessage is:
|
||||
#. Menu Title
|
||||
msgctxt "description"
|
||||
msgid "Menu Title"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/discounts/components/VoucherSummary/VoucherSummary.json
|
||||
#. [src.discounts.components.VoucherSummary.1836123577] - voucher value requirement
|
||||
#. defaultMessage is:
|
||||
|
@ -1563,6 +1727,14 @@ msgctxt "sale name"
|
|||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuItemDialog/MenuItemDialog.json
|
||||
#. [menuItemDialogNameLabel] - menu item name
|
||||
#. defaultMessage is:
|
||||
#. Name
|
||||
msgctxt "menu item name"
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [src.navigation] - navigation section name
|
||||
#. defaultMessage is:
|
||||
|
@ -1619,6 +1791,14 @@ msgctxt "description"
|
|||
msgid "No customers found"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuList/MenuList.json
|
||||
#. [menuListNoMenus]
|
||||
#. defaultMessage is:
|
||||
#. No menus found
|
||||
msgctxt "description"
|
||||
msgid "No menus found"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/customers/components/CustomerOrders/CustomerOrders.json
|
||||
#. [src.customers.components.CustomerOrders.898333473]
|
||||
#. defaultMessage is:
|
||||
|
@ -1976,7 +2156,7 @@ msgid "Remember this will also delete all products assigned to this category."
|
|||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [src.remove] - button
|
||||
#. [remove] - button
|
||||
#. defaultMessage is:
|
||||
#. Remove
|
||||
msgctxt "button"
|
||||
|
@ -2000,7 +2180,7 @@ msgid "Sales"
|
|||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [src.save] - button
|
||||
#. [save] - button
|
||||
#. defaultMessage is:
|
||||
#. Save
|
||||
msgctxt "button"
|
||||
|
@ -2071,6 +2251,14 @@ msgctxt "subsection header"
|
|||
msgid "Shipping address"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [show] - button
|
||||
#. defaultMessage is:
|
||||
#. Show
|
||||
msgctxt "button"
|
||||
msgid "Show"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [src.siteSettings] - site settings section name
|
||||
#. defaultMessage is:
|
||||
|
@ -2103,6 +2291,14 @@ msgctxt "description"
|
|||
msgid "Start Hour"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/navigation/components/MenuItemDialog/MenuItemDialog.json
|
||||
#. [menuItemDialogLinkPlaceholder]
|
||||
#. defaultMessage is:
|
||||
#. Start typing to begin search...
|
||||
msgctxt "description"
|
||||
msgid "Start typing to begin search..."
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/discounts/components/SaleList/SaleList.json
|
||||
#. [src.discounts.components.SaleList.47059407] - sale start date
|
||||
#. defaultMessage is:
|
||||
|
@ -2403,6 +2599,14 @@ msgctxt "dialog title"
|
|||
msgid "Unassign products from collection"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/intl.json
|
||||
#. [undo] - button
|
||||
#. defaultMessage is:
|
||||
#. Undo
|
||||
msgctxt "button"
|
||||
msgid "Undo"
|
||||
msgstr ""
|
||||
|
||||
#: build/locale/src/collections/views/CollectionList.json
|
||||
#. [src.collections.views.2237014112] - unpublish collections
|
||||
#. defaultMessage is:
|
||||
|
|
28
src/intl.ts
28
src/intl.ts
|
@ -52,27 +52,43 @@ export const commonMessages = defineMessages({
|
|||
export const buttonMessages = defineMessages({
|
||||
cancel: {
|
||||
defaultMessage: "Cancel",
|
||||
description: "button"
|
||||
description: "button",
|
||||
id: "cancel"
|
||||
},
|
||||
confirm: {
|
||||
defaultMessage: "Confirm",
|
||||
description: "button"
|
||||
description: "button",
|
||||
id: "confirm"
|
||||
},
|
||||
edit: {
|
||||
defaultMessage: "Edit",
|
||||
description: "button"
|
||||
description: "button",
|
||||
id: "edit"
|
||||
},
|
||||
manage: {
|
||||
defaultMessage: "Manage",
|
||||
description: "button"
|
||||
description: "button",
|
||||
id: "manage"
|
||||
},
|
||||
remove: {
|
||||
defaultMessage: "Remove",
|
||||
description: "button"
|
||||
description: "button",
|
||||
id: "remove"
|
||||
},
|
||||
save: {
|
||||
defaultMessage: "Save",
|
||||
description: "button"
|
||||
description: "button",
|
||||
id: "save"
|
||||
},
|
||||
show: {
|
||||
defaultMessage: "Show",
|
||||
description: "button",
|
||||
id: "show"
|
||||
},
|
||||
undo: {
|
||||
defaultMessage: "Undo",
|
||||
description: "button",
|
||||
id: "undo"
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -5,12 +5,13 @@ import DialogContent from "@material-ui/core/DialogContent";
|
|||
import DialogTitle from "@material-ui/core/DialogTitle";
|
||||
import TextField from "@material-ui/core/TextField";
|
||||
import React from "react";
|
||||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
|
||||
import ConfirmButton, {
|
||||
ConfirmButtonTransitionState
|
||||
} from "@saleor/components/ConfirmButton";
|
||||
import Form from "@saleor/components/Form";
|
||||
import i18n from "../../../i18n";
|
||||
import { buttonMessages } from "@saleor/intl";
|
||||
|
||||
export interface MenuCreateDialogFormData {
|
||||
name: string;
|
||||
|
@ -34,46 +35,55 @@ const MenuCreateDialog: React.FC<MenuCreateDialogProps> = ({
|
|||
onClose,
|
||||
onConfirm,
|
||||
open
|
||||
}) => (
|
||||
<Dialog onClose={onClose} maxWidth="sm" fullWidth open={open}>
|
||||
<DialogTitle>
|
||||
{i18n.t("Add Menu", {
|
||||
context: "create menu modal window title"
|
||||
})}
|
||||
</DialogTitle>
|
||||
<Form initial={initialForm} onSubmit={onConfirm}>
|
||||
{({ change, data, errors: formErrors, submit }) => (
|
||||
<>
|
||||
<DialogContent>
|
||||
<TextField
|
||||
disabled={disabled}
|
||||
error={!!formErrors.name}
|
||||
fullWidth
|
||||
helperText={formErrors.name}
|
||||
label={i18n.t("Menu Title")}
|
||||
name={"name" as keyof MenuCreateDialogFormData}
|
||||
value={data.name}
|
||||
onChange={change}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={onClose}>
|
||||
{i18n.t("Cancel", { context: "button" })}
|
||||
</Button>
|
||||
<ConfirmButton
|
||||
transitionState={confirmButtonState}
|
||||
color="primary"
|
||||
variant="contained"
|
||||
onClick={submit}
|
||||
>
|
||||
{i18n.t("Create")}
|
||||
</ConfirmButton>
|
||||
</DialogActions>
|
||||
</>
|
||||
)}
|
||||
</Form>
|
||||
</Dialog>
|
||||
);
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
<Dialog onClose={onClose} maxWidth="sm" fullWidth open={open}>
|
||||
<DialogTitle>
|
||||
<FormattedMessage
|
||||
defaultMessage="Add Menu"
|
||||
description="dialog header"
|
||||
id="menuCreateDialogHeader"
|
||||
/>
|
||||
</DialogTitle>
|
||||
<Form initial={initialForm} onSubmit={onConfirm}>
|
||||
{({ change, data, errors: formErrors, submit }) => (
|
||||
<>
|
||||
<DialogContent>
|
||||
<TextField
|
||||
disabled={disabled}
|
||||
error={!!formErrors.name}
|
||||
fullWidth
|
||||
helperText={formErrors.name}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Menu Title",
|
||||
id: "menuCreateDialogMenuTitleLabel"
|
||||
})}
|
||||
name={"name" as keyof MenuCreateDialogFormData}
|
||||
value={data.name}
|
||||
onChange={change}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={onClose}>
|
||||
<FormattedMessage {...buttonMessages.cancel} />
|
||||
</Button>
|
||||
<ConfirmButton
|
||||
transitionState={confirmButtonState}
|
||||
color="primary"
|
||||
variant="contained"
|
||||
onClick={submit}
|
||||
>
|
||||
<FormattedMessage {...buttonMessages.save} />
|
||||
</ConfirmButton>
|
||||
</DialogActions>
|
||||
</>
|
||||
)}
|
||||
</Form>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
||||
MenuCreateDialog.displayName = "MenuCreateDialog";
|
||||
export default MenuCreateDialog;
|
||||
|
|
|
@ -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";
|
||||
|
@ -8,7 +9,7 @@ import Container from "@saleor/components/Container";
|
|||
import Form from "@saleor/components/Form";
|
||||
import Grid from "@saleor/components/Grid";
|
||||
import SaveButtonBar from "@saleor/components/SaveButtonBar";
|
||||
import i18n from "../../../i18n";
|
||||
import { sectionNames } from "@saleor/intl";
|
||||
import { maybe } from "../../../misc";
|
||||
import { MenuDetails_menu } from "../../types/MenuDetails";
|
||||
import { MenuItemType } from "../MenuItemDialog";
|
||||
|
@ -47,6 +48,8 @@ const MenuDetailsPage: React.StatelessComponent<MenuDetailsPageProps> = ({
|
|||
onItemEdit,
|
||||
onSubmit
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
const initialForm: MenuDetailsFormData = {
|
||||
name: maybe(() => menu.name, "")
|
||||
};
|
||||
|
@ -76,14 +79,19 @@ const MenuDetailsPage: React.StatelessComponent<MenuDetailsPageProps> = ({
|
|||
<Form initial={initialForm} onSubmit={handleSubmit}>
|
||||
{({ change, data, hasChanged, submit }) => (
|
||||
<Container>
|
||||
<AppHeader onBack={onBack}>{i18n.t("Navigation")}</AppHeader>
|
||||
<AppHeader onBack={onBack}>
|
||||
{intl.formatMessage(sectionNames.navigation)}
|
||||
</AppHeader>
|
||||
<Grid variant="inverted">
|
||||
<div>
|
||||
<Typography variant="h5">{i18n.t("Navigation")}</Typography>
|
||||
<Typography variant="h5">
|
||||
{intl.formatMessage(sectionNames.navigation)}
|
||||
</Typography>
|
||||
<Typography>
|
||||
{i18n.t(
|
||||
"Creating the navigation structure is done by dragging and dropping. Simply create a new menu item and then drag it into its destined place. You can move items inside one another to create a tree structure and drag items up and down to create a hierarchy"
|
||||
)}
|
||||
<FormattedMessage
|
||||
defaultMessage="Creating the navigation structure is done by dragging and dropping. Simply create a new menu item and then drag it into its destined place. You can move items inside one another to create a tree structure and drag items up and down to create a hierarchy"
|
||||
id="menuDetailsPageHelperText"
|
||||
/>
|
||||
</Typography>
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
@ -7,6 +7,7 @@ import TextField from "@material-ui/core/TextField";
|
|||
import Typography from "@material-ui/core/Typography";
|
||||
import isUrl from "is-url";
|
||||
import React from "react";
|
||||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
|
||||
import AutocompleteSelectMenu from "@saleor/components/AutocompleteSelectMenu";
|
||||
import ConfirmButton, {
|
||||
|
@ -18,7 +19,7 @@ import { SearchCollections_collections_edges_node } from "@saleor/containers/Sea
|
|||
import { SearchPages_pages_edges_node } from "@saleor/containers/SearchPages/types/SearchPages";
|
||||
import useModalDialogErrors from "@saleor/hooks/useModalDialogErrors";
|
||||
import useStateFromProps from "@saleor/hooks/useStateFromProps";
|
||||
import i18n from "@saleor/i18n";
|
||||
import { buttonMessages, sectionNames } from "@saleor/intl";
|
||||
import { UserError } from "@saleor/types";
|
||||
import { getErrors, getFieldError } from "@saleor/utils/errors";
|
||||
import { getMenuItemByValue, IMenu } from "@saleor/utils/menu";
|
||||
|
@ -86,6 +87,7 @@ const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
|||
collections,
|
||||
pages
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const errors = useModalDialogErrors(apiErrors, open);
|
||||
const [displayValue, setDisplayValue] = React.useState(
|
||||
initialDisplayValue || ""
|
||||
|
@ -121,7 +123,7 @@ const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
|||
value: "category:" + category.id
|
||||
})),
|
||||
data: {},
|
||||
label: i18n.t("Categories")
|
||||
label: intl.formatMessage(sectionNames.categories)
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -137,7 +139,7 @@ const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
|||
value: "collection:" + collection.id
|
||||
})),
|
||||
data: {},
|
||||
label: i18n.t("Collections")
|
||||
label: intl.formatMessage(sectionNames.collections)
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -153,7 +155,7 @@ const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
|||
value: "page:" + page.id
|
||||
})),
|
||||
data: {},
|
||||
label: i18n.t("Pages")
|
||||
label: intl.formatMessage(sectionNames.pages)
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -164,12 +166,12 @@ const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
|||
children: [],
|
||||
data: {},
|
||||
label: (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: i18n.t("Link to: <strong>{{ url }}</strong>", {
|
||||
context: "add link to navigation",
|
||||
url
|
||||
})
|
||||
<FormattedMessage
|
||||
defaultMessage="Link to: {url}"
|
||||
description="add link to navigation"
|
||||
id="menuItemDialogAddLink"
|
||||
values={{
|
||||
url: <strong>{url}</strong>
|
||||
}}
|
||||
/>
|
||||
),
|
||||
|
@ -218,17 +220,25 @@ const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
|||
>
|
||||
<DialogTitle>
|
||||
{!!initial
|
||||
? i18n.t("Edit Item", {
|
||||
context: "edit menu item"
|
||||
? intl.formatMessage({
|
||||
defaultMessage: "Edit Item",
|
||||
description: "edit menu item, header",
|
||||
id: "menuItemDialogEditItem"
|
||||
})
|
||||
: i18n.t("Add Item", {
|
||||
context: "create new menu item"
|
||||
: intl.formatMessage({
|
||||
defaultMessage: "Add Item",
|
||||
description: "create new menu item, header",
|
||||
id: "menuItemDialogAddItem"
|
||||
})}
|
||||
</DialogTitle>
|
||||
<DialogContent style={{ overflowY: "visible" }}>
|
||||
<TextField
|
||||
disabled={disabled}
|
||||
label={i18n.t("Name")}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Name",
|
||||
description: "menu item name",
|
||||
id: "menuItemDialogNameLabel"
|
||||
})}
|
||||
fullWidth
|
||||
value={data.name}
|
||||
onChange={event =>
|
||||
|
@ -246,13 +256,20 @@ const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
|||
disabled={disabled}
|
||||
onChange={handleSelectChange}
|
||||
name="id"
|
||||
label={i18n.t("Link")}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Link",
|
||||
description: "label",
|
||||
id: "menuItemDialogLinkLabel"
|
||||
})}
|
||||
displayValue={displayValue}
|
||||
loading={loading}
|
||||
options={options}
|
||||
error={!!idError}
|
||||
helperText={idError}
|
||||
placeholder={i18n.t("Start typing to begin search...")}
|
||||
placeholder={intl.formatMessage({
|
||||
defaultMessage: "Start typing to begin search...",
|
||||
id: "menuItemDialogLinkPlaceholder"
|
||||
})}
|
||||
onInputChange={handleQueryChange}
|
||||
/>
|
||||
{mutationErrors.length > 0 && (
|
||||
|
@ -268,7 +285,7 @@ const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
|||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={onClose}>
|
||||
{i18n.t("Cancel", { context: "button" })}
|
||||
<FormattedMessage {...buttonMessages.cancel} />
|
||||
</Button>
|
||||
<ConfirmButton
|
||||
transitionState={confirmButtonState}
|
||||
|
@ -276,7 +293,7 @@ const MenuItemDialog: React.StatelessComponent<MenuItemDialogProps> = ({
|
|||
variant="contained"
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
{i18n.t("Submit", { context: "button" })}
|
||||
<FormattedMessage {...buttonMessages.confirm} />
|
||||
</ConfirmButton>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
|
|
@ -14,12 +14,13 @@ import DeleteIcon from "@material-ui/icons/Delete";
|
|||
import EditIcon from "@material-ui/icons/Edit";
|
||||
import classNames from "classnames";
|
||||
import React from "react";
|
||||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
import SortableTree, { NodeRendererProps, TreeItem } from "react-sortable-tree";
|
||||
|
||||
import CardTitle from "@saleor/components/CardTitle";
|
||||
import Skeleton from "@saleor/components/Skeleton";
|
||||
import useTheme from "@saleor/hooks/useTheme";
|
||||
import i18n from "../../../i18n";
|
||||
import { buttonMessages } from "@saleor/intl";
|
||||
import Draggable from "../../../icons/Draggable";
|
||||
import { MenuDetails_menu_items } from "../../types/MenuDetails";
|
||||
import { MenuItemType } from "../MenuItemDialog";
|
||||
|
@ -121,7 +122,10 @@ const Placeholder = withStyles(styles, {
|
|||
})(({ classes }: WithStyles<typeof styles>) => (
|
||||
<Paper className={classes.row} elevation={0}>
|
||||
<Typography>
|
||||
{i18n.t("Add new menu item to begin creating menu")}
|
||||
<FormattedMessage
|
||||
defaultMessage="Add new menu item to begin creating menu"
|
||||
id="menuItemsPlaceholder"
|
||||
/>
|
||||
</Typography>
|
||||
</Paper>
|
||||
));
|
||||
|
@ -175,7 +179,7 @@ const Node = withStyles(styles, {
|
|||
</Typography>
|
||||
<div className={classes.spacer} />
|
||||
<Button color="primary" onClick={node.onClick}>
|
||||
{i18n.t("Show")}
|
||||
<FormattedMessage {...buttonMessages.show} />
|
||||
</Button>
|
||||
<IconButton color="primary" onClick={node.onEdit}>
|
||||
<EditIcon />
|
||||
|
@ -209,15 +213,20 @@ const MenuItems = withStyles(styles, { name: "MenuItems" })(
|
|||
onItemEdit,
|
||||
onUndo
|
||||
}: MenuItemsProps & WithStyles<typeof styles>) => {
|
||||
const intl = useIntl();
|
||||
const { isDark } = useTheme();
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<CardTitle
|
||||
title={i18n.t("Menu Items")}
|
||||
title={intl.formatMessage({
|
||||
defaultMessage: "Menu Items",
|
||||
description: "header",
|
||||
id: "menuItemsHeader"
|
||||
})}
|
||||
toolbar={
|
||||
<Button color="primary" disabled={!canUndo} onClick={onUndo}>
|
||||
{i18n.t("Undo")}
|
||||
<FormattedMessage {...buttonMessages.undo} />
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
|
@ -266,9 +275,11 @@ const MenuItems = withStyles(styles, { name: "MenuItems" })(
|
|||
</div>
|
||||
<CardActions className={classes.actions}>
|
||||
<Button color="primary" onClick={onItemAdd}>
|
||||
{i18n.t("Add new item", {
|
||||
context: "add menu item"
|
||||
})}
|
||||
<FormattedMessage
|
||||
defaultMessage="Add new item"
|
||||
description="add new menu item"
|
||||
id="menuItemsAddItem"
|
||||
/>
|
||||
</Button>
|
||||
</CardActions>
|
||||
</Card>
|
||||
|
|
|
@ -12,13 +12,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 } from "react-intl";
|
||||
|
||||
import Checkbox from "@saleor/components/Checkbox";
|
||||
import IconButtonTableCell from "@saleor/components/IconButtonTableCell";
|
||||
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 { MenuList_menus_edges_node } from "../../types/MenuList";
|
||||
|
@ -76,10 +76,17 @@ const MenuList = withStyles(styles, { name: "MenuList" })(
|
|||
toolbar={toolbar}
|
||||
>
|
||||
<TableCell className={classes.colTitle}>
|
||||
{i18n.t("Menu Title", { context: "object" })}
|
||||
<FormattedMessage
|
||||
defaultMessage="Menu Title"
|
||||
id="menuListMenutitle"
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell className={classes.colItems}>
|
||||
{i18n.t("Items", { context: "number of menu items" })}
|
||||
<FormattedMessage
|
||||
defaultMessage="Items"
|
||||
description="number of menu items"
|
||||
id="menuListItems"
|
||||
/>
|
||||
</TableCell>
|
||||
</TableHead>
|
||||
<TableFooter>
|
||||
|
@ -140,7 +147,10 @@ const MenuList = withStyles(styles, { name: "MenuList" })(
|
|||
() => (
|
||||
<TableRow>
|
||||
<TableCell colSpan={numberOfColumns}>
|
||||
{i18n.t("No menus found")}
|
||||
<FormattedMessage
|
||||
defaultMessage="No menus found"
|
||||
id="menuListNoMenus"
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
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 AppHeader from "@saleor/components/AppHeader";
|
||||
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 { MenuList_menus_edges_node } from "../../types/MenuList";
|
||||
import MenuList from "../MenuList";
|
||||
|
@ -21,21 +22,31 @@ const MenuListPage: React.StatelessComponent<MenuListPageProps> = ({
|
|||
onAdd,
|
||||
onBack,
|
||||
...listProps
|
||||
}) => (
|
||||
<Container>
|
||||
<AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader>
|
||||
<PageHeader title={i18n.t("Navigation")}>
|
||||
<Button
|
||||
color="primary"
|
||||
disabled={disabled}
|
||||
variant="contained"
|
||||
onClick={onAdd}
|
||||
>
|
||||
{i18n.t("Add Menu")} <AddIcon />
|
||||
</Button>
|
||||
</PageHeader>
|
||||
<MenuList disabled={disabled} {...listProps} />
|
||||
</Container>
|
||||
);
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
return (
|
||||
<Container>
|
||||
<AppHeader onBack={onBack}>
|
||||
{intl.formatMessage(sectionNames.configuration)}
|
||||
</AppHeader>
|
||||
<PageHeader title={intl.formatMessage(sectionNames.navigation)}>
|
||||
<Button
|
||||
color="primary"
|
||||
disabled={disabled}
|
||||
variant="contained"
|
||||
onClick={onAdd}
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Add Menu"
|
||||
description="button"
|
||||
id="menuListPageAddMenu"
|
||||
/>
|
||||
<AddIcon />
|
||||
</Button>
|
||||
</PageHeader>
|
||||
<MenuList disabled={disabled} {...listProps} />
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
MenuListPage.displayName = "MenuListPage";
|
||||
export default MenuListPage;
|
||||
|
|
|
@ -2,9 +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 i18n from "../../../i18n";
|
||||
import { commonMessages } from "@saleor/intl";
|
||||
import { MenuDetailsFormData } from "../MenuDetailsPage";
|
||||
|
||||
export interface MenuPropertiesProps {
|
||||
|
@ -17,20 +18,29 @@ const MenuProperties: React.StatelessComponent<MenuPropertiesProps> = ({
|
|||
data,
|
||||
disabled,
|
||||
onChange
|
||||
}) => (
|
||||
<Card>
|
||||
<CardTitle title={i18n.t("General Information")} />
|
||||
<CardContent>
|
||||
<TextField
|
||||
disabled={disabled}
|
||||
name={"name" as keyof MenuDetailsFormData}
|
||||
fullWidth
|
||||
label={i18n.t("Menu Title")}
|
||||
value={data.name}
|
||||
onChange={onChange}
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<CardTitle
|
||||
title={intl.formatMessage(commonMessages.generalInformations)}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
<CardContent>
|
||||
<TextField
|
||||
disabled={disabled}
|
||||
name={"name" as keyof MenuDetailsFormData}
|
||||
fullWidth
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Menu Title",
|
||||
id: "menuPropertiesMenuTitle"
|
||||
})}
|
||||
value={data.name}
|
||||
onChange={onChange}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
MenuProperties.displayName = "MenuProperties";
|
||||
export default MenuProperties;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import DialogContentText from "@material-ui/core/DialogContentText";
|
||||
import React from "react";
|
||||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
|
||||
import ActionDialog from "@saleor/components/ActionDialog";
|
||||
import useNavigator from "@saleor/hooks/useNavigator";
|
||||
|
@ -10,7 +11,6 @@ import { DEFAULT_INITIAL_SEARCH_DATA } from "../../../config";
|
|||
import SearchCategories from "../../../containers/SearchCategories";
|
||||
import SearchCollections from "../../../containers/SearchCollections";
|
||||
import SearchPages from "../../../containers/SearchPages";
|
||||
import i18n from "../../../i18n";
|
||||
import { getMutationState, maybe } from "../../../misc";
|
||||
import { pageUrl } from "../../../pages/urls";
|
||||
import MenuDetailsPage, {
|
||||
|
@ -58,6 +58,7 @@ interface MenuDetailsProps {
|
|||
const MenuDetails: React.FC<MenuDetailsProps> = ({ id, params }) => {
|
||||
const navigate = useNavigator();
|
||||
const notify = useNotifier();
|
||||
const intl = useIntl();
|
||||
|
||||
const closeModal = () =>
|
||||
navigate(
|
||||
|
@ -236,21 +237,28 @@ const MenuDetails: React.FC<MenuDetailsProps> = ({ id, params }) => {
|
|||
menuDelete({ variables: { id } })
|
||||
}
|
||||
variant="delete"
|
||||
title={i18n.t("Remove menu")}
|
||||
title={intl.formatMessage({
|
||||
defaultMessage: "Delete menu",
|
||||
description: "dialog header",
|
||||
id: "menuDetailsDeleteMenuHeader"
|
||||
})}
|
||||
>
|
||||
<DialogContentText
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: i18n.t(
|
||||
"Are you sure you want to remove menu <strong>{{ name }}</strong>?",
|
||||
{
|
||||
name: maybe(
|
||||
() => data.menu.name,
|
||||
"..."
|
||||
)
|
||||
}
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<DialogContentText>
|
||||
<FormattedMessage
|
||||
defaultMessage="Are you sure you want to delete menu {menuName}?"
|
||||
id="menuDetailsDeleteMenuContent"
|
||||
values={{
|
||||
menuName: (
|
||||
<strong>
|
||||
{maybe(
|
||||
() => data.menu.name,
|
||||
"..."
|
||||
)}
|
||||
</strong>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</DialogContentText>
|
||||
</ActionDialog>
|
||||
|
||||
<MenuItemCreateMutation
|
||||
|
|
|
@ -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 { configurationMenuUrl } from "@saleor/configuration";
|
||||
|
@ -11,7 +12,7 @@ import useNotifier from "@saleor/hooks/useNotifier";
|
|||
import usePaginator, {
|
||||
createPaginationState
|
||||
} from "@saleor/hooks/usePaginator";
|
||||
import i18n from "@saleor/i18n";
|
||||
import { buttonMessages, commonMessages } from "@saleor/intl";
|
||||
import { getMutationState, maybe } from "@saleor/misc";
|
||||
import { ListViews } from "@saleor/types";
|
||||
import MenuCreateDialog from "../components/MenuCreateDialog";
|
||||
|
@ -40,6 +41,7 @@ const MenuList: React.FC<MenuListProps> = ({ params }) => {
|
|||
const { updateListSettings, settings } = useListSettings(
|
||||
ListViews.NAVIGATION_LIST
|
||||
);
|
||||
const intl = useIntl();
|
||||
|
||||
const closeModal = () =>
|
||||
navigate(
|
||||
|
@ -66,8 +68,9 @@ const MenuList: React.FC<MenuListProps> = ({ params }) => {
|
|||
const handleCreate = (data: MenuCreate) => {
|
||||
if (data.menuCreate.errors.length === 0) {
|
||||
notify({
|
||||
text: i18n.t("Created menu", {
|
||||
context: "notification"
|
||||
text: intl.formatMessage({
|
||||
defaultMessage: "Created menu",
|
||||
id: "menuListCreatedMenu"
|
||||
})
|
||||
});
|
||||
navigate(menuUrl(data.menuCreate.menu.id));
|
||||
|
@ -77,9 +80,7 @@ const MenuList: React.FC<MenuListProps> = ({ params }) => {
|
|||
const handleBulkDelete = (data: MenuBulkDelete) => {
|
||||
if (data.menuBulkDelete.errors.length === 0) {
|
||||
notify({
|
||||
text: i18n.t("Removed menus", {
|
||||
context: "notification"
|
||||
})
|
||||
text: intl.formatMessage(commonMessages.savedChanges)
|
||||
});
|
||||
closeModal();
|
||||
reset();
|
||||
|
@ -90,8 +91,9 @@ const MenuList: React.FC<MenuListProps> = ({ params }) => {
|
|||
const handleDelete = (data: MenuDelete) => {
|
||||
if (data.menuDelete.errors.length === 0) {
|
||||
notify({
|
||||
text: i18n.t("Removed menu", {
|
||||
context: "notification"
|
||||
text: intl.formatMessage({
|
||||
defaultMessage: "Deleted menu",
|
||||
id: "menuListDeletedMenu"
|
||||
})
|
||||
});
|
||||
closeModal();
|
||||
|
@ -172,7 +174,7 @@ const MenuList: React.FC<MenuListProps> = ({ params }) => {
|
|||
)
|
||||
}
|
||||
>
|
||||
{i18n.t("Remove")}
|
||||
<FormattedMessage {...buttonMessages.remove} />
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
|
@ -199,27 +201,33 @@ const MenuList: React.FC<MenuListProps> = ({ params }) => {
|
|||
})
|
||||
}
|
||||
variant="delete"
|
||||
title={i18n.t("Remove menu")}
|
||||
title={intl.formatMessage({
|
||||
defaultMessage: "Delete menu",
|
||||
description: "dialog header",
|
||||
id: "menuListDeleteMenuHeader"
|
||||
})}
|
||||
>
|
||||
<DialogContentText
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: i18n.t(
|
||||
"Are you sure you want to remove <strong>{{ name }}</strong>?",
|
||||
{
|
||||
name: maybe(
|
||||
() =>
|
||||
data.menus.edges.find(
|
||||
edge => edge.node.id === params.id
|
||||
).node.name,
|
||||
"..."
|
||||
)
|
||||
}
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<DialogContentText>
|
||||
<FormattedMessage
|
||||
defaultMessage="Are you sure you want to delete {menuName}?"
|
||||
id="menuListDeleteMenuContent"
|
||||
values={{
|
||||
menuName: maybe(
|
||||
() =>
|
||||
data.menus.edges.find(
|
||||
edge => edge.node.id === params.id
|
||||
).node.name,
|
||||
"..."
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</DialogContentText>
|
||||
</ActionDialog>
|
||||
<ActionDialog
|
||||
open={params.action === "remove-many"}
|
||||
open={
|
||||
params.action === "remove-many" &&
|
||||
maybe(() => params.ids.length > 0)
|
||||
}
|
||||
onClose={closeModal}
|
||||
confirmButtonState={bulkDeleteTransitionState}
|
||||
onConfirm={() =>
|
||||
|
@ -230,21 +238,35 @@ const MenuList: React.FC<MenuListProps> = ({ params }) => {
|
|||
})
|
||||
}
|
||||
variant="delete"
|
||||
title={i18n.t("Remove menus")}
|
||||
title={intl.formatMessage({
|
||||
defaultMessage: "Delete menus",
|
||||
description: "dialog header",
|
||||
id: "menuListDeleteMenusHeader"
|
||||
})}
|
||||
>
|
||||
<DialogContentText
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: i18n.t(
|
||||
"Are you sure you want to remove <strong>{{ number }}</strong> menus?",
|
||||
{
|
||||
number: maybe(
|
||||
() => params.ids.length.toString(),
|
||||
"..."
|
||||
)
|
||||
}
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<DialogContentText>
|
||||
<FormattedMessage
|
||||
defaultMessage="Are you sure you want to delete {counter, plural,
|
||||
one {this menu}
|
||||
other {{displayQuantity} menus}
|
||||
}?"
|
||||
id="menuListDeleteMenusContent"
|
||||
values={{
|
||||
counter: maybe(
|
||||
() => params.ids.length.toString(),
|
||||
"..."
|
||||
),
|
||||
displayQuantity: (
|
||||
<strong>
|
||||
{maybe(
|
||||
() => params.ids.length.toString(),
|
||||
"..."
|
||||
)}
|
||||
</strong>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</DialogContentText>
|
||||
</ActionDialog>
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue