From f7c0a4f8dd6ea7312b4560a95330d2ef4a15abb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rge=20N=C3=A6ss?= Date: Thu, 12 Oct 2023 21:41:39 +0200 Subject: [PATCH] fix(i18n): fix casing of i18n-keys in publish action --- dev/test-studio/plugins/locale-no-nb/bundles/desk.ts | 10 +++++----- .../src/desk/documentActions/PublishAction.tsx | 12 ++++++------ packages/sanity/src/desk/i18n/resources.ts | 12 ++++++------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dev/test-studio/plugins/locale-no-nb/bundles/desk.ts b/dev/test-studio/plugins/locale-no-nb/bundles/desk.ts index 7fe9e8709e0..ca4e6a77d16 100644 --- a/dev/test-studio/plugins/locale-no-nb/bundles/desk.ts +++ b/dev/test-studio/plugins/locale-no-nb/bundles/desk.ts @@ -15,10 +15,10 @@ const deskResources: Record = { 'action.publish.published.label': 'Publisert', /** Label for the "Publish" document action when the document has live edit enabled.*/ - 'action.publish.liveEdit.label': 'Publiser', + 'action.publish.live-edit.label': 'Publiser', /** Tooltip for the "Publish" document action when the document has live edit enabled.*/ - 'action.publish.liveEdit.tooltip': + 'action.publish.live-edit.tooltip': '"Live Edit" er skrudd på for denne dokumenttypen og publisering skjer automatisk når du gjør endringer', /** Fallback tooltip for the "Publish" document action when publish is invoked for a document with live edit enabled.*/ @@ -26,17 +26,17 @@ const deskResources: Record = { 'Kan ikke publisere fordi "Live Edit" er skrudd på for denne dokumenttypen.', /** Tooltip when the "Publish" document action is disabled due to validation issues */ - 'action.publish.validationIssues.tooltip': + 'action.publish.validation-issues.tooltip': 'Valideringsfeil som må rettes før dokumentet kan publiseres', /** Tooltip when publish button is disabled because the document is already published.*/ - 'action.publish.alreadyPublished.tooltip': 'Publisert for {{timeSincePublished}} siden', + 'action.publish.already-published.tooltip': 'Publisert for {{timeSincePublished}} siden', /** Tooltip when publish button is disabled because the document is already published, and published time is unavailable.*/ 'action.publish.already-published.no-time-ago.tooltip': 'Allerede publisert', /** Tooltip when publish button is disabled because there are no changes.*/ - 'action.publish.tooltip.noChanges': 'Ingen upubliserte endringer', + 'action.publish.tooltip.no-changes': 'Ingen upubliserte endringer', /** Tooltip when publish button is waiting for validation and async tasks to complete.*/ 'action.publish.waiting': 'Venter på at andre oppgaver skal fullføre', diff --git a/packages/sanity/src/desk/documentActions/PublishAction.tsx b/packages/sanity/src/desk/documentActions/PublishAction.tsx index ac375c4b259..0125fb27740 100644 --- a/packages/sanity/src/desk/documentActions/PublishAction.tsx +++ b/packages/sanity/src/desk/documentActions/PublishAction.tsx @@ -18,10 +18,10 @@ import { } from 'sanity' const DISABLED_REASON_TITLE_KEY: Record = { - LIVE_EDIT_ENABLED: 'action.publish.liveEdit.publishDisabled', - ALREADY_PUBLISHED: 'action.publish.alreadyPublished.noTimeAgo.tooltip', - NO_CHANGES: 'action.publish.tooltip.noChanges', - NOT_READY: 'action.publish.disabled.notReady', + LIVE_EDIT_ENABLED: 'action.publish.live-edit.publish-disabled', + ALREADY_PUBLISHED: 'action.publish.already-published.no-time-ago.tooltip', + NO_CHANGES: 'action.publish.tooltip.no-changes', + NOT_READY: 'action.publish.disabled.not-ready', } as const function getDisabledReason( @@ -143,8 +143,8 @@ export const PublishAction: DocumentActionComponent = (props) => { if (liveEdit) { return { tone: 'positive', - label: t('action.publish.liveEdit.label'), - title: t('action.publish.liveEdit.tooltip'), + label: t('action.publish.live-edit.label'), + title: t('action.publish.live-edit.tooltip'), disabled: true, } } diff --git a/packages/sanity/src/desk/i18n/resources.ts b/packages/sanity/src/desk/i18n/resources.ts index a8581e5f3c8..11c11a1fb1c 100644 --- a/packages/sanity/src/desk/i18n/resources.ts +++ b/packages/sanity/src/desk/i18n/resources.ts @@ -18,28 +18,28 @@ const deskLocaleStrings = { 'action.publish.published.label': 'Published', /** Label for the "Publish" document action when the document has live edit enabled.*/ - 'action.publish.liveEdit.label': 'Publish', + 'action.publish.live-edit.label': 'Publish', /** Tooltip for the "Publish" document action when the document has live edit enabled.*/ - 'action.publish.liveEdit.tooltip': + 'action.publish.live-edit.tooltip': 'Live Edit is enabled for this content type and publishing happens automatically as you make changes', /** Fallback tooltip for the "Publish" document action when publish is invoked for a document with live edit enabled.*/ - 'action.publish.liveEdit.publishDisabled': + 'action.publish.live-edit.publish-disabled': 'Cannot publish since liveEdit is enabled for this document type', /** Tooltip when the "Publish" document action is disabled due to validation issues */ - 'action.publish.validationIssues.tooltip': + 'action.publish.validation-issues.tooltip': 'There are validation errors that need to be fixed before this document can be published', /** Tooltip when publish button is disabled because the document is already published.*/ - 'action.publish.alreadyPublished.tooltip': 'Published {{timeSincePublished}} ago', + 'action.publish.already-published.tooltip': 'Published {{timeSincePublished}} ago', /** Tooltip when publish button is disabled because the document is already published, and published time is unavailable.*/ 'action.publish.already-published.no-time-ago.tooltip': 'Already published', /** Tooltip when publish button is disabled because there are no changes.*/ - 'action.publish.tooltip.noChanges': 'No unpublished changes', + 'action.publish.tooltip.no-changes': 'No unpublished changes', /** Tooltip when publish button is waiting for validation and async tasks to complete.*/ 'action.publish.waiting': 'Waiting for tasks to finish before publishing',