What I tried to achieve is to store nested component with partitioned fields for description, so only description should be localizable not other fields.
When I pass Dictionary<string,string> I’m getting error that even if field is localizable it’s expected as a string only.
var componentSchemaDto = new CreateSchemaDto
{
Name = name,
Fields = new List<UpsertSchemaFieldDto>
{
new()
{
Name = nameof(Description),
Properties = new StringFieldPropertiesDto(),
Partitioning = Partitioning.Language
},
new()
{
Name = nameof(TenantId),
Properties = new NumberFieldPropertiesDto()
}
...
},
Scripts = scripts,
Properties = new SchemaPropertiesDto { ValidateOnPublish = true },
IsPublished = true,
Type = SchemaType.Component
};
and main schema
var createSchemaDto = new CreateSchemaDto
{
Name = name,
Fields = new List<UpsertSchemaFieldDto>
{
new()
{
Name = nameof(Content),
Properties = new ComponentFieldPropertiesDto()
{
SchemaIds = new List<string> { "56a7d2cb-8ad3-47b3-b0ee-2c674723adf9" } // get this from squidex
}
},
new()
{
Name = nameof(Tags),
Properties = new TagsFieldPropertiesDto()
}},
Scripts = scripts,
Properties = new SchemaPropertiesDto { ValidateOnPublish = true},
IsPublished = true,
Type = SchemaType.Default,
};
and in model I’m using Dictionary for localizable field for Content component.
Is this proper way to set it up or I’m doing something wrong? Does localization works on component fields?