From 4d02c2c37927af40ccf34f8f249a57be2594dc78 Mon Sep 17 00:00:00 2001 From: RitaDias Date: Tue, 29 Aug 2023 15:23:06 +0200 Subject: [PATCH] feat(core): add i18n primitives to ArrayOfObjectsInputMember --- .../src/core/form/members/array/ArrayOfObjectsInputMember.tsx | 2 +- packages/sanity/src/core/i18n/bundles/studio.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/sanity/src/core/form/members/array/ArrayOfObjectsInputMember.tsx b/packages/sanity/src/core/form/members/array/ArrayOfObjectsInputMember.tsx index d63f8cc2b94e..a1c7981caa3b 100644 --- a/packages/sanity/src/core/form/members/array/ArrayOfObjectsInputMember.tsx +++ b/packages/sanity/src/core/form/members/array/ArrayOfObjectsInputMember.tsx @@ -59,6 +59,6 @@ export function ArrayOfObjectsInputMember(props: ArrayOfObjectsMemberProps) { } //@ts-expect-error The branching above should cover all possible cases - console.warn(new Error(`Unhandled member kind ${member.kind}`)) + console.warn(new Error(t('arrayInput.warning.unhandled-member-kind', {kind: member.kind}))) return null } diff --git a/packages/sanity/src/core/i18n/bundles/studio.ts b/packages/sanity/src/core/i18n/bundles/studio.ts index bff1c3938391..128e6d054494 100644 --- a/packages/sanity/src/core/i18n/bundles/studio.ts +++ b/packages/sanity/src/core/i18n/bundles/studio.ts @@ -610,6 +610,9 @@ export const studioLocaleStrings = { /** Error label for toast when array could not resolve the initial value */ 'arrayInput.error.cannot-resolve-initial-value-title': 'Unable to resolve initial value for type: {{schemaTypeTitle}}: {{errorMessage}}.', + + /** warning label for when there is an unhandled member kind in an array of objects input */ + 'arrayInput.warning.unhandled-member-kind': 'Unhandled member kind {{kind}}', } /**