From 2b09cdaff20baf454ee4b7de292ae2970026abb6 Mon Sep 17 00:00:00 2001 From: Tommy Petty Date: Fri, 3 Nov 2023 16:00:16 -0400 Subject: [PATCH] feat(i18n): updates translation for form/inputs/files --- .../files/FileInput/FileActionsMenu.tsx | 5 +- .../form/inputs/files/FileInput/FileInput.tsx | 27 ++++---- .../files/FileInput/InvalidFileWarning.tsx | 16 +++-- .../inputs/files/ImageInput/ImageInput.tsx | 12 ++-- .../files/ImageInput/InvalidImageWarning.tsx | 7 ++- .../files/ImageToolInput/ImageToolInput.tsx | 8 ++- .../form/inputs/files/common/DropMessage.tsx | 9 ++- .../inputs/files/common/UploadPlaceholder.tsx | 3 +- .../form/studio/inputs/StudioFileInput.tsx | 5 +- .../sanity/src/core/i18n/bundles/studio.ts | 62 +++++++++++++++++++ packages/sanity/test/form/renderFileInput.tsx | 1 + 11 files changed, 121 insertions(+), 34 deletions(-) diff --git a/packages/sanity/src/core/form/inputs/files/FileInput/FileActionsMenu.tsx b/packages/sanity/src/core/form/inputs/files/FileInput/FileActionsMenu.tsx index 7113c320d926..07156cd95605 100644 --- a/packages/sanity/src/core/form/inputs/files/FileInput/FileActionsMenu.tsx +++ b/packages/sanity/src/core/form/inputs/files/FileInput/FileActionsMenu.tsx @@ -13,6 +13,7 @@ import { useGlobalKeyDown, } from '@sanity/ui' import {formatBytes} from '../../common/helper' +import {useTranslation} from '../../../../i18n' type Props = { children: ReactNode @@ -87,6 +88,8 @@ export function FileActionsMenu(props: Props) { } }, [isMenuOpen, menuElement]) + const {t} = useTranslation('sanity') + return (