Files
twenty/packages/twenty-front/src/modules/command-menu-item/utils/getCommandMenuItemLabel.ts
T
A 72e6710545 fix(twenty-front): resolve the command menu item i18n rendering issue (#23913)
The most command menus item labels are `string`. The original logic
prevent it form being translated.

Additionally, the `i18n._()` can handle both `string` and
`MessageDescriptor` type, so it's safe to remove this logic.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/23913?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
2026-08-07 16:16:32 +02:00

14 lines
341 B
TypeScript

import { i18n, type MessageDescriptor } from '@lingui/core';
import { type Nullable } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const getCommandMenuItemLabel = (
label: Nullable<string | MessageDescriptor>,
): string => {
if (!isDefined(label)) {
return '';
}
return i18n._(label);
};