Translation followup (#9735)
Address PR comments and more progress on translation
This commit is contained in:
@ -33,6 +33,7 @@ import { SettingsPath } from '@/types/SettingsPath';
|
||||
import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/SnackBar';
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||
import { useNavigateApp } from '~/hooks/useNavigateApp';
|
||||
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
|
||||
@ -48,6 +49,7 @@ type SettingsDataModelFieldEditFormValues = z.infer<
|
||||
export const SettingsObjectFieldEdit = () => {
|
||||
const navigateSettings = useNavigateSettings();
|
||||
const navigateApp = useNavigateApp();
|
||||
const { t } = useLingui();
|
||||
|
||||
const { enqueueSnackBar } = useSnackBar();
|
||||
|
||||
@ -170,11 +172,11 @@ export const SettingsObjectFieldEdit = () => {
|
||||
title={fieldMetadataItem?.label}
|
||||
links={[
|
||||
{
|
||||
children: 'Workspace',
|
||||
children: t`Workspace`,
|
||||
href: getSettingsPath(SettingsPath.Workspace),
|
||||
},
|
||||
{
|
||||
children: 'Objects',
|
||||
children: t`Objects`,
|
||||
href: getSettingsPath(SettingsPath.Objects),
|
||||
},
|
||||
{
|
||||
@ -203,8 +205,8 @@ export const SettingsObjectFieldEdit = () => {
|
||||
<SettingsPageContainer>
|
||||
<Section>
|
||||
<H2Title
|
||||
title="Icon and Name"
|
||||
description="The name and icon of this field"
|
||||
title={t`Icon and Name`}
|
||||
description={t`The name and icon of this field`}
|
||||
/>
|
||||
<SettingsDataModelFieldIconLabelForm
|
||||
disabled={!fieldMetadataItem.isCustom}
|
||||
@ -218,13 +220,13 @@ export const SettingsObjectFieldEdit = () => {
|
||||
<Section>
|
||||
{fieldMetadataItem.isUnique ? (
|
||||
<H2Title
|
||||
title="Values"
|
||||
description="The values of this field must be unique"
|
||||
title={t`Values`}
|
||||
description={t`The values of this field must be unique`}
|
||||
/>
|
||||
) : (
|
||||
<H2Title
|
||||
title="Values"
|
||||
description="The values of this field"
|
||||
title={t`Values`}
|
||||
description={t`The values of this field`}
|
||||
/>
|
||||
)}
|
||||
<SettingsDataModelFieldSettingsFormCard
|
||||
@ -234,8 +236,8 @@ export const SettingsObjectFieldEdit = () => {
|
||||
</Section>
|
||||
<Section>
|
||||
<H2Title
|
||||
title="Description"
|
||||
description="The description of this field"
|
||||
title={t`Description`}
|
||||
description={t`The description of this field`}
|
||||
/>
|
||||
<SettingsDataModelFieldDescriptionForm
|
||||
disabled={!fieldMetadataItem.isCustom}
|
||||
@ -245,15 +247,17 @@ export const SettingsObjectFieldEdit = () => {
|
||||
{!isLabelIdentifier && (
|
||||
<Section>
|
||||
<H2Title
|
||||
title="Danger zone"
|
||||
description="Deactivate this field"
|
||||
title={t`Danger zone`}
|
||||
description={t`Deactivate this field`}
|
||||
/>
|
||||
<Button
|
||||
Icon={
|
||||
fieldMetadataItem.isActive ? IconArchive : IconArchiveOff
|
||||
}
|
||||
variant="secondary"
|
||||
title={fieldMetadataItem.isActive ? 'Deactivate' : 'Activate'}
|
||||
title={
|
||||
fieldMetadataItem.isActive ? t`Deactivate` : t`Activate`
|
||||
}
|
||||
size="small"
|
||||
onClick={
|
||||
fieldMetadataItem.isActive
|
||||
|
||||
@ -22,6 +22,7 @@ import { View } from '@/views/types/View';
|
||||
import { ViewType } from '@/views/types/ViewType';
|
||||
import { useApolloClient } from '@apollo/client';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import pick from 'lodash.pick';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { FormProvider, useForm } from 'react-hook-form';
|
||||
@ -44,6 +45,8 @@ type SettingsDataModelNewFieldFormValues = z.infer<
|
||||
const DEFAULT_ICON_FOR_NEW_FIELD = 'IconUsers';
|
||||
|
||||
export const SettingsObjectNewFieldConfigure = () => {
|
||||
const { t } = useLingui();
|
||||
|
||||
const navigateApp = useNavigateApp();
|
||||
const navigate = useNavigateSettings();
|
||||
|
||||
@ -192,10 +195,16 @@ export const SettingsObjectNewFieldConfigure = () => {
|
||||
{...formConfig}
|
||||
>
|
||||
<SubMenuTopBarContainer
|
||||
title="2. Configure field"
|
||||
title={t`2. Configure field`}
|
||||
links={[
|
||||
{ children: 'Workspace', href: '/settings/workspace' },
|
||||
{ children: 'Objects', href: '/settings/objects' },
|
||||
{
|
||||
children: t`Workspace`,
|
||||
href: getSettingsPath(SettingsPath.Workspace),
|
||||
},
|
||||
{
|
||||
children: t`Objects`,
|
||||
href: getSettingsPath(SettingsPath.Objects),
|
||||
},
|
||||
{
|
||||
children: activeObjectMetadataItem.labelPlural,
|
||||
href: getSettingsPath(SettingsPath.ObjectDetail, {
|
||||
@ -227,8 +236,8 @@ export const SettingsObjectNewFieldConfigure = () => {
|
||||
<SettingsPageContainer>
|
||||
<Section>
|
||||
<H2Title
|
||||
title="Icon and Name"
|
||||
description="The name and icon of this field"
|
||||
title={t`Icon and Name`}
|
||||
description={t`The name and icon of this field`}
|
||||
/>
|
||||
<SettingsDataModelFieldIconLabelForm
|
||||
maxLength={FIELD_NAME_MAXIMUM_LENGTH}
|
||||
@ -238,7 +247,10 @@ export const SettingsObjectNewFieldConfigure = () => {
|
||||
/>
|
||||
</Section>
|
||||
<Section>
|
||||
<H2Title title="Values" description="The values of this field" />
|
||||
<H2Title
|
||||
title={t`Values`}
|
||||
description={t`The values of this field`}
|
||||
/>
|
||||
<SettingsDataModelFieldSettingsFormCard
|
||||
fieldMetadataItem={{
|
||||
icon: formConfig.watch('icon'),
|
||||
@ -251,8 +263,8 @@ export const SettingsObjectNewFieldConfigure = () => {
|
||||
</Section>
|
||||
<Section>
|
||||
<H2Title
|
||||
title="Description"
|
||||
description="The description of this field"
|
||||
title={t`Description`}
|
||||
description={t`The description of this field`}
|
||||
/>
|
||||
<SettingsDataModelFieldDescriptionForm />
|
||||
</Section>
|
||||
|
||||
Reference in New Issue
Block a user