Refactor translations in translations section (#131)

This commit is contained in:
Dominik Żegleń 2019-08-26 23:50:08 +02:00 committed by dominik-zeglen
parent 8edd6ee756
commit 1585a5ad28
26 changed files with 1407 additions and 778 deletions

View file

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2019-08-26T21:45:05.243Z\n"
"POT-Creation-Date: 2019-08-26T21:49:04.020Z\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"MIME-Version: 1.0\n"
@ -1139,6 +1139,14 @@ msgctxt "description"
msgid "Attribute Code"
msgstr ""
#: build/locale/src/translations/components/TranslationsProductTypesPage/TranslationsProductTypesPage.json
#. [src.translations.components.TranslationsProductTypesPage.2642976392]
#. defaultMessage is:
#. Attribute Name
msgctxt "description"
msgid "Attribute Name"
msgstr ""
#: build/locale/src/attributes/components/AttributeValues/AttributeValues.json
#. [src.attributes.components.AttributeValues.224159874] - section header
#. defaultMessage is:
@ -1407,6 +1415,14 @@ msgctxt "categories section name"
msgid "Categories"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.json
#. [src.translations.components.TranslationsEntitiesListPage.3583204912]
#. defaultMessage is:
#. Categories
msgctxt "description"
msgid "Categories"
msgstr ""
#: build/locale/src/discounts/components/SaleDetailsPage/SaleDetailsPage.json
#. [saleDetailsPageCategoriesQuantity] - number of categories
#. defaultMessage is:
@ -1455,6 +1471,10 @@ msgstr ""
#. [src.collections.components.CollectionList.1214235329]
#. defaultMessage is:
#. Category Name
#: build/locale/src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.json
#. [src.translations.components.TranslationsCategoriesPage.1214235329]
#. defaultMessage is:
#. Category Name
msgctxt "description"
msgid "Category Name"
msgstr ""
@ -1559,6 +1579,14 @@ msgctxt "voucher code"
msgid "Code"
msgstr ""
#: build/locale/src/translations/components/TranslationsCollectionsPage/TranslationsCollectionsPage.json
#. [src.translations.components.TranslationsCollectionsPage.2759199473]
#. defaultMessage is:
#. Collection Name
msgctxt "description"
msgid "Collection Name"
msgstr ""
#: build/locale/src/discounts/components/DiscountCollections/DiscountCollections.json
#. [src.discounts.components.DiscountCollections.3011396316]
#. defaultMessage is:
@ -1583,6 +1611,10 @@ msgstr ""
#. [src.products.components.ProductOrganization.222873645]
#. defaultMessage is:
#. Collections
#: build/locale/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.json
#. [src.translations.components.TranslationsEntitiesListPage.222873645]
#. defaultMessage is:
#. Collections
msgctxt "description"
msgid "Collections"
msgstr ""
@ -1615,6 +1647,14 @@ msgctxt "description"
msgid "Company information"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesList/TranslationsEntitiesList.json
#. [src.translations.components.TranslationsEntitiesList.49462429]
#. defaultMessage is:
#. Completed Translations
msgctxt "description"
msgid "Completed Translations"
msgstr ""
#: build/locale/src/products/components/ProductOrganization/ProductOrganization.json
#. [src.products.components.ProductOrganization.2754779425] - product is configurable
#. defaultMessage is:
@ -1659,6 +1699,10 @@ msgstr ""
#. [src.pages.components.PageInfo.1116746286] - page content
#. defaultMessage is:
#. Content
#: build/locale/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.json
#. [src.translations.components.TranslationsPagesPage.1116746286] - page content
#. defaultMessage is:
#. Content
msgctxt "page content"
msgid "Content"
msgstr ""
@ -2511,6 +2555,10 @@ msgstr ""
#. [src.description]
#. defaultMessage is:
#. Description
#: build/locale/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.json
#. [src.translations.components.TranslationsProductsPage.3374163063]
#. defaultMessage is:
#. Description
msgctxt "description"
msgid "Description"
msgstr ""
@ -2531,6 +2579,14 @@ msgctxt "product type"
msgid "Digital"
msgstr ""
#: build/locale/src/translations/components/TranslationFields/TranslationFieldsSave.json
#. [src.translations.components.TranslationFields.363646127] - button
#. defaultMessage is:
#. Discard
msgctxt "button"
msgid "Discard"
msgstr ""
#: build/locale/src/home/components/HomeScreen.json
#. [homeScreenDisclaimer] - header
#. defaultMessage is:
@ -3135,6 +3191,26 @@ msgctxt "authentication provider API key"
msgid "Key"
msgstr ""
#: build/locale/src/translations/components/TranslationsLanguageList/TranslationsLanguageList.json
#. [src.translations.components.TranslationsLanguageList.604081953]
#. defaultMessage is:
#. Language
msgctxt "description"
msgid "Language"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.json
#. [src.translations.components.TranslationsEntitiesListPage.1163855804]
#. defaultMessage is:
#. Languages
#: build/locale/src/translations/components/TranslationsLanguageListPage/TranslationsLanguageListPage.json
#. [src.translations.components.TranslationsLanguageListPage.1163855804]
#. defaultMessage is:
#. Languages
msgctxt "description"
msgid "Languages"
msgstr ""
#: build/locale/src/orders/components/OrderListFilter/OrderListFilter.json
#. [src.orders.components.OrderListFilter.714411029]
#. defaultMessage is:
@ -3487,6 +3563,14 @@ msgctxt "staff member full name"
msgid "Name"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesList/TranslationsEntitiesList.json
#. [src.translations.components.TranslationsEntitiesList.636461959] - entity (product, collection, shipping method) name
#. defaultMessage is:
#. Name
msgctxt "entity (product, collection, shipping method) name"
msgid "Name"
msgstr ""
#: build/locale/src/siteSettings/components/SiteSettingsDetails/SiteSettingsDetails.json
#. [src.siteSettings.components.SiteSettingsDetails.2286355060]
#. defaultMessage is:
@ -3627,6 +3711,14 @@ msgctxt "no authentication provider API keys"
msgid "No keys"
msgstr ""
#: build/locale/src/translations/components/TranslationsLanguageList/TranslationsLanguageList.json
#. [src.translations.components.TranslationsLanguageList.2966651157]
#. defaultMessage is:
#. No languages found
msgctxt "description"
msgid "No languages found"
msgstr ""
#: build/locale/src/navigation/components/MenuList/MenuList.json
#. [menuListNoMenus]
#. defaultMessage is:
@ -3787,6 +3879,30 @@ msgctxt "description"
msgid "No subcategories found"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesList/TranslationsEntitiesList.json
#. [src.translations.components.TranslationsEntitiesList.4176487406]
#. defaultMessage is:
#. No translatable entities found
msgctxt "description"
msgid "No translatable entities found"
msgstr ""
#: build/locale/src/translations/components/TranslationFields/TranslationFieldsLong.json
#. [src.translations.components.TranslationFields.3793796047]
#. defaultMessage is:
#. No translation yet
#: build/locale/src/translations/components/TranslationFields/TranslationFieldsRich.json
#. [src.translations.components.TranslationFields.3793796047]
#. defaultMessage is:
#. No translation yet
#: build/locale/src/translations/components/TranslationFields/TranslationFieldsShort.json
#. [src.translations.components.TranslationFields.3793796047]
#. defaultMessage is:
#. No translation yet
msgctxt "description"
msgid "No translation yet"
msgstr ""
#: build/locale/src/orders/components/OrderDraftFinalizeDialog/OrderDraftFinalizeDialog.json
#. [src.orders.components.OrderDraftFinalizeDialog.1297434244]
#. defaultMessage is:
@ -4155,6 +4271,14 @@ msgctxt "section header"
msgid "Organize Product"
msgstr ""
#: build/locale/src/translations/components/TranslationFields/TranslationFields.json
#. [src.translations.components.TranslationFields.1348655672]
#. defaultMessage is:
#. Original String
msgctxt "description"
msgid "Original String"
msgstr ""
#: build/locale/src/products/components/ProductListFilter/ProductListFilter.json
#. [src.products.components.ProductListFilter.1640493122] - product status
#. defaultMessage is:
@ -4179,6 +4303,14 @@ msgctxt "order history message"
msgid "Oversold {quantity} items"
msgstr ""
#: build/locale/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.json
#. [src.translations.components.TranslationsPagesPage.432157284]
#. defaultMessage is:
#. Page Title
msgctxt "description"
msgid "Page Title"
msgstr ""
#: build/locale/src/intl.json
#. [src.pages] - pages section name
#. defaultMessage is:
@ -4187,6 +4319,14 @@ msgctxt "pages section name"
msgid "Pages"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.json
#. [src.translations.components.TranslationsEntitiesListPage.3287512325]
#. defaultMessage is:
#. Pages
msgctxt "description"
msgid "Pages"
msgstr ""
#: build/locale/src/orders/components/OrderListFilter/OrderListFilter.json
#. [src.orders.components.OrderListFilter.210276526] - order fulfillment status
#. defaultMessage is:
@ -4471,6 +4611,14 @@ msgctxt "product name"
msgid "Product"
msgstr ""
#: build/locale/src/translations/components/TranslationsProductTypesPage/TranslationsProductTypesPage.json
#. [src.translations.components.TranslationsProductTypesPage.2510190956] - header
#. defaultMessage is:
#. Product Attribute ({attributeName})
msgctxt "header"
msgid "Product Attribute ({attributeName})"
msgstr ""
#: build/locale/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.json
#. [src.productTypes.components.ProductTypeAttributes.3559259966] - section header
#. defaultMessage is:
@ -4483,6 +4631,10 @@ msgstr ""
#. [src.discounts.components.DiscountProducts.2697405188]
#. defaultMessage is:
#. Product Name
#: build/locale/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.json
#. [src.translations.components.TranslationsProductsPage.2697405188]
#. defaultMessage is:
#. Product Name
msgctxt "description"
msgid "Product Name"
msgstr ""
@ -4515,6 +4667,14 @@ msgctxt "product types section name"
msgid "Product Types"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.json
#. [src.translations.components.TranslationsEntitiesListPage.765385638]
#. defaultMessage is:
#. Product Types
msgctxt "description"
msgid "Product Types"
msgstr ""
#: build/locale/src/products/views/ProductCreate.json
#. [src.products.views.2899821092]
#. defaultMessage is:
@ -4587,6 +4747,14 @@ msgctxt "products section name"
msgid "Products"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.json
#. [src.translations.components.TranslationsEntitiesListPage.2968663655]
#. defaultMessage is:
#. Products
msgctxt "description"
msgid "Products"
msgstr ""
#: build/locale/src/discounts/components/SaleDetailsPage/SaleDetailsPage.json
#. [saleDetailsPageProductsQuantity] - number of products
#. defaultMessage is:
@ -4999,6 +5167,14 @@ msgctxt "variant sku"
msgid "SKU {sku}"
msgstr ""
#: build/locale/src/translations/components/TranslationsSalesPage/TranslationsSalesPage.json
#. [src.translations.components.TranslationsSalesPage.898281424]
#. defaultMessage is:
#. Sale Name
msgctxt "description"
msgid "Sale Name"
msgstr ""
#: build/locale/src/intl.json
#. [src.sales] - sales section name
#. defaultMessage is:
@ -5007,6 +5183,14 @@ msgctxt "sales section name"
msgid "Sales"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.json
#. [src.translations.components.TranslationsEntitiesListPage.487083593]
#. defaultMessage is:
#. Sales
msgctxt "description"
msgid "Sales"
msgstr ""
#: build/locale/src/orders/components/OrderCustomer/OrderCustomer.json
#. [src.orders.components.OrderCustomer.3912924864] - billing address
#. defaultMessage is:
@ -5063,6 +5247,66 @@ msgctxt "description"
msgid "Search Customers"
msgstr ""
#: build/locale/src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.json
#. [src.translations.components.TranslationsCategoriesPage.1406947243]
#. defaultMessage is:
#. Search Engine Description
#: build/locale/src/translations/components/TranslationsCollectionsPage/TranslationsCollectionsPage.json
#. [src.translations.components.TranslationsCollectionsPage.1406947243]
#. defaultMessage is:
#. Search Engine Description
#: build/locale/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.json
#. [src.translations.components.TranslationsPagesPage.1406947243]
#. defaultMessage is:
#. Search Engine Description
#: build/locale/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.json
#. [src.translations.components.TranslationsProductsPage.1406947243]
#. defaultMessage is:
#. Search Engine Description
msgctxt "description"
msgid "Search Engine Description"
msgstr ""
#: build/locale/src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.json
#. [src.translations.components.TranslationsCategoriesPage.3468022343]
#. defaultMessage is:
#. Search Engine Preview
#: build/locale/src/translations/components/TranslationsCollectionsPage/TranslationsCollectionsPage.json
#. [src.translations.components.TranslationsCollectionsPage.3468022343]
#. defaultMessage is:
#. Search Engine Preview
#: build/locale/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.json
#. [src.translations.components.TranslationsPagesPage.3468022343]
#. defaultMessage is:
#. Search Engine Preview
#: build/locale/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.json
#. [src.translations.components.TranslationsProductsPage.3468022343]
#. defaultMessage is:
#. Search Engine Preview
msgctxt "description"
msgid "Search Engine Preview"
msgstr ""
#: build/locale/src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.json
#. [src.translations.components.TranslationsCategoriesPage.2496919463]
#. defaultMessage is:
#. Search Engine Title
#: build/locale/src/translations/components/TranslationsCollectionsPage/TranslationsCollectionsPage.json
#. [src.translations.components.TranslationsCollectionsPage.2496919463]
#. defaultMessage is:
#. Search Engine Title
#: build/locale/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.json
#. [src.translations.components.TranslationsPagesPage.2496919463]
#. defaultMessage is:
#. Search Engine Title
#: build/locale/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.json
#. [src.translations.components.TranslationsProductsPage.2496919463]
#. defaultMessage is:
#. Search Engine Title
msgctxt "description"
msgid "Search Engine Title"
msgstr ""
#: build/locale/src/orders/components/OrderListPage/OrderListPage.json
#. [src.orders.components.OrderListPage.355376157]
#. defaultMessage is:
@ -5943,6 +6187,102 @@ msgctxt "description"
msgid "Tracking number"
msgstr ""
#: build/locale/src/translations/components/TranslationFields/TranslationFields.json
#. [src.translations.components.TranslationFields.2481190613] - Translated Name
#. defaultMessage is:
#. Translation
msgctxt "Translated Name"
msgid "Translation"
msgstr ""
#: build/locale/src/translations/components/TranslationFields/TranslationFieldsLong.json
#. [src.translations.components.TranslationFields.2481190613]
#. defaultMessage is:
#. Translation
#: build/locale/src/translations/components/TranslationFields/TranslationFieldsRich.json
#. [src.translations.components.TranslationFields.2481190613]
#. defaultMessage is:
#. Translation
#: build/locale/src/translations/components/TranslationFields/TranslationFieldsShort.json
#. [src.translations.components.TranslationFields.2481190613]
#. defaultMessage is:
#. Translation
msgctxt "description"
msgid "Translation"
msgstr ""
#: build/locale/src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.json
#. [src.translations.components.TranslationsCategoriesPage.2043581404]
#. defaultMessage is:
#. Translation Category "{categoryNane}" - {languageCode}
msgctxt "description"
msgid "Translation Category \"{categoryNane}\" - {languageCode}"
msgstr ""
#: build/locale/src/translations/components/TranslationsCollectionsPage/TranslationsCollectionsPage.json
#. [src.translations.components.TranslationsCollectionsPage.3055443821] - header
#. defaultMessage is:
#. Translation Collection "{collectionName}" - {languageCode}
msgctxt "header"
msgid "Translation Collection \"{collectionName}\" - {languageCode}"
msgstr ""
#: build/locale/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.json
#. [src.translations.components.TranslationsPagesPage.2806429775] - header
#. defaultMessage is:
#. Translation Page "{pageName}" - {languageCode}
msgctxt "header"
msgid "Translation Page \"{pageName}\" - {languageCode}"
msgstr ""
#: build/locale/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.json
#. [src.translations.components.TranslationsProductsPage.2713974050] - header
#. defaultMessage is:
#. Translation Product "{productName}" - {languageCode}
msgctxt "header"
msgid "Translation Product \"{productName}\" - {languageCode}"
msgstr ""
#: build/locale/src/translations/components/TranslationsProductTypesPage/TranslationsProductTypesPage.json
#. [src.translations.components.TranslationsProductTypesPage.1281101905] - header
#. defaultMessage is:
#. Translation Product Type "{productTypeName}" - {languageCode}
msgctxt "header"
msgid "Translation Product Type \"{productTypeName}\" - {languageCode}"
msgstr ""
#: build/locale/src/translations/components/TranslationsSalesPage/TranslationsSalesPage.json
#. [src.translations.components.TranslationsSalesPage.3731955064] - header
#. defaultMessage is:
#. Translation Sale "{saleName}" - {languageCode}
msgctxt "header"
msgid "Translation Sale \"{saleName}\" - {languageCode}"
msgstr ""
#: build/locale/src/translations/components/TranslationsVouchersPage/TranslationsVouchersPage.json
#. [src.translations.components.TranslationsVouchersPage.2447510181] - header
#. defaultMessage is:
#. Translation Voucher "{voucherName}" - {languageCode}
msgctxt "header"
msgid "Translation Voucher \"{voucherName}\" - {languageCode}"
msgstr ""
#: build/locale/src/intl.json
#. [src.translations] - translations section name
#. defaultMessage is:
#. Translations
msgctxt "translations section name"
msgid "Translations"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.json
#. [src.translations.components.TranslationsEntitiesListPage.2460580333] - header
#. defaultMessage is:
#. Translations to {language}
msgctxt "header"
msgid "Translations to {language}"
msgstr ""
#: build/locale/src/categories/components/CategoryProducts/CategoryProducts.json
#. [src.categories.components.CategoryProducts.1952810469] - product type
#. defaultMessage is:
@ -6407,6 +6747,14 @@ msgctxt "order price range"
msgid "Value range"
msgstr ""
#: build/locale/src/translations/components/TranslationsProductTypesPage/TranslationsProductTypesPage.json
#. [src.translations.components.TranslationsProductTypesPage.1567737068] - attribute values
#. defaultMessage is:
#. Value {number}
msgctxt "attribute values"
msgid "Value {number}"
msgstr ""
#: build/locale/src/products/components/ProductAttributes/ProductAttributes.json
#. [src.products.components.ProductAttributes.1207761269] - attribute values
#. defaultMessage is:
@ -6415,6 +6763,14 @@ msgctxt "attribute values"
msgid "Values"
msgstr ""
#: build/locale/src/translations/components/TranslationsProductTypesPage/TranslationsProductTypesPage.json
#. [src.translations.components.TranslationsProductTypesPage.3538502409] - header
#. defaultMessage is:
#. Variant Attribute ({attributeName})
msgctxt "header"
msgid "Variant Attribute ({attributeName})"
msgstr ""
#: build/locale/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.json
#. [src.productTypes.components.ProductTypeAttributes.888493112] - section header
#. defaultMessage is:
@ -6523,6 +6879,14 @@ msgctxt "dialog header"
msgid "Void Payment"
msgstr ""
#: build/locale/src/translations/components/TranslationsVouchersPage/TranslationsVouchersPage.json
#. [src.translations.components.TranslationsVouchersPage.2599922713]
#. defaultMessage is:
#. Voucher Name
msgctxt "description"
msgid "Voucher Name"
msgstr ""
#: build/locale/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.json
#. [src.discounts.components.VoucherDetailsPage.2071139683]
#. defaultMessage is:
@ -6547,6 +6911,14 @@ msgctxt "vouchers section name"
msgid "Vouchers"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.json
#. [src.translations.components.TranslationsEntitiesListPage.749185240]
#. defaultMessage is:
#. Vouchers
msgctxt "description"
msgid "Vouchers"
msgstr ""
#: build/locale/src/productTypes/components/ProductTypeShipping/ProductTypeShipping.json
#. [src.productTypes.components.ProductTypeShipping.746695941]
#. defaultMessage is:
@ -6675,6 +7047,14 @@ msgctxt "description"
msgid "{amount,plural,one{One product} other{{amount} Products}} out of stock"
msgstr ""
#: build/locale/src/translations/components/TranslationsEntitiesList/TranslationsEntitiesList.json
#. [src.translations.components.TranslationsEntitiesList.1136143456] - translation progress
#. defaultMessage is:
#. {current} of {max}
msgctxt "translation progress"
msgid "{current} of {max}"
msgstr ""
#: build/locale/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.json
#. [src.customers.components.CustomerAddressListPage.489918044] - customer details, header
#. defaultMessage is:
@ -6691,6 +7071,14 @@ msgctxt "customer's address book, header"
msgid "{fullName}'s Address Book"
msgstr ""
#: build/locale/src/translations/components/TranslationFields/TranslationFields.json
#. [src.translations.components.TranslationFields.282734765]
#. defaultMessage is:
#. {numberOFields} Translations, {numberOfTranslatedFields} Completed
msgctxt "description"
msgid "{numberOFields} Translations, {numberOfTranslatedFields} Completed"
msgstr ""
#: build/locale/src/products/components/ProductAttributes/ProductAttributes.json
#. [src.products.components.ProductAttributes.1071548120] - number of product attributes
#. defaultMessage is:

View file

@ -157,6 +157,10 @@ export const sectionNames = defineMessages({
defaultMessage: "Taxes",
description: "taxes section name"
},
translations: {
defaultMessage: "Translations",
description: "translations section name"
},
vouchers: {
defaultMessage: "Vouchers",
description: "vouchers section name"

View file

@ -17,7 +17,9 @@ import Hr from "@saleor/components/Hr";
import Skeleton from "@saleor/components/Skeleton";
import classNames from "classnames";
import React from "react";
import i18n from "../../../i18n";
import { FormattedMessage } from "react-intl";
import { buttonMessages } from "@saleor/intl";
import TranslationFieldsLong from "./TranslationFieldsLong";
import TranslationFieldsRich from "./TranslationFieldsRich";
import TranslationFieldsShort from "./TranslationFieldsShort";
@ -138,12 +140,13 @@ const TranslationFields = withStyles(styles, { name: "TranslationFields" })(
<CardContent className={classes.cardContent}>
<Grid className={classes.grid} variant="uniform">
<Typography className={classes.columnHeader} variant="body2">
{i18n.t("Original String")}
<FormattedMessage defaultMessage="Original String" />
</Typography>
<Typography className={classes.columnHeader} variant="body2">
{i18n.t("Translation", {
context: "translation to language"
})}
<FormattedMessage
defaultMessage="Translation"
description="Translated Name"
/>
</Typography>
{fields.map(field => (
<React.Fragment key={field.name}>
@ -153,7 +156,7 @@ const TranslationFields = withStyles(styles, { name: "TranslationFields" })(
</Typography>
<div className={classes.editButtonContainer}>
<Button color="primary" onClick={() => onEdit(field.name)}>
{i18n.t("Edit")}
<FormattedMessage {...buttonMessages.edit} />
</Button>
</div>
<div className={classes.content}>
@ -231,16 +234,16 @@ const TranslationFields = withStyles(styles, { name: "TranslationFields" })(
) : (
<CardContent>
<Typography className={classes.cardCaption} variant="caption">
{i18n.t(
"{{ fieldQuantity }} Translations, {{ translatedFieldQuantity }} Completed",
{
fieldQuantity: fields.length,
translatedFieldQuantity: fields.reduce(
<FormattedMessage
defaultMessage="{numberOFields} Translations, {numberOfTranslatedFields} Completed"
values={{
numberOfFields: fields.length,
numberOfTranslatedFields: fields.reduce(
(acc, field) => acc + +(field.translation !== null),
0
)
}
)}
}}
/>
</Typography>
</CardContent>
)}

View file

@ -1,10 +1,10 @@
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 { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
import Form from "@saleor/components/Form";
import i18n from "../../../i18n";
import TranslationFieldsSave from "./TranslationFieldsSave";
interface TranslationFieldsLongProps {
@ -23,8 +23,10 @@ const TranslationFieldsLong: React.FC<TranslationFieldsLongProps> = ({
saveButtonState,
onDiscard,
onSubmit
}) =>
edit ? (
}) => {
const intl = useIntl();
return edit ? (
<Form
initial={{ translation: initial }}
onSubmit={data => onSubmit(data.translation)}
@ -35,7 +37,9 @@ const TranslationFieldsLong: React.FC<TranslationFieldsLongProps> = ({
disabled={disabled}
fullWidth
multiline
label={i18n.t("Translation")}
label={intl.formatMessage({
defaultMessage: "Translation"
})}
name="translation"
value={data.translation}
onChange={change}
@ -50,10 +54,11 @@ const TranslationFieldsLong: React.FC<TranslationFieldsLongProps> = ({
</Form>
) : initial === null ? (
<Typography color="textSecondary">
{i18n.t("No translation yet")}
<FormattedMessage defaultMessage="No translation yet" />
</Typography>
) : (
<Typography>{initial}</Typography>
);
};
TranslationFieldsLong.displayName = "TranslationFieldsLong";
export default TranslationFieldsLong;

View file

@ -1,11 +1,11 @@
import Typography from "@material-ui/core/Typography";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
import DraftRenderer from "@saleor/components/DraftRenderer";
import Form from "@saleor/components/Form";
import RichTextEditor from "@saleor/components/RichTextEditor";
import i18n from "../../../i18n";
import TranslationFieldsSave from "./TranslationFieldsSave";
interface TranslationFieldsRichProps {
@ -24,8 +24,10 @@ const TranslationFieldsRich: React.FC<TranslationFieldsRichProps> = ({
saveButtonState,
onDiscard,
onSubmit
}) =>
edit ? (
}) => {
const intl = useIntl();
return edit ? (
<Form
initial={{ translation: initial }}
onSubmit={data => onSubmit(data.translation)}
@ -37,7 +39,9 @@ const TranslationFieldsRich: React.FC<TranslationFieldsRichProps> = ({
error={undefined}
helperText={undefined}
initial={JSON.parse(initial)}
label={i18n.t("Translation")}
label={intl.formatMessage({
defaultMessage: "Translation"
})}
name="translation"
onChange={change}
/>
@ -51,12 +55,13 @@ const TranslationFieldsRich: React.FC<TranslationFieldsRichProps> = ({
</Form>
) : initial === null ? (
<Typography color="textSecondary">
{i18n.t("No translation yet")}
<FormattedMessage defaultMessage="No translation yet" />
</Typography>
) : (
<Typography>
<DraftRenderer content={JSON.parse(initial)} />
</Typography>
);
};
TranslationFieldsRich.displayName = "TranslationFieldsRich";
export default TranslationFieldsRich;

View file

@ -6,11 +6,12 @@ import {
WithStyles
} from "@material-ui/core/styles";
import React from "react";
import { FormattedMessage } from "react-intl";
import ConfirmButton, {
ConfirmButtonTransitionState
} from "@saleor/components/ConfirmButton";
import i18n from "../../../i18n";
import { buttonMessages } from "@saleor/intl";
interface TranslationFieldsSaveProps {
saveButtonState: ConfirmButtonTransitionState;
@ -45,9 +46,11 @@ const TranslationFieldsSave = withStyles(styles, {
transitionState={saveButtonState}
onClick={onSave}
>
{i18n.t("Save")}
<FormattedMessage {...buttonMessages.save} />
</ConfirmButton>
<Button onClick={onDiscard}>{i18n.t("Discard")}</Button>
<Button onClick={onDiscard}>
<FormattedMessage defaultMessage="Discard" description="button" />
</Button>
</div>
)
);

View file

@ -1,10 +1,10 @@
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 { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
import Form from "@saleor/components/Form";
import i18n from "../../../i18n";
import TranslationFieldsSave from "./TranslationFieldsSave";
interface TranslationFieldsShortProps {
@ -23,8 +23,10 @@ const TranslationFieldsShort: React.FC<TranslationFieldsShortProps> = ({
saveButtonState,
onDiscard,
onSubmit
}) =>
edit ? (
}) => {
const intl = useIntl();
return edit ? (
<Form
initial={{ translation: initial }}
onSubmit={data => onSubmit(data.translation)}
@ -34,7 +36,9 @@ const TranslationFieldsShort: React.FC<TranslationFieldsShortProps> = ({
<TextField
disabled={disabled}
fullWidth
label={i18n.t("Translation")}
label={intl.formatMessage({
defaultMessage: "Translation"
})}
name="translation"
value={data.translation}
onChange={change}
@ -49,10 +53,11 @@ const TranslationFieldsShort: React.FC<TranslationFieldsShortProps> = ({
</Form>
) : initial === null ? (
<Typography color="textSecondary">
{i18n.t("No translation yet")}
<FormattedMessage defaultMessage="No translation yet" />
</Typography>
) : (
<Typography>{initial}</Typography>
);
};
TranslationFieldsShort.displayName = "TranslationFieldsShort";
export default TranslationFieldsShort;

View file

@ -1,11 +1,12 @@
import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader";
import CardSpacer from "@saleor/components/CardSpacer";
import Container from "@saleor/components/Container";
import LanguageSwitch from "@saleor/components/LanguageSwitch";
import PageHeader from "@saleor/components/PageHeader";
import i18n from "../../../i18n";
import { commonMessages, sectionNames } from "@saleor/intl";
import { maybe } from "../../../misc";
import { LanguageCodeEnum } from "../../../types/globalTypes";
import { CategoryTranslationFragment } from "../../types/CategoryTranslationFragment";
@ -38,15 +39,22 @@ const TranslationsCategoriesPage: React.StatelessComponent<
onEdit,
onLanguageChange,
onSubmit
}) => (
}) => {
const intl = useIntl();
return (
<Container>
<AppHeader onBack={onBack}>{i18n.t("Translations")}</AppHeader>
<AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.translations)}
</AppHeader>
<PageHeader
title={i18n.t(
'Translation Category "{{ categoryName }}" - {{ languageCode }}',
title={intl.formatMessage(
{
defaultMessage:
'Translation Category "{categoryNane}" - {languageCode}'
},
{
categoryName: maybe(() => category.name, "..."),
context: "category translation page title",
languageCode
}
)}
@ -61,10 +69,12 @@ const TranslationsCategoriesPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("General Information")}
title={intl.formatMessage(commonMessages.generalInformations)}
fields={[
{
displayName: i18n.t("Category Name"),
displayName: intl.formatMessage({
defaultMessage: "Category Name"
}),
name: fieldNames.name,
translation: maybe(() =>
category.translation ? category.translation.name : null
@ -73,7 +83,7 @@ const TranslationsCategoriesPage: React.StatelessComponent<
value: maybe(() => category.name)
},
{
displayName: i18n.t("Description"),
displayName: intl.formatMessage(commonMessages.description),
name: fieldNames.descriptionJson,
translation: maybe(() =>
category.translation ? category.translation.descriptionJson : null
@ -92,10 +102,14 @@ const TranslationsCategoriesPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("Search Engine Preview")}
title={intl.formatMessage({
defaultMessage: "Search Engine Preview"
})}
fields={[
{
displayName: i18n.t("Search Engine Title"),
displayName: intl.formatMessage({
defaultMessage: "Search Engine Title"
}),
name: fieldNames.seoTitle,
translation: maybe(() =>
category.translation ? category.translation.seoTitle : null
@ -104,7 +118,9 @@ const TranslationsCategoriesPage: React.StatelessComponent<
value: maybe(() => category.seoTitle)
},
{
displayName: i18n.t("Search Engine Description"),
displayName: intl.formatMessage({
defaultMessage: "Search Engine Description"
}),
name: fieldNames.seoDescription,
translation: maybe(() =>
category.translation ? category.translation.seoDescription : null
@ -119,6 +135,7 @@ const TranslationsCategoriesPage: React.StatelessComponent<
onSubmit={onSubmit}
/>
</Container>
);
);
};
TranslationsCategoriesPage.displayName = "TranslationsCategoriesPage";
export default TranslationsCategoriesPage;

View file

@ -1,11 +1,12 @@
import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader";
import CardSpacer from "@saleor/components/CardSpacer";
import Container from "@saleor/components/Container";
import LanguageSwitch from "@saleor/components/LanguageSwitch";
import PageHeader from "@saleor/components/PageHeader";
import i18n from "../../../i18n";
import { commonMessages, sectionNames } from "@saleor/intl";
import { maybe } from "../../../misc";
import { LanguageCodeEnum } from "../../../types/globalTypes";
import { CollectionTranslationFragment } from "../../types/CollectionTranslationFragment";
@ -38,15 +39,23 @@ const TranslationsCollectionsPage: React.StatelessComponent<
onEdit,
onLanguageChange,
onSubmit
}) => (
}) => {
const intl = useIntl();
return (
<Container>
<AppHeader onBack={onBack}>{i18n.t("Translations")}</AppHeader>
<AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.translations)}
</AppHeader>
<PageHeader
title={i18n.t(
'Translation Collection "{{ collectionName }}" - {{ languageCode }}',
title={intl.formatMessage(
{
defaultMessage:
'Translation Collection "{collectionName}" - {languageCode}',
description: "header"
},
{
collectionName: maybe(() => collection.name, "..."),
context: "collection translation page title",
languageCode
}
)}
@ -61,10 +70,12 @@ const TranslationsCollectionsPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("General Information")}
title={intl.formatMessage(commonMessages.generalInformations)}
fields={[
{
displayName: i18n.t("Collection Name"),
displayName: intl.formatMessage({
defaultMessage: "Collection Name"
}),
name: fieldNames.name,
translation: maybe(() =>
collection.translation ? collection.translation.name : null
@ -73,7 +84,7 @@ const TranslationsCollectionsPage: React.StatelessComponent<
value: maybe(() => collection.name)
},
{
displayName: i18n.t("Description"),
displayName: intl.formatMessage(commonMessages.description),
name: fieldNames.descriptionJson,
translation: maybe(() =>
collection.translation
@ -94,10 +105,14 @@ const TranslationsCollectionsPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("Search Engine Preview")}
title={intl.formatMessage({
defaultMessage: "Search Engine Preview"
})}
fields={[
{
displayName: i18n.t("Search Engine Title"),
displayName: intl.formatMessage({
defaultMessage: "Search Engine Title"
}),
name: fieldNames.seoTitle,
translation: maybe(() =>
collection.translation ? collection.translation.seoTitle : null
@ -106,7 +121,9 @@ const TranslationsCollectionsPage: React.StatelessComponent<
value: maybe(() => collection.seoTitle)
},
{
displayName: i18n.t("Search Engine Description"),
displayName: intl.formatMessage({
defaultMessage: "Search Engine Description"
}),
name: fieldNames.seoDescription,
translation: maybe(() =>
collection.translation
@ -123,6 +140,7 @@ const TranslationsCollectionsPage: React.StatelessComponent<
onSubmit={onSubmit}
/>
</Container>
);
);
};
TranslationsCollectionsPage.displayName = "TranslationsCollectionsPage";
export default TranslationsCollectionsPage;

View file

@ -8,11 +8,12 @@ import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
import classNames from "classnames";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import { ListProps } from "../../../types";
import Skeleton from "@saleor/components/Skeleton";
import TablePagination from "@saleor/components/TablePagination";
import i18n from "../../../i18n";
import { maybe, renderCollection } from "../../../misc";
export interface TranslatableEntity {
@ -52,17 +53,21 @@ const TranslationsEntitiesList = withStyles(styles, {
onPreviousPage,
onRowClick,
pageInfo
}: TranslationsEntitiesListProps & WithStyles<typeof styles>) => (
}: TranslationsEntitiesListProps & WithStyles<typeof styles>) => {
const intl = useIntl();
return (
<Table>
<TableHead>
<TableRow>
<TableCell className={classes.wideColumn}>
{i18n.t("Name", { context: "table header" })}
<FormattedMessage
defaultMessage="Name"
description="entity (product, collection, shipping method) name"
/>
</TableCell>
<TableCell className={classes.textRight}>
{i18n.t("Completed Translations", {
context: "table header"
})}
<FormattedMessage defaultMessage="Completed Translations" />
</TableCell>
</TableRow>
</TableHead>
@ -99,10 +104,13 @@ const TranslationsEntitiesList = withStyles(styles, {
<TableCell className={classes.textRight}>
{maybe<React.ReactNode>(
() =>
i18n.t("{{ current }} of {{ max }}", {
context: "translation progress",
...entity.completion
}),
intl.formatMessage(
{
defaultMessage: "{current} of {max}",
description: "translation progress"
},
entity.completion
),
<Skeleton />
)}
</TableCell>
@ -111,14 +119,15 @@ const TranslationsEntitiesList = withStyles(styles, {
() => (
<TableRow>
<TableCell colSpan={2}>
{i18n.t("No translatable entities found")}
<FormattedMessage defaultMessage="No translatable entities found" />
</TableCell>
</TableRow>
)
)}
</TableBody>
</Table>
)
);
}
);
TranslationsEntitiesList.displayName = "TranslationsEntitiesList";
export default TranslationsEntitiesList;

View file

@ -1,5 +1,6 @@
import Card from "@material-ui/core/Card";
import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader";
import Container from "@saleor/components/Container";
@ -7,8 +8,7 @@ import PageHeader from "@saleor/components/PageHeader";
// tslint:disable no-submodule-imports
import { ShopInfo_shop_languages } from "@saleor/components/Shop/types/ShopInfo";
import FilterTabs, { FilterTab } from "@saleor/components/TableFilter";
import i18n from "../../../i18n";
import { maybe } from "../../../misc";
import { maybe } from "@saleor/misc";
import { TranslatableEntities } from "../../urls";
export interface TranslationsEntitiesListPageProps {
@ -33,14 +33,26 @@ export type TranslationsEntitiesListFilterTab = keyof typeof TranslatableEntitie
const TranslationsEntitiesListPage: React.StatelessComponent<
TranslationsEntitiesListPageProps
> = ({ filters, language, onBack, children }) => (
> = ({ filters, language, onBack, children }) => {
const intl = useIntl();
return (
<Container>
<AppHeader onBack={onBack}>{i18n.t("Languages")}</AppHeader>
<PageHeader
title={i18n.t("Translations to {{ language }}", {
context: "object translation page header",
language: maybe(() => language.language, "...")
<AppHeader onBack={onBack}>
{intl.formatMessage({
defaultMessage: "Languages"
})}
</AppHeader>
<PageHeader
title={intl.formatMessage(
{
defaultMessage: "Translations to {language}",
description: "header"
},
{
language: maybe(() => language.language, "...")
}
)}
/>
<Card>
<FilterTabs
@ -55,31 +67,52 @@ const TranslationsEntitiesListPage: React.StatelessComponent<
] as TranslationsEntitiesListFilterTab[]).indexOf(filters.current)}
>
<FilterTab
label={i18n.t("Categories")}
label={intl.formatMessage({
defaultMessage: "Categories"
})}
onClick={filters.onCategoriesTabClick}
/>
<FilterTab
label={i18n.t("Collections")}
label={intl.formatMessage({
defaultMessage: "Collections"
})}
onClick={filters.onCollectionsTabClick}
/>
<FilterTab
label={i18n.t("Products")}
label={intl.formatMessage({
defaultMessage: "Products"
})}
onClick={filters.onProductsTabClick}
/>
<FilterTab label={i18n.t("Sales")} onClick={filters.onSalesTabClick} />
<FilterTab
label={i18n.t("Vouchers")}
label={intl.formatMessage({
defaultMessage: "Sales"
})}
onClick={filters.onSalesTabClick}
/>
<FilterTab
label={intl.formatMessage({
defaultMessage: "Vouchers"
})}
onClick={filters.onVouchersTabClick}
/>
<FilterTab label={i18n.t("Pages")} onClick={filters.onPagesTabClick} />
<FilterTab
label={i18n.t("Product Types")}
label={intl.formatMessage({
defaultMessage: "Pages"
})}
onClick={filters.onPagesTabClick}
/>
<FilterTab
label={intl.formatMessage({
defaultMessage: "Product Types"
})}
onClick={filters.onProductTypesTabClick}
/>
</FilterTabs>
{children}
</Card>
</Container>
);
);
};
TranslationsEntitiesListPage.displayName = "TranslationsEntitiesListPage";
export default TranslationsEntitiesListPage;

View file

@ -6,11 +6,11 @@ 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 } from "react-intl";
// tslint:disable no-submodule-imports
import { ShopInfo_shop_languages } from "@saleor/components/Shop/types/ShopInfo";
import Skeleton from "@saleor/components/Skeleton";
import i18n from "../../../i18n";
import { maybe, renderCollection } from "../../../misc";
export interface TranslationsLanguageListProps {
@ -40,7 +40,7 @@ const TranslationsLanguageList = withStyles(styles, {
<TableHead>
<TableRow>
<TableCell>
{i18n.t("Language", { context: "table header" })}
<FormattedMessage defaultMessage="Language" />
</TableCell>
</TableRow>
</TableHead>
@ -65,7 +65,7 @@ const TranslationsLanguageList = withStyles(styles, {
() => (
<TableRow>
<TableCell colSpan={1}>
{i18n.t("No languages found")}
<FormattedMessage defaultMessage="No languages found" />
</TableCell>
</TableRow>
)

View file

@ -1,12 +1,12 @@
// import Button from "@material-ui/core/Button";
// import AddIcon from "@material-ui/icons/Add";
import React from "react";
import { useIntl } from "react-intl";
import Container from "@saleor/components/Container";
import PageHeader from "@saleor/components/PageHeader";
// tslint:disable no-submodule-imports
import { ShopInfo_shop_languages } from "@saleor/components/Shop/types/ShopInfo";
import i18n from "../../../i18n";
import TranslationsLanguageList from "../TranslationsLanguageList";
export interface TranslationsLanguageListPageProps {
@ -17,16 +17,27 @@ export interface TranslationsLanguageListPageProps {
const TranslationsLanguageListPage: React.StatelessComponent<
TranslationsLanguageListPageProps
> = ({ languages, onRowClick }) => (
> = ({ languages, onRowClick }) => {
const intl = useIntl();
return (
<Container>
<PageHeader title={i18n.t("Languages")}>
<PageHeader
title={intl.formatMessage({
defaultMessage: "Languages"
})}
>
{/* <Button color="primary" variant="contained" onClick={onAdd}>
{i18n.t("Add Language")}
<FormattedMessage
defaultMessage="Add Language"
description="button"
/>
<AddIcon />
</Button> */}
</PageHeader>
<TranslationsLanguageList languages={languages} onRowClick={onRowClick} />
</Container>
);
);
};
TranslationsLanguageListPage.displayName = "TranslationsLanguageListPage";
export default TranslationsLanguageListPage;

View file

@ -1,11 +1,12 @@
import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader";
import CardSpacer from "@saleor/components/CardSpacer";
import Container from "@saleor/components/Container";
import LanguageSwitch from "@saleor/components/LanguageSwitch";
import PageHeader from "@saleor/components/PageHeader";
import i18n from "../../../i18n";
import { commonMessages, sectionNames } from "@saleor/intl";
import { maybe } from "../../../misc";
import { LanguageCodeEnum } from "../../../types/globalTypes";
import { PageTranslationFragment } from "../../types/PageTranslationFragment";
@ -38,15 +39,25 @@ const TranslationsPagesPage: React.StatelessComponent<
onEdit,
onLanguageChange,
onSubmit
}) => (
}) => {
const intl = useIntl();
return (
<Container>
<AppHeader onBack={onBack}>{i18n.t("Translations")}</AppHeader>
<AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.translations)}
</AppHeader>
<PageHeader
title={i18n.t('Translation Page "{{ pageName }}" - {{ languageCode }}', {
context: "page translation page title",
title={intl.formatMessage(
{
defaultMessage: 'Translation Page "{pageName}" - {languageCode}',
description: "header"
},
{
languageCode,
pageName: maybe(() => page.title, "...")
})}
}
)}
>
<LanguageSwitch
currentLanguage={LanguageCodeEnum[languageCode]}
@ -58,10 +69,12 @@ const TranslationsPagesPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("General Information")}
title={intl.formatMessage(commonMessages.generalInformations)}
fields={[
{
displayName: i18n.t("Page Title"),
displayName: intl.formatMessage({
defaultMessage: "Page Title"
}),
name: fieldNames.title,
translation: maybe(() =>
page.translation ? page.translation.title : null
@ -70,7 +83,10 @@ const TranslationsPagesPage: React.StatelessComponent<
value: maybe(() => page.title)
},
{
displayName: i18n.t("Content"),
displayName: intl.formatMessage({
defaultMessage: "Content",
description: "page content"
}),
name: fieldNames.contentJson,
translation: maybe(() =>
page.translation ? page.translation.contentJson : null
@ -89,10 +105,14 @@ const TranslationsPagesPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("Search Engine Preview")}
title={intl.formatMessage({
defaultMessage: "Search Engine Preview"
})}
fields={[
{
displayName: i18n.t("Search Engine Title"),
displayName: intl.formatMessage({
defaultMessage: "Search Engine Title"
}),
name: fieldNames.seoTitle,
translation: maybe(() =>
page.translation ? page.translation.seoTitle : null
@ -101,7 +121,9 @@ const TranslationsPagesPage: React.StatelessComponent<
value: maybe(() => page.seoTitle)
},
{
displayName: i18n.t("Search Engine Description"),
displayName: intl.formatMessage({
defaultMessage: "Search Engine Description"
}),
name: fieldNames.seoDescription,
translation: maybe(() =>
page.translation ? page.translation.seoDescription : null
@ -116,6 +138,7 @@ const TranslationsPagesPage: React.StatelessComponent<
onSubmit={onSubmit}
/>
</Container>
);
);
};
TranslationsPagesPage.displayName = "TranslationsPagesPage";
export default TranslationsPagesPage;

View file

@ -1,11 +1,12 @@
import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader";
import CardSpacer from "@saleor/components/CardSpacer";
import Container from "@saleor/components/Container";
import LanguageSwitch from "@saleor/components/LanguageSwitch";
import PageHeader from "@saleor/components/PageHeader";
import i18n from "../../../i18n";
import { sectionNames } from "@saleor/intl";
import { maybe } from "../../../misc";
import { LanguageCodeEnum } from "../../../types/globalTypes";
import { ProductTypeTranslationFragment } from "../../types/ProductTypeTranslationFragment";
@ -36,14 +37,22 @@ const TranslationsProductTypesPage: React.StatelessComponent<
onEdit,
onLanguageChange,
onSubmit
}) => (
}) => {
const intl = useIntl();
return (
<Container>
<AppHeader onBack={onBack}>{i18n.t("Translations")}</AppHeader>
<AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.translations)}
</AppHeader>
<PageHeader
title={i18n.t(
'Translation Product Type "{{ productTypeName }}" - {{ languageCode }}',
title={intl.formatMessage(
{
defaultMessage:
'Translation Product Type "{productTypeName}" - {languageCode}',
description: "header"
},
{
context: "productType translation page title",
languageCode,
productTypeName: maybe(() => productType.name, "...")
}
@ -62,12 +71,20 @@ const TranslationsProductTypesPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={false}
title={i18n.t("Product Attribute ({{ attributeName }})", {
title={intl.formatMessage(
{
defaultMessage: "Product Attribute ({attributeName})",
description: "header"
},
{
attributeName: attribute.name
})}
}
)}
fields={[
{
displayName: i18n.t("Attribute Name"),
displayName: intl.formatMessage({
defaultMessage: "Attribute Name"
}),
name: fieldNames.attribute + ":" + attribute.id,
translation: maybe(() =>
attribute.translation ? attribute.translation.name : null
@ -77,9 +94,15 @@ const TranslationsProductTypesPage: React.StatelessComponent<
},
...attribute.values.map(
(attributeValue, attributeValueIndex) => ({
displayName: i18n.t("Value {{ number }}", {
displayName: intl.formatMessage(
{
defaultMessage: "Value {number}",
description: "attribute values"
},
{
number: attributeValueIndex + 1
}),
}
),
name: fieldNames.value + ":" + attributeValue.id,
translation: maybe(() =>
attributeValue.translation
@ -112,24 +135,40 @@ const TranslationsProductTypesPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={false}
title={i18n.t("Variant Attribute ({{ attributeName }})", {
title={intl.formatMessage(
{
defaultMessage: "Variant Attribute ({attributeName})",
description: "header"
},
{
attributeName: attribute.name
})}
}
)}
fields={[
{
displayName: i18n.t("Attribute Name"),
displayName: intl.formatMessage({
defaultMessage: "Attribute Name"
}),
name: fieldNames.attribute + ":" + attribute.id,
translation: maybe(() =>
attribute.translation ? attribute.translation.name : null
attribute.translation
? attribute.translation.name
: null
),
type: "short" as "short",
value: maybe(() => attribute.name)
},
...attribute.values.map(
(attributeValue, attributeValueIndex) => ({
displayName: i18n.t("Value {{ number }}", {
displayName: intl.formatMessage(
{
defaultMessage: "Value {number}",
description: "attribute values"
},
{
number: attributeValueIndex + 1
}),
}
),
name: fieldNames.value + ":" + attributeValue.id,
translation: maybe(() =>
attributeValue.translation
@ -155,6 +194,7 @@ const TranslationsProductTypesPage: React.StatelessComponent<
</>
}
</Container>
);
);
};
TranslationsProductTypesPage.displayName = "TranslationsProductTypesPage";
export default TranslationsProductTypesPage;

View file

@ -1,11 +1,12 @@
import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader";
import CardSpacer from "@saleor/components/CardSpacer";
import Container from "@saleor/components/Container";
import LanguageSwitch from "@saleor/components/LanguageSwitch";
import PageHeader from "@saleor/components/PageHeader";
import i18n from "../../../i18n";
import { commonMessages, sectionNames } from "@saleor/intl";
import { maybe } from "../../../misc";
import { LanguageCodeEnum } from "../../../types/globalTypes";
import { ProductTranslationFragment } from "../../types/ProductTranslationFragment";
@ -38,14 +39,22 @@ const TranslationsProductsPage: React.StatelessComponent<
onEdit,
onLanguageChange,
onSubmit
}) => (
}) => {
const intl = useIntl();
return (
<Container>
<AppHeader onBack={onBack}>{i18n.t("Translations")}</AppHeader>
<AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.translations)}
</AppHeader>
<PageHeader
title={i18n.t(
'Translation Product "{{ productName }}" - {{ languageCode }}',
title={intl.formatMessage(
{
defaultMessage:
'Translation Product "{productName}" - {languageCode}',
description: "header"
},
{
context: "product translation page title",
languageCode,
productName: maybe(() => product.name, "...")
}
@ -61,10 +70,12 @@ const TranslationsProductsPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("General Information")}
title={intl.formatMessage(commonMessages.generalInformations)}
fields={[
{
displayName: i18n.t("Product Name"),
displayName: intl.formatMessage({
defaultMessage: "Product Name"
}),
name: fieldNames.name,
translation: maybe(() =>
product.translation ? product.translation.name : null
@ -73,7 +84,9 @@ const TranslationsProductsPage: React.StatelessComponent<
value: maybe(() => product.name)
},
{
displayName: i18n.t("Description"),
displayName: intl.formatMessage({
defaultMessage: "Description"
}),
name: fieldNames.descriptionJson,
translation: maybe(() =>
product.translation ? product.translation.descriptionJson : null
@ -92,10 +105,14 @@ const TranslationsProductsPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("Search Engine Preview")}
title={intl.formatMessage({
defaultMessage: "Search Engine Preview"
})}
fields={[
{
displayName: i18n.t("Search Engine Title"),
displayName: intl.formatMessage({
defaultMessage: "Search Engine Title"
}),
name: fieldNames.seoTitle,
translation: maybe(() =>
product.translation ? product.translation.seoTitle : null
@ -104,7 +121,9 @@ const TranslationsProductsPage: React.StatelessComponent<
value: maybe(() => product.seoTitle)
},
{
displayName: i18n.t("Search Engine Description"),
displayName: intl.formatMessage({
defaultMessage: "Search Engine Description"
}),
name: fieldNames.seoDescription,
translation: maybe(() =>
product.translation ? product.translation.seoDescription : null
@ -119,6 +138,7 @@ const TranslationsProductsPage: React.StatelessComponent<
onSubmit={onSubmit}
/>
</Container>
);
);
};
TranslationsProductsPage.displayName = "TranslationsProductsPage";
export default TranslationsProductsPage;

View file

@ -1,10 +1,11 @@
import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader";
import Container from "@saleor/components/Container";
import LanguageSwitch from "@saleor/components/LanguageSwitch";
import PageHeader from "@saleor/components/PageHeader";
import i18n from "../../../i18n";
import { commonMessages, sectionNames } from "@saleor/intl";
import { maybe } from "../../../misc";
import { LanguageCodeEnum } from "../../../types/globalTypes";
import { SaleTranslationFragment } from "../../types/SaleTranslationFragment";
@ -34,15 +35,25 @@ const TranslationsSalesPage: React.StatelessComponent<
onEdit,
onLanguageChange,
onSubmit
}) => (
}) => {
const intl = useIntl();
return (
<Container>
<AppHeader onBack={onBack}>{i18n.t("Translations")}</AppHeader>
<AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.translations)}
</AppHeader>
<PageHeader
title={i18n.t('Translation Sale "{{ saleName }}" - {{ languageCode }}', {
context: "sale translation page title",
title={intl.formatMessage(
{
defaultMessage: 'Translation Sale "{saleName}" - {languageCode}',
description: "header"
},
{
languageCode,
saleName: maybe(() => sale.name, "...")
})}
}
)}
>
<LanguageSwitch
currentLanguage={LanguageCodeEnum[languageCode]}
@ -54,10 +65,12 @@ const TranslationsSalesPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("General Information")}
title={intl.formatMessage(commonMessages.generalInformations)}
fields={[
{
displayName: i18n.t("Sale Name"),
displayName: intl.formatMessage({
defaultMessage: "Sale Name"
}),
name: fieldNames.name,
translation: maybe(() =>
sale.translation ? sale.translation.name : null
@ -72,6 +85,7 @@ const TranslationsSalesPage: React.StatelessComponent<
onSubmit={onSubmit}
/>
</Container>
);
);
};
TranslationsSalesPage.displayName = "TranslationsSalesPage";
export default TranslationsSalesPage;

View file

@ -1,10 +1,11 @@
import React from "react";
import { useIntl } from "react-intl";
import AppHeader from "@saleor/components/AppHeader";
import Container from "@saleor/components/Container";
import LanguageSwitch from "@saleor/components/LanguageSwitch";
import PageHeader from "@saleor/components/PageHeader";
import i18n from "../../../i18n";
import { commonMessages, sectionNames } from "@saleor/intl";
import { maybe } from "../../../misc";
import { LanguageCodeEnum } from "../../../types/globalTypes";
import { TranslationsEntitiesPageProps } from "../../types/TranslationsEntitiesPage";
@ -34,14 +35,22 @@ const TranslationsVouchersPage: React.StatelessComponent<
onEdit,
onLanguageChange,
onSubmit
}) => (
}) => {
const intl = useIntl();
return (
<Container>
<AppHeader onBack={onBack}>{i18n.t("Translations")}</AppHeader>
<AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.translations)}
</AppHeader>
<PageHeader
title={i18n.t(
'Translation Voucher "{{ voucherName }}" - {{ languageCode }}',
title={intl.formatMessage(
{
defaultMessage:
'Translation Voucher "{voucherName}" - {languageCode}',
description: "header"
},
{
context: "voucher translation page title",
languageCode,
voucherName: maybe(() => voucher.name, "...")
}
@ -57,10 +66,12 @@ const TranslationsVouchersPage: React.StatelessComponent<
activeField={activeField}
disabled={disabled}
initialState={true}
title={i18n.t("General Information")}
title={intl.formatMessage(commonMessages.generalInformations)}
fields={[
{
displayName: i18n.t("Voucher Name"),
displayName: intl.formatMessage({
defaultMessage: "Voucher Name"
}),
name: fieldNames.name,
translation: maybe(() =>
voucher.translation ? voucher.translation.name : null
@ -75,6 +86,7 @@ const TranslationsVouchersPage: React.StatelessComponent<
onSubmit={onSubmit}
/>
</Container>
);
);
};
TranslationsVouchersPage.displayName = "TranslationsVouchersPage";
export default TranslationsVouchersPage;

View file

@ -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 { LanguageCodeEnum } from "../types/globalTypes";
import {
languageEntitiesPath,
@ -174,9 +175,12 @@ const TranslationsProductTypes: React.FC<TranslationsEntityRouteProps> = ({
);
};
const TranslationsRouter: React.FC = () => (
const TranslationsRouter: React.FC = () => {
const intl = useIntl();
return (
<>
<WindowTitle title={i18n.t("Translations")} />
<WindowTitle title={intl.formatMessage(sectionNames.translations)} />
<Switch>
<Route
exact
@ -253,6 +257,7 @@ const TranslationsRouter: React.FC = () => (
/>
</Switch>
</>
);
);
};
TranslationsRouter.displayName = "TranslationsRouter";
export default TranslationsRouter;

View file

@ -1,10 +1,11 @@
import { stringify as stringifyQs } from "qs";
import React from "react";
import { useIntl } from "react-intl";
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 { LanguageCodeEnum, TranslationInput } from "../../types/globalTypes";
import TranslationsCategoriesPage, {
@ -36,6 +37,7 @@ const TranslationsCategories: React.FC<TranslationsCategoriesProps> = ({
const navigate = useNavigator();
const notify = useNotifier();
const shop = useShop();
const intl = useIntl();
const onEdit = (field: string) =>
navigate(
@ -48,7 +50,7 @@ const TranslationsCategories: React.FC<TranslationsCategoriesProps> = ({
const onUpdate = (data: UpdateCategoryTranslations) => {
if (data.categoryTranslate.errors.length === 0) {
notify({
text: i18n.t("Translation Saved")
text: intl.formatMessage(commonMessages.savedChanges)
});
navigate("?", true);
}

View file

@ -1,10 +1,11 @@
import { stringify as stringifyQs } from "qs";
import React from "react";
import { useIntl } from "react-intl";
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 { LanguageCodeEnum, TranslationInput } from "../../types/globalTypes";
import TranslationsCollectionsPage, {
@ -36,6 +37,7 @@ const TranslationsCollections: React.FC<TranslationsCollectionsProps> = ({
const navigate = useNavigator();
const notify = useNotifier();
const shop = useShop();
const intl = useIntl();
const onEdit = (field: string) =>
navigate(
@ -48,7 +50,7 @@ const TranslationsCollections: React.FC<TranslationsCollectionsProps> = ({
const onUpdate = (data: UpdateCollectionTranslations) => {
if (data.collectionTranslate.errors.length === 0) {
notify({
text: i18n.t("Translation Saved")
text: intl.formatMessage(commonMessages.savedChanges)
});
navigate("?", true);
}

View file

@ -1,10 +1,11 @@
import { stringify as stringifyQs } from "qs";
import React from "react";
import { useIntl } from "react-intl";
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 {
LanguageCodeEnum,
@ -39,6 +40,7 @@ const TranslationsPages: React.FC<TranslationsPagesProps> = ({
const navigate = useNavigator();
const notify = useNotifier();
const shop = useShop();
const intl = useIntl();
const onEdit = (field: string) =>
navigate(
@ -51,7 +53,7 @@ const TranslationsPages: React.FC<TranslationsPagesProps> = ({
const onUpdate = (data: UpdatePageTranslations) => {
if (data.pageTranslate.errors.length === 0) {
notify({
text: i18n.t("Translation Saved")
text: intl.formatMessage(commonMessages.savedChanges)
});
navigate("?", true);
}

View file

@ -1,10 +1,11 @@
import { stringify as stringifyQs } from "qs";
import React from "react";
import { useIntl } from "react-intl";
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 {
LanguageCodeEnum,
@ -43,6 +44,7 @@ const TranslationsProductTypes: React.FC<TranslationsProductTypesProps> = ({
const navigate = useNavigator();
const notify = useNotifier();
const shop = useShop();
const intl = useIntl();
const onEdit = (field: string) =>
navigate(
@ -55,7 +57,7 @@ const TranslationsProductTypes: React.FC<TranslationsProductTypesProps> = ({
const onAttributeUpdate = (data: UpdateAttributeTranslations) => {
if (data.attributeTranslate.errors.length === 0) {
notify({
text: i18n.t("Translation Saved")
text: intl.formatMessage(commonMessages.savedChanges)
});
navigate("?", true);
}
@ -63,7 +65,7 @@ const TranslationsProductTypes: React.FC<TranslationsProductTypesProps> = ({
const onAttributeValueUpdate = (data: UpdateAttributeValueTranslations) => {
if (data.attributeValueTranslate.errors.length === 0) {
notify({
text: i18n.t("Translation Saved")
text: intl.formatMessage(commonMessages.savedChanges)
});
navigate("?", true);
}

View file

@ -1,10 +1,11 @@
import { stringify as stringifyQs } from "qs";
import React from "react";
import { useIntl } from "react-intl";
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 { LanguageCodeEnum, TranslationInput } from "../../types/globalTypes";
import TranslationsProductsPage, {
@ -36,6 +37,7 @@ const TranslationsProducts: React.FC<TranslationsProductsProps> = ({
const navigate = useNavigator();
const notify = useNotifier();
const shop = useShop();
const intl = useIntl();
const onEdit = (field: string) =>
navigate(
@ -48,7 +50,7 @@ const TranslationsProducts: React.FC<TranslationsProductsProps> = ({
const onUpdate = (data: UpdateProductTranslations) => {
if (data.productTranslate.errors.length === 0) {
notify({
text: i18n.t("Translation Saved")
text: intl.formatMessage(commonMessages.savedChanges)
});
navigate("?", true);
}

View file

@ -1,10 +1,11 @@
import { stringify as stringifyQs } from "qs";
import React from "react";
import { useIntl } from "react-intl";
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 {
LanguageCodeEnum,
@ -39,6 +40,7 @@ const TranslationsSales: React.FC<TranslationsSalesProps> = ({
const navigate = useNavigator();
const notify = useNotifier();
const shop = useShop();
const intl = useIntl();
const onEdit = (field: string) =>
navigate(
@ -51,7 +53,7 @@ const TranslationsSales: React.FC<TranslationsSalesProps> = ({
const onUpdate = (data: UpdateSaleTranslations) => {
if (data.saleTranslate.errors.length === 0) {
notify({
text: i18n.t("Translation Saved")
text: intl.formatMessage(commonMessages.savedChanges)
});
navigate("?", true);
}

View file

@ -1,10 +1,11 @@
import { stringify as stringifyQs } from "qs";
import React from "react";
import { useIntl } from "react-intl";
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 {
LanguageCodeEnum,
@ -39,6 +40,7 @@ const TranslationsVouchers: React.FC<TranslationsVouchersProps> = ({
const navigate = useNavigator();
const notify = useNotifier();
const shop = useShop();
const intl = useIntl();
const onEdit = (field: string) =>
navigate(
@ -51,7 +53,7 @@ const TranslationsVouchers: React.FC<TranslationsVouchersProps> = ({
const onUpdate = (data: UpdateVoucherTranslations) => {
if (data.voucherTranslate.errors.length === 0) {
notify({
text: i18n.t("Translation Saved")
text: intl.formatMessage(commonMessages.savedChanges)
});
navigate("?", true);
}