From 607b82bcac08fe56a6785bb48c4ad64be2e1f812 Mon Sep 17 00:00:00 2001 From: christinaroise Date: Thu, 26 Sep 2024 09:55:53 +0200 Subject: [PATCH] add translation to title --- studio/schemas/fields/text.ts | 2 +- .../schemas/objects/compensations/benefitsByLocation.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/studio/schemas/fields/text.ts b/studio/schemas/fields/text.ts index aac5ba766..0aca30990 100644 --- a/studio/schemas/fields/text.ts +++ b/studio/schemas/fields/text.ts @@ -2,7 +2,7 @@ import { StringRule, defineField } from "sanity"; import { StringInputWithCharacterCount } from "studio/components/stringInputWithCharacterCount/StringInputWithCharacterCount"; -enum titleID { +export enum titleID { basic = "basicTitle", optional = "optionalTitle", } diff --git a/studio/schemas/objects/compensations/benefitsByLocation.ts b/studio/schemas/objects/compensations/benefitsByLocation.ts index 5cf3da137..59ea99267 100644 --- a/studio/schemas/objects/compensations/benefitsByLocation.ts +++ b/studio/schemas/objects/compensations/benefitsByLocation.ts @@ -1,7 +1,7 @@ import { defineField } from "sanity"; import { companyLocationNameID } from "studio/schemas/documents/admin/companyLocation"; -import { richTextID, title } from "studio/schemas/fields/text"; +import { richTextID, titleID } from "studio/schemas/fields/text"; import { location, locationID } from "studio/schemas/objects/locations"; import { @@ -62,7 +62,10 @@ export const benefitsByLocation = defineField({ title: "Benefit", fields: [ benefitType, - title, + { + name: titleID.basic, + type: "internationalizedArrayString", + }, { name: richTextID, title: "Body", @@ -71,7 +74,7 @@ export const benefitsByLocation = defineField({ ], preview: { select: { - title: title.name, + title: titleID.basic, type: benefitType.name, }, prepare({ title, type }) {