Add more translations (#9733)
This commit is contained in:
@ -14,6 +14,7 @@ import { isDefaultLayoutAuthModalVisibleState } from '@/ui/layout/states/isDefau
|
||||
import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { Trans, useLingui } from '@lingui/react/macro';
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
import { motion } from 'framer-motion';
|
||||
import { useState } from 'react';
|
||||
@ -71,6 +72,7 @@ const StyledInputContainer = styled.div`
|
||||
`;
|
||||
|
||||
export const PasswordReset = () => {
|
||||
const { t } = useLingui();
|
||||
const { enqueueSnackBar } = useSnackBar();
|
||||
|
||||
const workspacePublicData = useRecoilValue(workspacePublicDataState);
|
||||
@ -171,7 +173,9 @@ export const PasswordReset = () => {
|
||||
<AnimatedEaseIn>
|
||||
<Logo secondaryLogo={workspacePublicData?.logo} />
|
||||
</AnimatedEaseIn>
|
||||
<Title animate>Reset Password</Title>
|
||||
<Title animate>
|
||||
<Trans>Reset Password</Trans>
|
||||
</Title>
|
||||
<StyledContentContainer>
|
||||
{!email ? (
|
||||
<SkeletonTheme
|
||||
@ -201,7 +205,7 @@ export const PasswordReset = () => {
|
||||
<TextInputV2
|
||||
autoFocus
|
||||
value={email}
|
||||
placeholder="Email"
|
||||
placeholder={t`Email`}
|
||||
fullWidth
|
||||
disabled
|
||||
/>
|
||||
@ -228,7 +232,7 @@ export const PasswordReset = () => {
|
||||
autoFocus
|
||||
value={value}
|
||||
type="password"
|
||||
placeholder="New Password"
|
||||
placeholder={t`New Password`}
|
||||
onBlur={onBlur}
|
||||
onChange={onChange}
|
||||
error={error?.message}
|
||||
@ -241,7 +245,7 @@ export const PasswordReset = () => {
|
||||
|
||||
<MainButton
|
||||
variant="secondary"
|
||||
title="Change Password"
|
||||
title={t`Change Password`}
|
||||
type="submit"
|
||||
fullWidth
|
||||
disabled={isUpdatingPassword}
|
||||
|
||||
@ -38,7 +38,7 @@ export const NotFound = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageTitle title={t`Page Not Found | Twenty`} />
|
||||
<PageTitle title={t`Page Not Found` + ' | Twenty'} />
|
||||
<StyledBackDrop>
|
||||
<AnimatedPlaceholderErrorContainer>
|
||||
<AnimatedPlaceholder type="error404" />
|
||||
|
||||
@ -322,7 +322,7 @@ export const SettingsWorkspaceMembers = () => {
|
||||
subtitle={
|
||||
<Trans>
|
||||
This action cannot be undone. This will permanently delete this user
|
||||
and remove them from all their assignements.
|
||||
and remove them from all their assignments.
|
||||
</Trans>
|
||||
}
|
||||
onConfirmClick={() =>
|
||||
|
||||
@ -14,9 +14,11 @@ import { SettingsAccountsSettingsSection } from '@/settings/accounts/components/
|
||||
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||
import { SettingsPath } from '@/types/SettingsPath';
|
||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
|
||||
|
||||
export const SettingsAccounts = () => {
|
||||
const { t } = useLingui();
|
||||
const currentWorkspaceMember = useRecoilValue(currentWorkspaceMemberState);
|
||||
|
||||
const { objectMetadataItem } = useObjectMetadataItem({
|
||||
@ -24,7 +26,7 @@ export const SettingsAccounts = () => {
|
||||
});
|
||||
|
||||
const { records: accounts, loading } = useFindManyRecords<ConnectedAccount>({
|
||||
objectNameSingular: 'connectedAccount',
|
||||
objectNameSingular: CoreObjectNameSingular.ConnectedAccount,
|
||||
filter: {
|
||||
accountOwnerId: {
|
||||
eq: currentWorkspaceMember?.id,
|
||||
@ -35,13 +37,13 @@ export const SettingsAccounts = () => {
|
||||
|
||||
return (
|
||||
<SubMenuTopBarContainer
|
||||
title="Account"
|
||||
title={t`Account`}
|
||||
links={[
|
||||
{
|
||||
children: 'User',
|
||||
children: t`User`,
|
||||
href: getSettingsPath(SettingsPath.ProfilePage),
|
||||
},
|
||||
{ children: 'Account' },
|
||||
{ children: t`Account` },
|
||||
]}
|
||||
>
|
||||
<SettingsPageContainer>
|
||||
@ -51,8 +53,8 @@ export const SettingsAccounts = () => {
|
||||
<>
|
||||
<Section>
|
||||
<H2Title
|
||||
title="Connected accounts"
|
||||
description="Manage your internet accounts."
|
||||
title={t`Connected accounts`}
|
||||
description={t`Manage your internet accounts.`}
|
||||
/>
|
||||
<SettingsAccountsConnectedAccountsListCard
|
||||
accounts={accounts}
|
||||
|
||||
@ -35,6 +35,7 @@ import { TextInput } from '@/ui/input/components/TextInput';
|
||||
import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
|
||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { Trans, useLingui } from '@lingui/react/macro';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
|
||||
@ -64,6 +65,8 @@ const StyledPlaceholder = styled.div`
|
||||
`;
|
||||
|
||||
export const SettingsDevelopersWebhooksDetail = () => {
|
||||
const { t } = useLingui();
|
||||
|
||||
const { objectMetadataItems } = useObjectMetadataItems();
|
||||
const isAnalyticsEnabled = useRecoilValue(isAnalyticsEnabledState);
|
||||
const isMobile = useIsMobile();
|
||||
@ -203,19 +206,21 @@ export const SettingsDevelopersWebhooksDetail = () => {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const confirmationText = t`yes`;
|
||||
|
||||
return (
|
||||
<SubMenuTopBarContainer
|
||||
title={webhookData.targetUrl}
|
||||
links={[
|
||||
{
|
||||
children: 'Workspace',
|
||||
children: t`Workspace`,
|
||||
href: getSettingsPath(SettingsPath.Workspace),
|
||||
},
|
||||
{
|
||||
children: 'Developers',
|
||||
children: t`Developers`,
|
||||
href: getSettingsPath(SettingsPath.Developers),
|
||||
},
|
||||
{ children: 'Webhook' },
|
||||
{ children: t`Webhook` },
|
||||
]}
|
||||
actionButton={
|
||||
<SaveAndCancelButtons
|
||||
@ -230,20 +235,23 @@ export const SettingsDevelopersWebhooksDetail = () => {
|
||||
<SettingsPageContainer>
|
||||
<Section>
|
||||
<H2Title
|
||||
title="Endpoint URL"
|
||||
description="We will send POST requests to this endpoint for every new event"
|
||||
title={t`Endpoint URL`}
|
||||
description={t`We will send POST requests to this endpoint for every new event`}
|
||||
/>
|
||||
<TextInput
|
||||
placeholder="URL"
|
||||
placeholder={t`URL`}
|
||||
value={webhookData.targetUrl}
|
||||
disabled
|
||||
fullWidth
|
||||
/>
|
||||
</Section>
|
||||
<Section>
|
||||
<H2Title title="Description" description="An optional description" />
|
||||
<H2Title
|
||||
title={t`Description`}
|
||||
description={t`An optional description`}
|
||||
/>
|
||||
<TextArea
|
||||
placeholder="Write a description"
|
||||
placeholder={t`Write a description`}
|
||||
minRows={4}
|
||||
value={description}
|
||||
onChange={(description) => {
|
||||
@ -254,8 +262,8 @@ export const SettingsDevelopersWebhooksDetail = () => {
|
||||
</Section>
|
||||
<Section>
|
||||
<H2Title
|
||||
title="Filters"
|
||||
description="Select the events you wish to send to this endpoint"
|
||||
title={t`Filters`}
|
||||
description={t`Select the events you wish to send to this endpoint`}
|
||||
/>
|
||||
{operations.map((operation, index) => (
|
||||
<StyledFilterRow isMobile={isMobile} key={index}>
|
||||
@ -270,7 +278,7 @@ export const SettingsDevelopersWebhooksDetail = () => {
|
||||
options={fieldTypeOptions}
|
||||
emptyOption={{
|
||||
value: null,
|
||||
label: 'Choose an object',
|
||||
label: t`Choose an object`,
|
||||
Icon: IconBox,
|
||||
}}
|
||||
/>
|
||||
@ -329,25 +337,31 @@ export const SettingsDevelopersWebhooksDetail = () => {
|
||||
</AnalyticsGraphDataInstanceContext.Provider>
|
||||
)}
|
||||
<Section>
|
||||
<H2Title title="Danger zone" description="Delete this integration" />
|
||||
<H2Title
|
||||
title={t`Danger zone`}
|
||||
description={t`Delete this integration`}
|
||||
/>
|
||||
<Button
|
||||
accent="danger"
|
||||
variant="secondary"
|
||||
title="Delete"
|
||||
title={t`Delete`}
|
||||
Icon={IconTrash}
|
||||
onClick={() => setIsDeleteWebhookModalOpen(true)}
|
||||
/>
|
||||
<ConfirmationModal
|
||||
confirmationPlaceholder="yes"
|
||||
confirmationValue="yes"
|
||||
confirmationPlaceholder={confirmationText}
|
||||
confirmationValue={confirmationText}
|
||||
isOpen={isDeleteWebhookModalOpen}
|
||||
setIsOpen={setIsDeleteWebhookModalOpen}
|
||||
title="Delete webhook"
|
||||
title={t`Delete webhook`}
|
||||
subtitle={
|
||||
<>Please type "yes" to confirm you want to delete this webhook.</>
|
||||
<Trans>
|
||||
Please type {confirmationText} to confirm you want to delete
|
||||
this webhook.
|
||||
</Trans>
|
||||
}
|
||||
onConfirmClick={deleteWebhook}
|
||||
deleteButtonText="Delete webhook"
|
||||
deleteButtonText={t`Delete webhook`}
|
||||
/>
|
||||
</Section>
|
||||
</SettingsPageContainer>
|
||||
|
||||
@ -9,11 +9,13 @@ import { Webhook } from '@/settings/developers/types/webhook/Webhook';
|
||||
import { SettingsPath } from '@/types/SettingsPath';
|
||||
import { TextInput } from '@/ui/input/components/TextInput';
|
||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
|
||||
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
|
||||
import { isValidUrl } from '~/utils/url/isValidUrl';
|
||||
|
||||
export const SettingsDevelopersWebhooksNew = () => {
|
||||
const { t } = useLingui();
|
||||
const navigate = useNavigateSettings();
|
||||
|
||||
const [formValues, setFormValues] = useState<{
|
||||
@ -69,14 +71,14 @@ export const SettingsDevelopersWebhooksNew = () => {
|
||||
title="New Webhook"
|
||||
links={[
|
||||
{
|
||||
children: 'Workspace',
|
||||
children: t`Workspace`,
|
||||
href: getSettingsPath(SettingsPath.Workspace),
|
||||
},
|
||||
{
|
||||
children: 'Developers',
|
||||
children: t`Developers`,
|
||||
href: getSettingsPath(SettingsPath.Developers),
|
||||
},
|
||||
{ children: 'New Webhook' },
|
||||
{ children: t`New Webhook` },
|
||||
]}
|
||||
actionButton={
|
||||
<SaveAndCancelButtons
|
||||
@ -91,13 +93,13 @@ export const SettingsDevelopersWebhooksNew = () => {
|
||||
<SettingsPageContainer>
|
||||
<Section>
|
||||
<H2Title
|
||||
title="Endpoint URL"
|
||||
description="We will send POST requests to this endpoint for every new event"
|
||||
title={t`Endpoint URL`}
|
||||
description={t`We will send POST requests to this endpoint for every new event`}
|
||||
/>
|
||||
<TextInput
|
||||
placeholder="URL"
|
||||
placeholder={t`URL`}
|
||||
value={formValues.targetUrl}
|
||||
error={!isTargetUrlValid ? 'Please enter a valid URL' : undefined}
|
||||
error={!isTargetUrlValid ? t`Please enter a valid URL` : undefined}
|
||||
onKeyDown={handleKeyDown}
|
||||
onChange={handleChange}
|
||||
fullWidth
|
||||
|
||||
Reference in New Issue
Block a user