From eecd0c553f909856cf8d3e6415192a96e3711cc1 Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Thu, 5 Dec 2024 09:49:53 -0800 Subject: [PATCH] fix: reword warning about vector images not support crop/hotspot (#7960) --- .../inputs/files/ImageToolInput/ImageToolInput.tsx | 6 +++--- packages/sanity/src/core/i18n/bundles/studio.ts | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/sanity/src/core/form/inputs/files/ImageToolInput/ImageToolInput.tsx b/packages/sanity/src/core/form/inputs/files/ImageToolInput/ImageToolInput.tsx index 1ca7f6424d1..97b264ab159 100644 --- a/packages/sanity/src/core/form/inputs/files/ImageToolInput/ImageToolInput.tsx +++ b/packages/sanity/src/core/form/inputs/files/ImageToolInput/ImageToolInput.tsx @@ -127,12 +127,12 @@ export function ImageToolInput(props: ImageToolInputProps) { <> - {t('inputs.imagetool.svg-warning.title')} -
+ {t('inputs.imagetool.vector-warning.title')} +
( diff --git a/packages/sanity/src/core/i18n/bundles/studio.ts b/packages/sanity/src/core/i18n/bundles/studio.ts index a46947ec027..1dfd634d41c 100644 --- a/packages/sanity/src/core/i18n/bundles/studio.ts +++ b/packages/sanity/src/core/i18n/bundles/studio.ts @@ -653,15 +653,15 @@ export const studioLocaleStrings = defineLocalesResources('studio', { 'Adjust the rectangle to crop image. Adjust the circle to specify the area that should always be visible.', /** Error: `{{errorMessage}}` */ 'inputs.imagetool.load-error': 'Error: {{errorMessage}}', - /** SVG images are not adjusted for hotspot and crop when served from the Sanity image. If you want the below hotspot and crop settings to apply, make sure to append `fp=jpg` to the image url, or call `format('jpg')` if using `@sanity/image-url` */ - 'inputs.imagetool.svg-warning.developer-info': `The Asset Pipeline does not support hotspot and crop for SVG as an output image format. To enable hotspot & crop, output this image to any of the supported bitmap formats. For example: fm=jpg to the Image URL or call .format('png') with @sanity/image-url.`, - /** See developer info */ - 'inputs.imagetool.svg-warning.expand-developer-info': 'See developer info', - /** Gotcha: Serving SVGs with hotspot and crop from the Sanity Image API */ - 'inputs.imagetool.svg-warning.title': - "Warning: Hotspot and crop might not be applied to this image where it's presented.", /** Hotspot & Crop */ 'inputs.imagetool.title': 'Hotspot & Crop', + /** Warnings displayed to developers when using the crop/hotspot tool on vector images, notifying them that crops/hotspot are not respected when serving the image in vector format. For the crop/hotspot to apply, images must be served in a raster format such as JPG or PNG, by appending eg `fm=jpg` to the image url, or calling `format('jpg')` if using `@sanity/image-url` */ + 'inputs.imagetool.vector-warning.developer-info': `The Asset Pipeline does not support hotspot and crop for vector formats. To enable hotspot & crop, output this image to any of the supported raster formats. For example: fm=jpg to the image URL or call .format('png') with @sanity/image-url.`, + /** See developer info */ + 'inputs.imagetool.vector-warning.expand-developer-info': 'See developer info', + /** Gotcha: Serving vector images with hotspot and crop from the Sanity Image API */ + 'inputs.imagetool.vector-warning.title': + "Warning: Hotspot and crop might not be applied to this image where it's presented.", /** Convert to `{{targetType}}` */ 'inputs.invalid-value.convert-button.text': 'Convert to {{targetType}}', /** The current value (`{{actualType}}`) */