mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +00:00
feat: better translation
This commit is contained in:
parent
e8d771aed3
commit
8d8ae45aad
@ -170,7 +170,7 @@ export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate:
|
||||
</>
|
||||
}
|
||||
|
||||
<Form.Item style={{marginTop: 10}}>
|
||||
<Form.Item style={{marginTop: '5vh'}}>
|
||||
<Space>
|
||||
<Button type="primary" htmlType="submit">
|
||||
{t`Create`}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import {Card, Divider, Space, Table, Tag, Typography} from "antd";
|
||||
import {Card, Divider, Space, Table, Tag, Tooltip, Typography} from "antd";
|
||||
import {DisconnectOutlined, LinkOutlined} from "@ant-design/icons";
|
||||
import {t} from "ttag";
|
||||
import {ViewDiagramWatchlistButton} from "./diagram/ViewDiagramWatchlistButton";
|
||||
@ -11,7 +11,7 @@ import {Watchlist} from "../../../pages/tracking/WatchlistPage";
|
||||
import {Connector} from "../../../utils/api/connectors";
|
||||
import useBreakpoint from "../../../hooks/useBreakpoint";
|
||||
import {CalendarWatchlistButton} from "./CalendarWatchlistButton";
|
||||
import {rdapEventNameTranslation} from "../../search/rdapTranslation";
|
||||
import {rdapEventDetailTranslation, rdapEventNameTranslation} from "../../search/rdapTranslation";
|
||||
|
||||
export function WatchlistCard({watchlist, onUpdateWatchlist, connectors, onDelete}: {
|
||||
watchlist: Watchlist,
|
||||
@ -21,6 +21,7 @@ export function WatchlistCard({watchlist, onUpdateWatchlist, connectors, onDelet
|
||||
}) {
|
||||
const sm = useBreakpoint('sm')
|
||||
const rdapEventNameTranslated = rdapEventNameTranslation()
|
||||
const rdapEventDetailTranslated = rdapEventDetailTranslation()
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@ -75,9 +76,12 @@ export function WatchlistCard({watchlist, onUpdateWatchlist, connectors, onDelet
|
||||
dataSource={[{
|
||||
domains: watchlist.domains.map(d => <Tag>{punycode.toUnicode(d.ldhName)}</Tag>),
|
||||
events: watchlist.triggers?.filter(t => t.action === 'email')
|
||||
.map(t => <Tag color={actionToColor(t.event)}>
|
||||
{rdapEventNameTranslated[t.event as keyof typeof rdapEventNameTranslated]}
|
||||
</Tag>
|
||||
.map(t => <Tooltip
|
||||
title={t.event in rdapEventDetailTranslated ? rdapEventDetailTranslated[t.event as keyof typeof rdapEventDetailTranslated] : undefined}>
|
||||
<Tag color={actionToColor(t.event)}>
|
||||
{rdapEventNameTranslated[t.event as keyof typeof rdapEventNameTranslated]}
|
||||
</Tag>
|
||||
</Tooltip>
|
||||
)
|
||||
}]}
|
||||
{...(sm ? {scroll: {y: 'max-content'}} : {scroll: {y: 240}})}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import {Button, Form, FormInstance, Input, Select, SelectProps, Space, Tag, Typography} from "antd";
|
||||
import {Button, Form, FormInstance, Input, Select, SelectProps, Space, Tag, Tooltip, Typography} from "antd";
|
||||
import {t} from "ttag";
|
||||
import {ApiOutlined, MinusCircleOutlined, PlusOutlined} from "@ant-design/icons";
|
||||
import React from "react";
|
||||
import {Connector} from "../../../utils/api/connectors";
|
||||
import {actionToColor} from "../../search/EventTimeline";
|
||||
import {rdapEventNameTranslation} from "../../search/rdapTranslation";
|
||||
import {rdapEventDetailTranslation, rdapEventNameTranslation} from "../../search/rdapTranslation";
|
||||
|
||||
type TagRender = SelectProps['tagRender'];
|
||||
|
||||
@ -33,6 +33,7 @@ export function WatchlistForm({form, connectors, onFinish, isCreation}: {
|
||||
isCreation: boolean
|
||||
}) {
|
||||
const rdapEventNameTranslated = rdapEventNameTranslation()
|
||||
const rdapEventDetailTranslated = rdapEventDetailTranslation()
|
||||
|
||||
const triggerTagRenderer: TagRender = (props) => {
|
||||
const {value, closable, onClose} = props;
|
||||
@ -40,16 +41,18 @@ export function WatchlistForm({form, connectors, onFinish, isCreation}: {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
return (
|
||||
<Tag
|
||||
color={actionToColor(value)}
|
||||
onMouseDown={onPreventMouseDown}
|
||||
closable={closable}
|
||||
onClose={onClose}
|
||||
style={{marginInlineEnd: 4}}
|
||||
>
|
||||
{rdapEventNameTranslated[value as keyof typeof rdapEventNameTranslated]}
|
||||
</Tag>
|
||||
return (<Tooltip
|
||||
title={value in rdapEventDetailTranslated ? rdapEventDetailTranslated[value as keyof typeof rdapEventDetailTranslated] : undefined}>
|
||||
<Tag
|
||||
color={actionToColor(value)}
|
||||
onMouseDown={onPreventMouseDown}
|
||||
closable={closable}
|
||||
onClose={onClose}
|
||||
style={{marginInlineEnd: 4}}
|
||||
>
|
||||
{rdapEventNameTranslated[value as keyof typeof rdapEventNameTranslated]}
|
||||
</Tag>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
|
||||
@ -159,6 +162,7 @@ export function WatchlistForm({form, connectors, onFinish, isCreation}: {
|
||||
style={{width: '100%'}}
|
||||
options={Object.keys(rdapEventNameTranslated).map(e => ({
|
||||
value: e,
|
||||
title: e in rdapEventDetailTranslated ? rdapEventDetailTranslated[e as keyof typeof rdapEventDetailTranslated] : undefined,
|
||||
label: rdapEventNameTranslated[e as keyof typeof rdapEventNameTranslated]
|
||||
}))}
|
||||
/>
|
||||
@ -240,7 +244,7 @@ export function WatchlistForm({form, connectors, onFinish, isCreation}: {
|
||||
</>
|
||||
)}
|
||||
</Form.List>
|
||||
<Form.Item style={{marginTop: '10px'}}>
|
||||
<Form.Item style={{marginTop: '5vh'}}>
|
||||
<Space>
|
||||
<Button type="primary" htmlType="submit">
|
||||
{isCreation ? t`Create` : t`Update`}
|
||||
|
||||
@ -22,8 +22,8 @@ msgstr ""
|
||||
#: assets/components/tracking/connector/ConnectorForm.tsx:142
|
||||
#: assets/components/tracking/connector/ConnectorForm.tsx:156
|
||||
#: assets/components/tracking/connector/ConnectorForm.tsx:165
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:110
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:206
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:113
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:210
|
||||
msgid "Required"
|
||||
msgstr ""
|
||||
|
||||
@ -469,7 +469,7 @@ msgid "Entities"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/search/DomainSearchBar.tsx:26
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:113
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:116
|
||||
msgid "This domain name does not appear to be valid"
|
||||
msgstr ""
|
||||
|
||||
@ -544,12 +544,12 @@ msgid ""
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/connector/ConnectorForm.tsx:176
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:246
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:250
|
||||
msgid "Create"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/connector/ConnectorForm.tsx:179
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:249
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:253
|
||||
msgid "Reset"
|
||||
msgstr ""
|
||||
|
||||
@ -582,72 +582,72 @@ msgstr ""
|
||||
msgid "No"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:67
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:70
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:78
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:81
|
||||
msgid "Watchlist Name"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:79
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:82
|
||||
msgid "Naming the Watchlist makes it easier to find in the list below."
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:90
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:93
|
||||
msgid "At least one domain name"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistCard.tsx:27
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:101
|
||||
#: assets/components/tracking/watchlist/WatchlistCard.tsx:28
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:104
|
||||
msgid "Domain names"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:119
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:122
|
||||
msgid "Domain name"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:136
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:139
|
||||
msgid "Add a Domain name"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistCard.tsx:31
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:143
|
||||
#: assets/components/tracking/watchlist/WatchlistCard.tsx:32
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:146
|
||||
msgid "Tracked events"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:145
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:148
|
||||
msgid "At least one trigger"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:167
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:181
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:171
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:185
|
||||
msgid "Connector"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:177
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:181
|
||||
msgid ""
|
||||
"Please make sure the connector information is valid to purchase a domain "
|
||||
"that may be available soon."
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:197
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:201
|
||||
msgid "DSN"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:209
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:213
|
||||
msgid "This DSN does not appear to be valid"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:227
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:231
|
||||
msgid "Check out this link to the Symfony documentation to help you build the DSN"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:236
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:240
|
||||
msgid "Add a Webhook"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:246
|
||||
#: assets/components/tracking/watchlist/WatchlistForm.tsx:250
|
||||
msgid "Update"
|
||||
msgstr ""
|
||||
|
||||
@ -697,11 +697,11 @@ msgstr ""
|
||||
msgid "Are you sure to delete this Watchlist?"
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistCard.tsx:44
|
||||
#: assets/components/tracking/watchlist/WatchlistCard.tsx:45
|
||||
msgid "This Watchlist is not linked to a Connector."
|
||||
msgstr ""
|
||||
|
||||
#: assets/components/tracking/watchlist/WatchlistCard.tsx:47
|
||||
#: assets/components/tracking/watchlist/WatchlistCard.tsx:48
|
||||
msgid "Watchlist"
|
||||
msgstr ""
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user