I’m using sanity as a CMS for my project with sanity-plugin-internationalized-array for the internationalization feature .
This is my config :
// sanity.config.ts
export default defineConfig({
name: 'default',
title: 'project',
projectId: 'project_id',
dataset: 'production',
plugins: [
internationalizedArray({
languages: [
{id: 'en', title: 'English'},
{id: 'fr', title: 'French'}
],
defaultLanguages: ['en'],
fieldTypes: ['string'],
}),
})
// document/project.js
export default defineType({
name: 'project.category',
title: 'Project category',
type: 'document',
icon: GoProject,
fields: [
defineField({
name: 'name',
type: 'string',
}),
defineField({
name: 'title',
type: 'internationalizedArrayString',
}),
defineField({
name: 'body',
type: 'array',
of: [
{ type: 'block' },
imageBlock,
defineArrayMember({
type: 'code',
options: {
withFilename: true,
},
}),
],
}),
],
})
How to make type: ‘block’ input accept the internationalizedArrayString type ?