feat: add lingui/no-unlocalized-strings ESLint rule and fix translations (#16610)
## Summary
This PR adds the `lingui/no-unlocalized-strings` ESLint rule to detect
untranslated strings and fixes translation issues across multiple
components.
## Changes
### ESLint Configuration (`eslint.config.react.mjs`)
- Added comprehensive `ignore` patterns for non-translatable strings
(CSS values, HTML attributes, technical identifiers)
- Added `ignoreNames` for props that don't need translation (className,
data-*, aria-*, etc.)
- Added `ignoreFunctions` for console methods, URL APIs, and other
non-user-facing functions
- Disabled rule for debug files, storybook, and test files
### Components Fixed (~19 files)
- Object record components (field inputs, pickers, merge dialogs)
- Settings components (accounts, admin panel)
- Serverless function components
- Record table and title cell components
## Status
🚧 **Work in Progress** - ~124 files remaining to fix
This PR is being submitted as draft to allow progressive fixing of
remaining translation issues.
## Testing
- Run `npx eslint "src/**/*.tsx"` in `packages/twenty-front` to check
remaining issues
This commit is contained in:
@@ -18,6 +18,7 @@ import { isDefined } from 'twenty-shared/utils';
|
||||
import { MOBILE_VIEWPORT } from 'twenty-ui/theme';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { type AllowedAddressSubField } from 'twenty-shared/types';
|
||||
import { useAddressAutocomplete } from '../hooks/useAddressAutocomplete';
|
||||
import { useCountryUtils } from '../hooks/useCountryUtils';
|
||||
@@ -309,7 +310,7 @@ export const AddressInput = ({
|
||||
autoFocus
|
||||
value={internalValue.addressStreet1 ?? ''}
|
||||
ref={inputRefs.addressStreet1}
|
||||
label="Address 1"
|
||||
label={t`Address 1`}
|
||||
fullWidth
|
||||
onChange={getChangeHandler('addressStreet1')}
|
||||
onFocus={getFocusHandler('addressStreet1')}
|
||||
@@ -326,7 +327,7 @@ export const AddressInput = ({
|
||||
<TextInput
|
||||
value={internalValue.addressStreet2 ?? ''}
|
||||
ref={inputRefs.addressStreet2}
|
||||
label="Address 2"
|
||||
label={t`Address 2`}
|
||||
fullWidth
|
||||
onChange={getChangeHandler('addressStreet2')}
|
||||
onFocus={getFocusHandler('addressStreet2')}
|
||||
@@ -338,7 +339,7 @@ export const AddressInput = ({
|
||||
<TextInput
|
||||
value={internalValue.addressCity ?? ''}
|
||||
ref={inputRefs.addressCity}
|
||||
label="City"
|
||||
label={t`City`}
|
||||
fullWidth
|
||||
onChange={getChangeHandler('addressCity')}
|
||||
onFocus={getFocusHandler('addressCity')}
|
||||
@@ -355,7 +356,7 @@ export const AddressInput = ({
|
||||
<TextInput
|
||||
value={internalValue.addressState ?? ''}
|
||||
ref={inputRefs.addressState}
|
||||
label="State"
|
||||
label={t`State`}
|
||||
fullWidth
|
||||
onChange={getChangeHandler('addressState')}
|
||||
onFocus={getFocusHandler('addressState')}
|
||||
@@ -367,7 +368,7 @@ export const AddressInput = ({
|
||||
<TextInput
|
||||
value={internalValue.addressPostcode ?? ''}
|
||||
ref={inputRefs.addressPostcode}
|
||||
label="Post Code"
|
||||
label={t`Post Code`}
|
||||
fullWidth
|
||||
onChange={getChangeHandler('addressPostcode')}
|
||||
onFocus={getFocusHandler('addressPostcode')}
|
||||
@@ -375,7 +376,7 @@ export const AddressInput = ({
|
||||
)}
|
||||
{isFieldInputInSubFieldsAddress('addressCountry') && (
|
||||
<CountrySelect
|
||||
label="Country"
|
||||
label={t`Country`}
|
||||
onChange={getChangeHandler('addressCountry')}
|
||||
selectedCountryName={internalValue.addressCountry ?? ''}
|
||||
/>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { styled } from '@linaria/react';
|
||||
import { useContext, useState } from 'react';
|
||||
|
||||
@@ -60,7 +61,7 @@ export const RatingInput = ({
|
||||
return (
|
||||
<StyledContainer
|
||||
role="slider"
|
||||
aria-label="Rating"
|
||||
aria-label={t`Rating`}
|
||||
aria-valuemax={RATING_VALUES.length}
|
||||
aria-valuemin={1}
|
||||
aria-valuenow={selectedIndex + 1}
|
||||
|
||||
Reference in New Issue
Block a user