From da600d19d5f025fc2c354cb528d81cc597f577dc Mon Sep 17 00:00:00 2001 From: Still Hsu Date: Wed, 16 Feb 2022 08:41:08 +0800 Subject: [PATCH] Localize hard strings in submission & performer tagger (#2304) * Localize hard strings in submission & performer tagger * Localise show/hide configuration Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com> --- .../src/components/Dialogs/SubmitDraft.tsx | 22 ++- .../components/Tagger/performers/Config.tsx | 37 +++-- .../Tagger/performers/PerformerTagger.tsx | 133 ++++++++++++------ ui/v2.5/src/locales/en-GB.json | 48 ++++++- ui/v2.5/src/locales/zh-TW.json | 47 ++++++- 5 files changed, 223 insertions(+), 64 deletions(-) diff --git a/ui/v2.5/src/components/Dialogs/SubmitDraft.tsx b/ui/v2.5/src/components/Dialogs/SubmitDraft.tsx index 3b9ecc7d3..22b10d9ea 100644 --- a/ui/v2.5/src/components/Dialogs/SubmitDraft.tsx +++ b/ui/v2.5/src/components/Dialogs/SubmitDraft.tsx @@ -4,6 +4,7 @@ import { Button, Form } from "react-bootstrap"; import * as GQL from "src/core/generated-graphql"; import { Modal } from "src/components/Shared"; import { getStashboxBase } from "src/utils"; +import { FormattedMessage, useIntl } from "react-intl"; interface IProps { show: boolean; @@ -42,6 +43,7 @@ export const SubmitStashBoxDraft: React.FC = ({ query ); const [selectedBox, setSelectedBox] = useState(0); + const intl = useIntl(); const handleSubmit = () => { submit({ @@ -62,7 +64,7 @@ export const SubmitStashBoxDraft: React.FC = ({ return ( = ({ <> - Selected Stash-Box endpoint: + : = ({ ) : ( <> -
Submission successful
+
+ +
= ({ boxes[selectedBox].endpoint )}drafts/${getResponseId(data)}`} > - Go to {boxes[selectedBox].name} to review draft. +
)} {error !== undefined && ( <> -
Submission failed
+
+ +
{error.message}
)} diff --git a/ui/v2.5/src/components/Tagger/performers/Config.tsx b/ui/v2.5/src/components/Tagger/performers/Config.tsx index df9a090eb..ea44b75e3 100644 --- a/ui/v2.5/src/components/Tagger/performers/Config.tsx +++ b/ui/v2.5/src/components/Tagger/performers/Config.tsx @@ -1,5 +1,6 @@ import React, { Dispatch, useState } from "react"; import { Badge, Button, Card, Collapse, Form } from "react-bootstrap"; +import { FormattedMessage } from "react-intl"; import { ConfigurationContext } from "src/hooks/Config"; import { TextUtils } from "src/utils"; @@ -38,28 +39,34 @@ const Config: React.FC = ({ show, config, setConfig }) => {
-

Configuration

+

+ +


-
Excluded fields:
+
+ +
- {excludedFields.length > 0 - ? excludedFields.map((f) => ( - - {TextUtils.capitalize(f)} - - )) - : "No fields are excluded"} + {excludedFields.length > 0 ? ( + excludedFields.map((f) => ( + + {TextUtils.capitalize(f)} + + )) + ) : ( + + )} - These fields will not be changed when updating performers. +
= ({ show, config, setConfig }) => { className="align-items-center row no-gutters mt-4" > - Active stash-box instance: + = ({ show, config, setConfig }) => { disabled={!stashBoxes.length} onChange={handleInstanceSelect} > - {!stashBoxes.length && } + {!stashBoxes.length && ( + + )} {stashConfig?.general.stashBoxes.map((i) => (