72e6710545
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. -->
14 lines
341 B
TypeScript
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);
|
|
};
|