Add missing translations (#10414)
As per title, add ~200 missing translations in different places of app. Most places are now available for translation with AI but still some aren't available - some enums (like in MenuItemSelectColor.tsx) or values in complex types (like in SettingsNonCompositeFieldTypeConfigs.ts) or values where are injected some variables (like in SettingsDataModelFieldNumberForm.tsx) --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@ -9,6 +9,7 @@ import { IconCircleOff, IconComponentProps, IconMap } from 'twenty-ui';
|
||||
import { z } from 'zod';
|
||||
import { applySimpleQuotesToString } from '~/utils/string/applySimpleQuotesToString';
|
||||
import { stripSimpleQuotesFromString } from '~/utils/string/stripSimpleQuotesFromString';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
type SettingsDataModelFieldAddressFormProps = {
|
||||
disabled?: boolean;
|
||||
defaultCountry?: string;
|
||||
@ -30,6 +31,7 @@ export const SettingsDataModelFieldAddressForm = ({
|
||||
disabled,
|
||||
fieldMetadataItem,
|
||||
}: SettingsDataModelFieldAddressFormProps) => {
|
||||
const { t } = useLingui();
|
||||
const { control } = useFormContext<SettingsDataModelFieldTextFormValues>();
|
||||
const countries = [
|
||||
{
|
||||
@ -71,8 +73,8 @@ export const SettingsDataModelFieldAddressForm = ({
|
||||
return (
|
||||
<SettingsOptionCardContentSelect
|
||||
Icon={IconMap}
|
||||
title="Default Country"
|
||||
description="The default country for new addresses"
|
||||
title={t`Default Country`}
|
||||
description={t`The default country for new addresses`}
|
||||
>
|
||||
<Select<string>
|
||||
dropdownWidth={220}
|
||||
|
||||
@ -6,6 +6,7 @@ import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
|
||||
import { SettingsOptionCardContentSelect } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSelect';
|
||||
import { useBooleanSettingsFormInitialValues } from '@/settings/data-model/fields/forms/boolean/hooks/useBooleanSettingsFormInitialValues';
|
||||
import { Select } from '@/ui/input/components/Select';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
|
||||
export const settingsDataModelFieldBooleanFormSchema = z.object({
|
||||
defaultValue: z.boolean(),
|
||||
@ -22,6 +23,7 @@ type SettingsDataModelFieldBooleanFormProps = {
|
||||
export const SettingsDataModelFieldBooleanForm = ({
|
||||
fieldMetadataItem,
|
||||
}: SettingsDataModelFieldBooleanFormProps) => {
|
||||
const { t } = useLingui();
|
||||
const { control } = useFormContext<SettingsDataModelFieldBooleanFormValues>();
|
||||
|
||||
const { initialDefaultValue } = useBooleanSettingsFormInitialValues({
|
||||
@ -36,8 +38,8 @@ export const SettingsDataModelFieldBooleanForm = ({
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<SettingsOptionCardContentSelect
|
||||
Icon={IconCheck}
|
||||
title="Default Value"
|
||||
description="Select the default value for this boolean field"
|
||||
title={t`Default Value`}
|
||||
description={t`Select the default value for this boolean field`}
|
||||
>
|
||||
<Select<boolean>
|
||||
value={value}
|
||||
@ -48,12 +50,12 @@ export const SettingsDataModelFieldBooleanForm = ({
|
||||
options={[
|
||||
{
|
||||
value: true,
|
||||
label: 'True',
|
||||
label: t`True`,
|
||||
Icon: IconCheck,
|
||||
},
|
||||
{
|
||||
value: false,
|
||||
label: 'False',
|
||||
label: t`False`,
|
||||
Icon: IconX,
|
||||
},
|
||||
]}
|
||||
|
||||
@ -5,6 +5,7 @@ import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
|
||||
import { fieldMetadataItemSchema } from '@/object-metadata/validation-schemas/fieldMetadataItemSchema';
|
||||
|
||||
import { TextArea } from '@/ui/input/components/TextArea';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
export const settingsDataModelFieldDescriptionFormSchema = () => {
|
||||
return fieldMetadataItemSchema([]).pick({
|
||||
@ -35,7 +36,7 @@ export const SettingsDataModelFieldDescriptionForm = ({
|
||||
defaultValue={fieldMetadataItem?.description}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<TextArea
|
||||
placeholder="Write a description"
|
||||
placeholder={t`Write a description`}
|
||||
minRows={4}
|
||||
value={value ?? undefined}
|
||||
onChange={onChange}
|
||||
|
||||
@ -20,6 +20,7 @@ import { H2Title, IconSearch, UndecoratedLink } from 'twenty-ui';
|
||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||
import { SettingsDataModelFieldTypeFormValues } from '~/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldSelect';
|
||||
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
type SettingsObjectNewFieldSelectorProps = {
|
||||
className?: string;
|
||||
@ -107,7 +108,7 @@ export const SettingsObjectNewFieldSelector = ({
|
||||
<Section>
|
||||
<StyledSearchInput
|
||||
LeftIcon={IconSearch}
|
||||
placeholder="Search a type"
|
||||
placeholder={t`Search a type`}
|
||||
value={searchQuery}
|
||||
onChange={setSearchQuery}
|
||||
/>
|
||||
|
||||
@ -5,6 +5,7 @@ import { SettingsOptionCardContentSelect } from '@/settings/components/SettingsO
|
||||
import { Select } from '@/ui/input/components/Select';
|
||||
import { IconTextWrap } from 'twenty-ui';
|
||||
import { z } from 'zod';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
type SettingsDataModelFieldTextFormProps = {
|
||||
disabled?: boolean;
|
||||
@ -45,8 +46,8 @@ export const SettingsDataModelFieldTextForm = ({
|
||||
<>
|
||||
<SettingsOptionCardContentSelect
|
||||
Icon={IconTextWrap}
|
||||
title="Wrap on record pages"
|
||||
description="Display text on multiple lines"
|
||||
title={t`Wrap on record pages`}
|
||||
description={t`Display text on multiple lines`}
|
||||
>
|
||||
<Select<number>
|
||||
dropdownId="text-wrap"
|
||||
@ -55,23 +56,23 @@ export const SettingsDataModelFieldTextForm = ({
|
||||
disabled={disabled}
|
||||
options={[
|
||||
{
|
||||
label: 'Deactivated',
|
||||
label: t`Deactivated`,
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: 'First 2 lines',
|
||||
label: t`First 2 lines`,
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: 'First 5 lines',
|
||||
label: t`First 5 lines`,
|
||||
value: 5,
|
||||
},
|
||||
{
|
||||
label: 'First 10 lines',
|
||||
label: t`First 10 lines`,
|
||||
value: 10,
|
||||
},
|
||||
{
|
||||
label: 'All lines',
|
||||
label: t`All lines`,
|
||||
value: 99,
|
||||
},
|
||||
]}
|
||||
|
||||
@ -9,6 +9,7 @@ import { useCurrencySettingsFormInitialValues } from '@/settings/data-model/fiel
|
||||
import { Select } from '@/ui/input/components/Select';
|
||||
import { IconCurrencyDollar } from 'twenty-ui';
|
||||
import { applySimpleQuotesToString } from '~/utils/string/applySimpleQuotesToString';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
|
||||
export const settingsDataModelFieldCurrencyFormSchema = z.object({
|
||||
defaultValue: currencyFieldDefaultValueSchema,
|
||||
@ -35,6 +36,7 @@ export const SettingsDataModelFieldCurrencyForm = ({
|
||||
disabled,
|
||||
fieldMetadataItem,
|
||||
}: SettingsDataModelFieldCurrencyFormProps) => {
|
||||
const { t } = useLingui();
|
||||
const { control } =
|
||||
useFormContext<SettingsDataModelFieldCurrencyFormValues>();
|
||||
|
||||
@ -56,8 +58,8 @@ export const SettingsDataModelFieldCurrencyForm = ({
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<SettingsOptionCardContentSelect
|
||||
Icon={IconCurrencyDollar}
|
||||
title="Default Value"
|
||||
description="Choose the default currency that will apply"
|
||||
title={t`Default Value`}
|
||||
description={t`Choose the default currency that will apply`}
|
||||
>
|
||||
<Select<string>
|
||||
dropdownWidth={220}
|
||||
|
||||
@ -9,6 +9,7 @@ import { SettingsOptionCardContentSelect } from '@/settings/components/SettingsO
|
||||
import { Select } from '@/ui/input/components/Select';
|
||||
import { IconDecimal, IconEye, IconNumber9, IconPercentage } from 'twenty-ui';
|
||||
import { DEFAULT_DECIMAL_VALUE } from '~/utils/format/number';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
export const settingsDataModelFieldNumberFormSchema = z.object({
|
||||
settings: numberFieldDefaultValueSchema,
|
||||
@ -49,8 +50,8 @@ export const SettingsDataModelFieldNumberForm = ({
|
||||
<>
|
||||
<SettingsOptionCardContentSelect
|
||||
Icon={IconEye}
|
||||
title="Number type"
|
||||
description="Display as a plain number or a percentage"
|
||||
title={t`Number type`}
|
||||
description={t`Display as a plain number or a percentage`}
|
||||
>
|
||||
<Select<string>
|
||||
selectSizeVariant="small"
|
||||
@ -63,12 +64,12 @@ export const SettingsDataModelFieldNumberForm = ({
|
||||
options={[
|
||||
{
|
||||
Icon: IconNumber9,
|
||||
label: 'Number',
|
||||
label: t`Number`,
|
||||
value: 'number',
|
||||
},
|
||||
{
|
||||
Icon: IconPercentage,
|
||||
label: 'Percentage',
|
||||
label: t`Percentage`,
|
||||
value: 'percentage',
|
||||
},
|
||||
]}
|
||||
@ -77,7 +78,7 @@ export const SettingsDataModelFieldNumberForm = ({
|
||||
<Separator />
|
||||
<SettingsOptionCardContentCounter
|
||||
Icon={IconDecimal}
|
||||
title="Number of decimals"
|
||||
title={t`Number of decimals`}
|
||||
description={`E.g. ${(type === 'percentage' ? 99 : 1000).toFixed(count)}${type === 'percentage' ? '%' : ''} for ${count} decimal${count > 1 ? 's' : ''}`}
|
||||
value={count}
|
||||
onChange={(value) => onChange({ type: type, decimals: value })}
|
||||
|
||||
@ -11,6 +11,7 @@ import { IconCircleOff, IconComponentProps, IconMap } from 'twenty-ui';
|
||||
import { z } from 'zod';
|
||||
import { applySimpleQuotesToString } from '~/utils/string/applySimpleQuotesToString';
|
||||
import { stripSimpleQuotesFromString } from '~/utils/string/stripSimpleQuotesFromString';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
|
||||
type SettingsDataModelFieldPhonesFormProps = {
|
||||
disabled?: boolean;
|
||||
@ -35,10 +36,11 @@ export const SettingsDataModelFieldPhonesForm = ({
|
||||
disabled,
|
||||
fieldMetadataItem,
|
||||
}: SettingsDataModelFieldPhonesFormProps) => {
|
||||
const { t } = useLingui();
|
||||
const { control } = useFormContext<SettingsDataModelFieldTextFormValues>();
|
||||
|
||||
const countries = [
|
||||
{ label: 'No country', value: '', Icon: IconCircleOff },
|
||||
{ label: t`No country`, value: '', Icon: IconCircleOff },
|
||||
...useCountries()
|
||||
.sort((a, b) => a.countryName.localeCompare(b.countryName))
|
||||
.map((country) => ({
|
||||
@ -68,8 +70,8 @@ export const SettingsDataModelFieldPhonesForm = ({
|
||||
return (
|
||||
<SettingsOptionCardContentSelect
|
||||
Icon={IconMap}
|
||||
title="Default Country Code"
|
||||
description="The default country code for new phone numbers."
|
||||
title={t`Default Country Code`}
|
||||
description={t`The default country code for new phone numbers.`}
|
||||
>
|
||||
<Select<string>
|
||||
dropdownWidth={'auto'}
|
||||
|
||||
@ -17,6 +17,7 @@ import { Select } from '@/ui/input/components/Select';
|
||||
import { TextInput } from '@/ui/input/components/TextInput';
|
||||
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
||||
import { RelationDefinitionType } from '~/generated-metadata/graphql';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
|
||||
export const settingsDataModelFieldRelationFormSchema = z.object({
|
||||
relation: z.object({
|
||||
@ -93,6 +94,7 @@ export const SettingsDataModelFieldRelationForm = ({
|
||||
fieldMetadataItem,
|
||||
objectMetadataItem,
|
||||
}: SettingsDataModelFieldRelationFormProps) => {
|
||||
const { t } = useLingui();
|
||||
const { control, watch: watchFormValue } =
|
||||
useFormContext<SettingsDataModelFieldRelationFormValues>();
|
||||
const { getIcon } = useIcons();
|
||||
@ -133,7 +135,7 @@ export const SettingsDataModelFieldRelationForm = ({
|
||||
defaultValue={initialRelationType}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Select
|
||||
label="Relation type"
|
||||
label={t`Relation type`}
|
||||
dropdownId="relation-type-select"
|
||||
fullWidth
|
||||
disabled={disableRelationEdition}
|
||||
@ -149,7 +151,7 @@ export const SettingsDataModelFieldRelationForm = ({
|
||||
defaultValue={initialRelationObjectMetadataItem.id}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<Select
|
||||
label="Object destination"
|
||||
label={t`Object destination`}
|
||||
dropdownId="object-destination-select"
|
||||
fullWidth
|
||||
disabled={disableRelationEdition}
|
||||
@ -194,7 +196,7 @@ export const SettingsDataModelFieldRelationForm = ({
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<TextInput
|
||||
disabled={disableFieldEdition}
|
||||
placeholder="Field name"
|
||||
placeholder={t`Field name`}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
fullWidth
|
||||
|
||||
@ -32,6 +32,7 @@ import { AdvancedSettingsWrapper } from '@/settings/components/AdvancedSettingsW
|
||||
import { isAdvancedModeEnabledState } from '@/ui/navigation/navigation-drawer/states/isAdvancedModeEnabledState';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { SettingsDataModelFieldSelectFormOptionRow } from './SettingsDataModelFieldSelectFormOptionRow';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
export const settingsDataModelFieldSelectFormSchema = z.object({
|
||||
defaultValue: selectFieldDefaultValueSchema(),
|
||||
@ -259,13 +260,13 @@ export const SettingsDataModelFieldSelectForm = ({
|
||||
fill={MAIN_COLORS.yellow}
|
||||
/>
|
||||
</StyledIconContainer>
|
||||
<StyledApiKey>API values</StyledApiKey>
|
||||
<StyledApiKey>{t`API values`}</StyledApiKey>
|
||||
</StyledApiKeyContainer>
|
||||
</AdvancedSettingsWrapper>
|
||||
<StyledOptionsLabel
|
||||
isAdvancedModeEnabled={isAdvancedModeEnabled}
|
||||
>
|
||||
Options
|
||||
{t`Options`}
|
||||
</StyledOptionsLabel>
|
||||
</StyledLabelContainer>
|
||||
<DraggableList
|
||||
@ -331,7 +332,7 @@ export const SettingsDataModelFieldSelectForm = ({
|
||||
</StyledContainer>
|
||||
<StyledFooter>
|
||||
<StyledButton
|
||||
title="Add option"
|
||||
title={t`Add option`}
|
||||
Icon={IconPlus}
|
||||
onClick={handleAddOption}
|
||||
/>
|
||||
|
||||
@ -21,6 +21,7 @@ import {
|
||||
MenuItemSelectColor,
|
||||
} from 'twenty-ui';
|
||||
import { computeOptionValueFromLabel } from '~/pages/settings/data-model/utils/compute-option-value-from-label.utils';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
type SettingsDataModelFieldSelectFormOptionRowProps = {
|
||||
className?: string;
|
||||
@ -168,7 +169,7 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({
|
||||
{isDefault ? (
|
||||
<MenuItem
|
||||
LeftIcon={IconX}
|
||||
text="Remove as default"
|
||||
text={t`Remove as default`}
|
||||
onClick={() => {
|
||||
onRemoveAsDefault?.();
|
||||
closeActionsDropdown();
|
||||
@ -177,7 +178,7 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({
|
||||
) : (
|
||||
<MenuItem
|
||||
LeftIcon={IconCheck}
|
||||
text="Set as default"
|
||||
text={t`Set as default`}
|
||||
onClick={() => {
|
||||
onSetAsDefault?.();
|
||||
closeActionsDropdown();
|
||||
@ -188,7 +189,7 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({
|
||||
<MenuItem
|
||||
accent="danger"
|
||||
LeftIcon={IconTrash}
|
||||
text="Remove option"
|
||||
text={t`Remove option`}
|
||||
onClick={() => {
|
||||
onRemove();
|
||||
closeActionsDropdown();
|
||||
|
||||
Reference in New Issue
Block a user