Refactor translations in taxes section (#130)
This commit is contained in:
parent
f3b04aef8a
commit
8edd6ee756
6 changed files with 208 additions and 68 deletions
|
@ -1,6 +1,6 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"POT-Creation-Date: 2019-08-26T21:41:35.304Z\n"
|
"POT-Creation-Date: 2019-08-26T21:45:05.243Z\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -523,6 +523,14 @@ msgctxt "section header"
|
||||||
msgid "All Subcategories"
|
msgid "All Subcategories"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/TaxConfiguration/TaxConfiguration.json
|
||||||
|
#. [src.taxes.components.TaxConfiguration.142803418]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. All products prices are entered with tax included
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "All products prices are entered with tax included"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/products/components/ProductStock/ProductStock.json
|
#: build/locale/src/products/components/ProductStock/ProductStock.json
|
||||||
#. [src.products.components.ProductStock.1680952454] - allocated product stock
|
#. [src.products.components.ProductStock.1680952454] - allocated product stock
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -1419,6 +1427,10 @@ msgstr ""
|
||||||
#. [src.products.components.ProductOrganization.1755013298]
|
#. [src.products.components.ProductOrganization.1755013298]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
#. Category
|
#. Category
|
||||||
|
#: build/locale/src/taxes/components/CountryTaxesPage/CountryTaxesPage.json
|
||||||
|
#. [src.taxes.components.CountryTaxesPage.1755013298]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Category
|
||||||
msgctxt "description"
|
msgctxt "description"
|
||||||
msgid "Category"
|
msgid "Category"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -1495,6 +1507,14 @@ msgctxt "description"
|
||||||
msgid "Charge taxes for this item"
|
msgid "Charge taxes for this item"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/TaxConfiguration/TaxConfiguration.json
|
||||||
|
#. [src.taxes.components.TaxConfiguration.2654711891]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Charge taxes on shipping rates
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Charge taxes on shipping rates"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
|
#: build/locale/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.json
|
||||||
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.2404264158]
|
#. [src.shipping.components.ShippingZoneCountriesAssignDialog.2404264158]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -1783,6 +1803,22 @@ msgctxt "description"
|
||||||
msgid "Country"
|
msgid "Country"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/CountryList/CountryList.json
|
||||||
|
#. [src.taxes.components.CountryList.4039455144]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Country Code
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Country Code"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/CountryList/CountryList.json
|
||||||
|
#. [src.taxes.components.CountryList.577035076]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Country Name
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Country Name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/siteSettings/components/SiteSettingsAddress/SiteSettingsAddress.json
|
#: build/locale/src/siteSettings/components/SiteSettingsAddress/SiteSettingsAddress.json
|
||||||
#. [src.siteSettings.components.SiteSettingsAddress.944851093]
|
#. [src.siteSettings.components.SiteSettingsAddress.944851093]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -2771,6 +2807,14 @@ msgctxt "switch button"
|
||||||
msgid "Feature on Homepage"
|
msgid "Feature on Homepage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/TaxConfiguration/TaxConfiguration.json
|
||||||
|
#. [src.taxes.components.TaxConfiguration.3375540052] - button
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Fetch taxes
|
||||||
|
msgctxt "button"
|
||||||
|
msgid "Fetch taxes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json
|
#: build/locale/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.json
|
||||||
#. [src.discounts.components.DiscountCountrySelectDialog.2566713432] - search box label
|
#. [src.discounts.components.DiscountCountrySelectDialog.2566713432] - search box label
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -3551,6 +3595,14 @@ msgctxt "description"
|
||||||
msgid "No collections found"
|
msgid "No collections found"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/CountryList/CountryList.json
|
||||||
|
#. [src.taxes.components.CountryList.110033143]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. No countries found
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "No countries found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/customers/components/CustomerList/CustomerList.json
|
#: build/locale/src/customers/components/CustomerList/CustomerList.json
|
||||||
#. [src.customers.components.CustomerList.2239722559]
|
#. [src.customers.components.CustomerList.2239722559]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -3671,6 +3723,14 @@ msgctxt "description"
|
||||||
msgid "No products out of stock"
|
msgid "No products out of stock"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/CountryTaxesPage/CountryTaxesPage.json
|
||||||
|
#. [src.taxes.components.CountryTaxesPage.3066312070]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. No reduced tax categories found
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "No reduced tax categories found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/productTypes/components/AssignAttributeDialog/AssignAttributeDialog.json
|
#: build/locale/src/productTypes/components/AssignAttributeDialog/AssignAttributeDialog.json
|
||||||
#. [src.productTypes.components.AssignAttributeDialog.4205644805]
|
#. [src.productTypes.components.AssignAttributeDialog.4205644805]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -4763,6 +4823,14 @@ msgctxt "section header"
|
||||||
msgid "Recent orders"
|
msgid "Recent orders"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/CountryList/CountryList.json
|
||||||
|
#. [src.taxes.components.CountryList.3154586635]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Reduced Tax Rates
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Reduced Tax Rates"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/orders/components/OrderPayment/OrderPayment.json
|
#: build/locale/src/orders/components/OrderPayment/OrderPayment.json
|
||||||
#. [src.orders.components.OrderPayment.2845258362] - button
|
#. [src.orders.components.OrderPayment.2845258362] - button
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -5243,6 +5311,14 @@ msgctxt "button"
|
||||||
msgid "Show"
|
msgid "Show"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/TaxConfiguration/TaxConfiguration.json
|
||||||
|
#. [src.taxes.components.TaxConfiguration.2102582640]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Show gross prices to customers in the storefront
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Show gross prices to customers in the storefront"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/products/components/ProductOrganization/ProductOrganization.json
|
#: build/locale/src/products/components/ProductOrganization/ProductOrganization.json
|
||||||
#. [src.products.components.ProductOrganization.150865454] - product is not configurable
|
#. [src.products.components.ProductOrganization.150865454] - product is not configurable
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -5543,6 +5619,22 @@ msgctxt "tax rate for a product type"
|
||||||
msgid "Tax"
|
msgid "Tax"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/CountryTaxesPage/CountryTaxesPage.json
|
||||||
|
#. [src.taxes.components.CountryTaxesPage.2022558114]
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Tax Rate
|
||||||
|
msgctxt "description"
|
||||||
|
msgid "Tax Rate"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/CountryTaxesPage/CountryTaxesPage.json
|
||||||
|
#. [src.taxes.components.CountryTaxesPage.2737618795] - header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Tax Rates in {countryName}
|
||||||
|
msgctxt "header"
|
||||||
|
msgid "Tax Rates in {countryName}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/intl.json
|
#: build/locale/src/intl.json
|
||||||
#. [src.taxes] - taxes section name
|
#. [src.taxes] - taxes section name
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
@ -5571,6 +5663,14 @@ msgctxt "section header"
|
||||||
msgid "Taxes"
|
msgid "Taxes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: build/locale/src/taxes/components/CountryListPage/CountryListPage.json
|
||||||
|
#. [src.taxes.components.CountryListPage.3955023266] - header
|
||||||
|
#. defaultMessage is:
|
||||||
|
#. Taxes
|
||||||
|
msgctxt "header"
|
||||||
|
msgid "Taxes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: build/locale/src/orders/components/OrderDraftDetailsSummary/OrderDraftDetailsSummary.json
|
#: build/locale/src/orders/components/OrderDraftDetailsSummary/OrderDraftDetailsSummary.json
|
||||||
#. [src.orders.components.OrderDraftDetailsSummary.3202709354]
|
#. [src.orders.components.OrderDraftDetailsSummary.3202709354]
|
||||||
#. defaultMessage is:
|
#. defaultMessage is:
|
||||||
|
|
|
@ -7,9 +7,9 @@ import TableHead from "@material-ui/core/TableHead";
|
||||||
import TableRow from "@material-ui/core/TableRow";
|
import TableRow from "@material-ui/core/TableRow";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
import i18n from "../../../i18n";
|
|
||||||
import { maybe, renderCollection } from "../../../misc";
|
import { maybe, renderCollection } from "../../../misc";
|
||||||
import { CountryList_shop_countries } from "../../types/CountryList";
|
import { CountryList_shop_countries } from "../../types/CountryList";
|
||||||
|
|
||||||
|
@ -34,13 +34,13 @@ const CountryList = withStyles(styles, { name: "CountryList" })(
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{i18n.t("Country Code", { context: "object" })}
|
<FormattedMessage defaultMessage="Country Code" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{i18n.t("Country Name", { context: "object" })}
|
<FormattedMessage defaultMessage="Country Name" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={classes.textRight}>
|
<TableCell className={classes.textRight}>
|
||||||
{i18n.t("Reduced Tax Rates", { context: "object" })}
|
<FormattedMessage defaultMessage="Reduced Tax Rates" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
|
@ -73,7 +73,7 @@ const CountryList = withStyles(styles, { name: "CountryList" })(
|
||||||
() => (
|
() => (
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell colSpan={3}>
|
<TableCell colSpan={3}>
|
||||||
{i18n.t("No countries found")}
|
<FormattedMessage defaultMessage="No countries found" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
import AppHeader from "@saleor/components/AppHeader";
|
import AppHeader from "@saleor/components/AppHeader";
|
||||||
import { Container } from "@saleor/components/Container";
|
import { Container } from "@saleor/components/Container";
|
||||||
import Form from "@saleor/components/Form";
|
import Form from "@saleor/components/Form";
|
||||||
import Grid from "@saleor/components/Grid";
|
import Grid from "@saleor/components/Grid";
|
||||||
import PageHeader from "@saleor/components/PageHeader";
|
import PageHeader from "@saleor/components/PageHeader";
|
||||||
import i18n from "../../../i18n";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { maybe } from "../../../misc";
|
import { maybe } from "../../../misc";
|
||||||
import { CountryList_shop } from "../../types/CountryList";
|
import { CountryList_shop } from "../../types/CountryList";
|
||||||
import CountryList from "../CountryList";
|
import CountryList from "../CountryList";
|
||||||
|
@ -33,6 +34,8 @@ const CountryListPage: React.StatelessComponent<CountryListPageProps> = ({
|
||||||
onSubmit,
|
onSubmit,
|
||||||
onTaxFetch
|
onTaxFetch
|
||||||
}) => {
|
}) => {
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
const initialForm: FormData = {
|
const initialForm: FormData = {
|
||||||
chargeTaxesOnShipping: maybe(() => shop.chargeTaxesOnShipping, false),
|
chargeTaxesOnShipping: maybe(() => shop.chargeTaxesOnShipping, false),
|
||||||
includeTax: maybe(() => shop.includeTaxesInPrices, false),
|
includeTax: maybe(() => shop.includeTaxesInPrices, false),
|
||||||
|
@ -42,8 +45,15 @@ const CountryListPage: React.StatelessComponent<CountryListPageProps> = ({
|
||||||
<Form initial={initialForm} onSubmit={onSubmit}>
|
<Form initial={initialForm} onSubmit={onSubmit}>
|
||||||
{({ change, data, submit }) => (
|
{({ change, data, submit }) => (
|
||||||
<Container>
|
<Container>
|
||||||
<AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader>
|
<AppHeader onBack={onBack}>
|
||||||
<PageHeader title={i18n.t("Taxes", { context: "page title" })} />
|
{intl.formatMessage(sectionNames.configuration)}
|
||||||
|
</AppHeader>
|
||||||
|
<PageHeader
|
||||||
|
title={intl.formatMessage({
|
||||||
|
defaultMessage: "Taxes",
|
||||||
|
description: "header"
|
||||||
|
})}
|
||||||
|
/>
|
||||||
<Grid>
|
<Grid>
|
||||||
<div>
|
<div>
|
||||||
<CountryList
|
<CountryList
|
||||||
|
|
|
@ -6,13 +6,14 @@ import TableCell from "@material-ui/core/TableCell";
|
||||||
import TableHead from "@material-ui/core/TableHead";
|
import TableHead from "@material-ui/core/TableHead";
|
||||||
import TableRow from "@material-ui/core/TableRow";
|
import TableRow from "@material-ui/core/TableRow";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import AppHeader from "@saleor/components/AppHeader";
|
import AppHeader from "@saleor/components/AppHeader";
|
||||||
import { Container } from "@saleor/components/Container";
|
import { Container } from "@saleor/components/Container";
|
||||||
import Grid from "@saleor/components/Grid";
|
import Grid from "@saleor/components/Grid";
|
||||||
import PageHeader from "@saleor/components/PageHeader";
|
import PageHeader from "@saleor/components/PageHeader";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
import i18n from "../../../i18n";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { maybe, renderCollection, translatedTaxRates } from "../../../misc";
|
import { maybe, renderCollection, translatedTaxRates } from "../../../misc";
|
||||||
import { CountryList_shop_countries_vat_reducedRates } from "../../types/CountryList";
|
import { CountryList_shop_countries_vat_reducedRates } from "../../types/CountryList";
|
||||||
|
|
||||||
|
@ -35,17 +36,26 @@ const CountryTaxesPage = withStyles(styles, { name: "CountryTaxesPage" })(
|
||||||
taxCategories,
|
taxCategories,
|
||||||
onBack
|
onBack
|
||||||
}: CountryTaxesPageProps & WithStyles<typeof styles>) => {
|
}: CountryTaxesPageProps & WithStyles<typeof styles>) => {
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
const taxRates = translatedTaxRates();
|
const taxRates = translatedTaxRates();
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<AppHeader onBack={onBack}>{i18n.t("Taxes")}</AppHeader>
|
<AppHeader onBack={onBack}>
|
||||||
|
{intl.formatMessage(sectionNames.taxes)}
|
||||||
|
</AppHeader>
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title={
|
title={
|
||||||
countryName
|
countryName
|
||||||
? i18n.t("Tax Rates in {{ countryName }}", {
|
? intl.formatMessage(
|
||||||
context: "page title",
|
{
|
||||||
|
defaultMessage: "Tax Rates in {countryName}",
|
||||||
|
description: "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
countryName
|
countryName
|
||||||
})
|
}
|
||||||
|
)
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
@ -56,10 +66,10 @@ const CountryTaxesPage = withStyles(styles, { name: "CountryTaxesPage" })(
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell className={classes.wideColumn}>
|
<TableCell className={classes.wideColumn}>
|
||||||
{i18n.t("Category", { context: "object" })}
|
<FormattedMessage defaultMessage="Category" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{i18n.t("Tax Rate", { context: "object" })}
|
<FormattedMessage defaultMessage="Tax Rate" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
|
@ -87,7 +97,7 @@ const CountryTaxesPage = withStyles(styles, { name: "CountryTaxesPage" })(
|
||||||
() => (
|
() => (
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell colSpan={2}>
|
<TableCell colSpan={2}>
|
||||||
{i18n.t("No reduced tax categories found")}
|
<FormattedMessage defaultMessage="No reduced tax categories found" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,12 +4,13 @@ import CardActions from "@material-ui/core/CardActions";
|
||||||
import CardContent from "@material-ui/core/CardContent";
|
import CardContent from "@material-ui/core/CardContent";
|
||||||
import { createStyles, withStyles, WithStyles } from "@material-ui/core/styles";
|
import { createStyles, withStyles, WithStyles } from "@material-ui/core/styles";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import ControlledSwitch from "@saleor/components/ControlledSwitch";
|
import ControlledSwitch from "@saleor/components/ControlledSwitch";
|
||||||
import FormSpacer from "@saleor/components/FormSpacer";
|
import FormSpacer from "@saleor/components/FormSpacer";
|
||||||
import Hr from "@saleor/components/Hr";
|
import Hr from "@saleor/components/Hr";
|
||||||
import i18n from "../../../i18n";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { FormData } from "../CountryListPage";
|
import { FormData } from "../CountryListPage";
|
||||||
|
|
||||||
interface TaxConfigurationProps {
|
interface TaxConfigurationProps {
|
||||||
|
@ -34,28 +35,38 @@ export const TaxConfiguration = withStyles(styles, {
|
||||||
disabled,
|
disabled,
|
||||||
onChange,
|
onChange,
|
||||||
onTaxFetch
|
onTaxFetch
|
||||||
}: TaxConfigurationProps & WithStyles<typeof styles>) => (
|
}: TaxConfigurationProps & WithStyles<typeof styles>) => {
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<CardTitle title={i18n.t("Configuration")} />
|
<CardTitle title={intl.formatMessage(sectionNames.configuration)} />
|
||||||
<CardContent className={classes.content}>
|
<CardContent className={classes.content}>
|
||||||
<ControlledSwitch
|
<ControlledSwitch
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
name={"includeTax" as keyof FormData}
|
name={"includeTax" as keyof FormData}
|
||||||
label={i18n.t("All products prices are entered with tax included")}
|
label={intl.formatMessage({
|
||||||
|
defaultMessage:
|
||||||
|
"All products prices are entered with tax included"
|
||||||
|
})}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
checked={data.includeTax}
|
checked={data.includeTax}
|
||||||
/>
|
/>
|
||||||
<ControlledSwitch
|
<ControlledSwitch
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
name={"showGross" as keyof FormData}
|
name={"showGross" as keyof FormData}
|
||||||
label={i18n.t("Show gross prices to customers in the storefront")}
|
label={intl.formatMessage({
|
||||||
|
defaultMessage: "Show gross prices to customers in the storefront"
|
||||||
|
})}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
checked={data.showGross}
|
checked={data.showGross}
|
||||||
/>
|
/>
|
||||||
<ControlledSwitch
|
<ControlledSwitch
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
name={"chargeTaxesOnShipping" as keyof FormData}
|
name={"chargeTaxesOnShipping" as keyof FormData}
|
||||||
label={i18n.t("Charge taxes on shipping rates")}
|
label={intl.formatMessage({
|
||||||
|
defaultMessage: "Charge taxes on shipping rates"
|
||||||
|
})}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
checked={data.chargeTaxesOnShipping}
|
checked={data.chargeTaxesOnShipping}
|
||||||
/>
|
/>
|
||||||
|
@ -64,10 +75,14 @@ export const TaxConfiguration = withStyles(styles, {
|
||||||
<Hr />
|
<Hr />
|
||||||
<CardActions>
|
<CardActions>
|
||||||
<Button disabled={disabled} onClick={onTaxFetch} color="primary">
|
<Button disabled={disabled} onClick={onTaxFetch} color="primary">
|
||||||
{i18n.t("Fetch taxes")}
|
<FormattedMessage
|
||||||
|
defaultMessage="Fetch taxes"
|
||||||
|
description="button"
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</CardActions>
|
</CardActions>
|
||||||
</Card>
|
</Card>
|
||||||
)
|
);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
export default TaxConfiguration;
|
export default TaxConfiguration;
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useIntl } from "react-intl";
|
||||||
import { Route, RouteComponentProps, Switch } from "react-router-dom";
|
import { Route, RouteComponentProps, Switch } from "react-router-dom";
|
||||||
|
|
||||||
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { WindowTitle } from "../components/WindowTitle";
|
import { WindowTitle } from "../components/WindowTitle";
|
||||||
import i18n from "../i18n";
|
|
||||||
import { countryListPath, countryTaxRatesPath } from "./urls";
|
import { countryListPath, countryTaxRatesPath } from "./urls";
|
||||||
import CountryList from "./views/CountryList";
|
import CountryList from "./views/CountryList";
|
||||||
import CountryTaxesComponent, {
|
import CountryTaxesComponent, {
|
||||||
|
@ -13,9 +14,12 @@ const CountryTaxes: React.StatelessComponent<
|
||||||
RouteComponentProps<CountryTaxesParams>
|
RouteComponentProps<CountryTaxesParams>
|
||||||
> = ({ match }) => <CountryTaxesComponent code={match.params.code} />;
|
> = ({ match }) => <CountryTaxesComponent code={match.params.code} />;
|
||||||
|
|
||||||
const Component = () => (
|
const Component = () => {
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
|
return (
|
||||||
<>
|
<>
|
||||||
<WindowTitle title={i18n.t("Taxes")} />
|
<WindowTitle title={intl.formatMessage(sectionNames.taxes)} />
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path={countryListPath} component={CountryList} />
|
<Route exact path={countryListPath} component={CountryList} />
|
||||||
<Route
|
<Route
|
||||||
|
@ -26,5 +30,6 @@ const Component = () => (
|
||||||
</Switch>
|
</Switch>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default Component;
|
export default Component;
|
||||||
|
|
Loading…
Reference in a new issue