1088f7bbab
## 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
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';
|
|
import { viewableRichTextComponentState } from '@/command-menu/pages/rich-text-page/states/viewableRichTextComponentState';
|
|
import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
|
|
import { t } from '@lingui/core/macro';
|
|
import { useCallback } from 'react';
|
|
import { useRecoilCallback } from 'recoil';
|
|
import { IconPencil } from 'twenty-ui/display';
|
|
|
|
export const useRichTextCommandMenu = () => {
|
|
const { navigateCommandMenu, openCommandMenu } = useCommandMenu();
|
|
|
|
const openRichTextInCommandMenu = useRecoilCallback(
|
|
({ set }) =>
|
|
({
|
|
activityId,
|
|
activityObjectNameSingular,
|
|
}: {
|
|
activityId: string;
|
|
activityObjectNameSingular: string;
|
|
}) => {
|
|
set(viewableRichTextComponentState, {
|
|
activityId,
|
|
activityObjectNameSingular,
|
|
});
|
|
|
|
openCommandMenu();
|
|
navigateCommandMenu({
|
|
page: CommandMenuPages.EditRichText,
|
|
pageTitle: t`Rich Text`,
|
|
pageIcon: IconPencil,
|
|
});
|
|
},
|
|
[navigateCommandMenu, openCommandMenu],
|
|
);
|
|
|
|
const editRichText = useCallback(
|
|
(activityId: string, activityObjectNameSingular: string) => {
|
|
openRichTextInCommandMenu({ activityId, activityObjectNameSingular });
|
|
},
|
|
[openRichTextInCommandMenu],
|
|
);
|
|
|
|
return {
|
|
editRichText,
|
|
};
|
|
};
|