Skip to content

Commit

Permalink
fix(i18n): fix casing of i18n-keys in publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Oct 12, 2023
1 parent abbceac commit f7c0a4f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions dev/test-studio/plugins/locale-no-nb/bundles/desk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ const deskResources: Record<DeskLocaleResourceKeys, string> = {
'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.*/
'action.publish.live-edit.publish-disabled':
'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',
Expand Down
12 changes: 6 additions & 6 deletions packages/sanity/src/desk/documentActions/PublishAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import {
} from 'sanity'

const DISABLED_REASON_TITLE_KEY: Record<string, DeskLocaleResourceKeys> = {
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(
Expand Down Expand Up @@ -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,
}
}
Expand Down
12 changes: 6 additions & 6 deletions packages/sanity/src/desk/i18n/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit f7c0a4f

Please sign in to comment.