From 834b60dbe2a396250de437cd92678cd620ae7930 Mon Sep 17 00:00:00 2001 From: Krzysztof Bialoglowicz Date: Fri, 30 Aug 2019 16:15:32 +0200 Subject: [PATCH] Fix translation descriptions --- .../components/PluginInfo/PluginInfo.tsx | 13 ++++------- .../PluginSettings/PluginSettings.tsx | 2 +- .../PluginsDetailsPage/PluginsDetailsPage.tsx | 23 +++++++++++-------- .../components/PluginsList/PluginsList.tsx | 9 ++++---- .../PluginsListPage/PluginsListPage.tsx | 5 +--- src/plugins/views/PluginsDetails.tsx | 2 +- 6 files changed, 25 insertions(+), 29 deletions(-) diff --git a/src/plugins/components/PluginInfo/PluginInfo.tsx b/src/plugins/components/PluginInfo/PluginInfo.tsx index 6a82c79a4..ee93f777e 100644 --- a/src/plugins/components/PluginInfo/PluginInfo.tsx +++ b/src/plugins/components/PluginInfo/PluginInfo.tsx @@ -3,12 +3,13 @@ import CardContent from "@material-ui/core/CardContent"; import Typography from "@material-ui/core/Typography"; import makeStyles from "@material-ui/styles/makeStyles"; import React from "react"; -import { useIntl } from "react-intl"; +import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import ControlledSwitch from "@saleor/components/ControlledSwitch"; import FormSpacer from "@saleor/components/FormSpacer"; import Hr from "@saleor/components/Hr"; +import { commonMessages } from "@saleor/intl"; import { FormData } from "../PluginsDetailsPage"; interface PluginInfoProps { @@ -41,7 +42,7 @@ const PluginInfo: React.StatelessComponent = ({ @@ -55,10 +56,7 @@ const PluginInfo: React.StatelessComponent = ({ {description && ( <> - {intl.formatMessage({ - defaultMessage: "Plugin Description", - description: "plugin description" - })} + {description} @@ -74,8 +72,7 @@ const PluginInfo: React.StatelessComponent = ({ = ({ diff --git a/src/plugins/components/PluginsDetailsPage/PluginsDetailsPage.tsx b/src/plugins/components/PluginsDetailsPage/PluginsDetailsPage.tsx index c1f3cc8c4..0401425b2 100644 --- a/src/plugins/components/PluginsDetailsPage/PluginsDetailsPage.tsx +++ b/src/plugins/components/PluginsDetailsPage/PluginsDetailsPage.tsx @@ -73,24 +73,28 @@ const PluginsDetailsPage: React.StatelessComponent = ({ {intl.formatMessage(sectionNames.plugins)} plugin.name, "")} ${intl.formatMessage({ - defaultMessage: "Details", - description: "plugin page title" - })}`} + title={intl.formatMessage( + { + defaultMessage: "{pluginName} Details", + description: "header" + }, + { + pluginName: maybe(() => plugin.name, "...") + } + )} />
{intl.formatMessage({ defaultMessage: "Plugin Information and Status", - description: "plugin section title" + description: "section header" })} {intl.formatMessage({ defaultMessage: - "These are general information about your store. They define what is the URL of your store and what is shown in brow sers taskbar.", - description: "plugin section description" + "These are general information about your store. They define what is the URL of your store and what is shown in brow sers taskbar." })}
@@ -106,14 +110,13 @@ const PluginsDetailsPage: React.StatelessComponent = ({ {intl.formatMessage({ defaultMessage: "Plugin Settings", - description: "plugin section title" + description: "section header" })} {intl.formatMessage({ defaultMessage: - "This adress will be used to generate invoices and calculate shipping rates. Email adress you provide here will be used as a contact adress for your customers.", - description: "plugin section description" + "This adress will be used to generate invoices and calculate shipping rates. Email adress you provide here will be used as a contact adress for your customers." })} diff --git a/src/plugins/components/PluginsList/PluginsList.tsx b/src/plugins/components/PluginsList/PluginsList.tsx index a3b6c9714..9ab065794 100644 --- a/src/plugins/components/PluginsList/PluginsList.tsx +++ b/src/plugins/components/PluginsList/PluginsList.tsx @@ -73,19 +73,19 @@ const PluginList = withStyles(styles, { name: "PluginList" })( {intl.formatMessage({ defaultMessage: "Name", - description: "plugin list table header" + description: "plugin name" })} {intl.formatMessage({ defaultMessage: "Active", - description: "plugin list table header" + description: "plugin status" })} {intl.formatMessage({ defaultMessage: "Action", - description: "plugin list table header" + description: "user action bar" })} @@ -143,8 +143,7 @@ const PluginList = withStyles(styles, { name: "PluginList" })( {intl.formatMessage({ - defaultMessage: "No plugins found", - description: "plugin no found" + defaultMessage: "No plugins found" })} diff --git a/src/plugins/components/PluginsListPage/PluginsListPage.tsx b/src/plugins/components/PluginsListPage/PluginsListPage.tsx index 7ff0735ad..3d117338e 100644 --- a/src/plugins/components/PluginsListPage/PluginsListPage.tsx +++ b/src/plugins/components/PluginsListPage/PluginsListPage.tsx @@ -29,10 +29,7 @@ const PluginsListPage: React.StatelessComponent = ({ return ( - {intl.formatMessage({ - defaultMessage: "Configuration", - description: "plugin back button" - })} + {intl.formatMessage(sectionNames.configuration)}