Skip to content

Localize property not working? #48

@wdtamagi

Description

@wdtamagi

Describe the bug

I notice even using the property localize: false into the fields I don't want to be send to translation is not working. Is this still working?

For reference: https://github.com/sanity-io/sanity-translations-tab/blob/main/docs/00-faq.md#how-can-i-prevent-certain-fields-from-being-sent-to-translation

I'm using the integration with Smartling and the structure looks strange at Smartling platform:

Image

My schema:

export const moduleVideoCarousel = {
	fields: [
		{
			name: "heading",
			title: "Heading",
			type: "string",
		},
		{
			name: "description",
			title: "Description",
			type: "simpleBlock",
		},
		{
			name: "slides",
			of: [
				{
					fields: [
						{
							name: "title",
							title: "Title",
							type: "string",
						},
						{
							name: "description",
							title: "Description",
							type: "typographyBlock",
						},
						{
							localize: false,
							name: "videoUrl",
							title: "Video URL",
							type: "string",
						},
					],
					name: "slide",
					preview: {
						prepare({ title }) {
							return {
								title,
							};
						},
						select: {
							title: "title",
						},
					},
					title: "Slide",
					type: "object",
				},
			],
			title: "Slides",
			type: "array",
		},
		{
			description: "Choose your background",
			localize: false,
			name: "background",
			title: "Background",
			to: [{ type: "background" }],
			type: "reference",
		},
		{
			initialValue: "spacious",
			localize: false,
			name: "margin",
			options: {
				list: [
					{ title: "Spacious", value: "spacious" },
					{ title: "Moderate", value: "moderate" },
					{ title: "Tight", value: "tight" },
				],
			},
			title: "Margin",
			type: "string",
		},
	],
	name: "moduleVideoCarousel",
	preview: {
		prepare({ title }) {
			return {
				title,
			};
		},
		select: {
			title: "heading",
		},
	},
	title: "Video Carousel",
	type: "object",
};

I'm using the localize: false at the margin field.

I'm doing something wrong? I was expecting to the margin field not be sent to Smartling and seems like the fields are mixed into html tags:

<span class="heading">Real videos by real people</span><span class="margin">spacious</span>

Where "heading" is one field and "margin" is another field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions