Skip to content

Commit

Permalink
fix(i18n): camelCase to kebab-case for resource ids (#4994)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpetty authored and rexxars committed Nov 28, 2023
1 parent 6955a1b commit fc11711
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/sanity/src/desk/documentActions/DeleteAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
} from 'sanity'

const DISABLED_REASON_TITLE_KEY = {
NOTHING_TO_DELETE: 'action.delete.disabled.nothingToDelete',
NOT_READY: 'action.delete.disabled.notReady',
NOTHING_TO_DELETE: 'action.delete.disabled.nothing-to-delete',
NOT_READY: 'action.delete.disabled.not-ready',
}

/** @internal */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
} from 'sanity'

const DISABLED_REASON_KEY = {
NO_CHANGES: 'action.discardChanges.disabled.noChanges',
NOT_PUBLISHED: 'action.discardChanges.disabled.notPublished',
NOT_READY: 'action.discardChanges.disabled.notReady',
NO_CHANGES: 'action.discard-changes.disabled.no-changes',
NOT_PUBLISHED: 'action.discard-changes.disabled.not-published',
NOT_READY: 'action.discard-changes.disabled.not-ready',
} as const

/** @internal */
Expand Down Expand Up @@ -54,7 +54,7 @@ export const DiscardChangesAction: DocumentActionComponent = ({
tone: 'critical',
onCancel: onComplete,
onConfirm: handleConfirm,
message: t('action.discardChanges.confirmDialog.confirm-discard-changes'),
message: t('action.discard-changes.confirm-dialog.confirm-discard-changes'),
},
[handleConfirm, isConfirmDialogOpen, onComplete, t],
)
Expand All @@ -68,7 +68,7 @@ export const DiscardChangesAction: DocumentActionComponent = ({
tone: 'critical',
icon: ResetIcon,
disabled: true,
label: t('action.discardChanges.label'),
label: t('action.discard-changes.label'),
title: (
<InsufficientPermissionsMessage
operationLabel="discard changes in this document"
Expand All @@ -83,7 +83,7 @@ export const DiscardChangesAction: DocumentActionComponent = ({
icon: ResetIcon,
disabled: Boolean(discardChanges.disabled) || isPermissionsLoading,
title: (discardChanges.disabled && DISABLED_REASON_KEY[discardChanges.disabled]) || '',
label: t('action.discardChanges.label'),
label: t('action.discard-changes.label'),
onHandle: handle,
dialog,
}
Expand Down
4 changes: 2 additions & 2 deletions packages/sanity/src/desk/documentActions/DuplicateAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
} from 'sanity'

const DISABLED_REASON_KEY = {
NOTHING_TO_DUPLICATE: 'action.duplicate.disabled.nothingToDuplicate',
NOT_READY: 'action.duplicate.disabled.notReady',
NOTHING_TO_DUPLICATE: 'action.duplicate.disabled.nothing-to-duplicate',
NOT_READY: 'action.duplicate.disabled.not-ready',
}

/** @internal */
Expand Down
4 changes: 2 additions & 2 deletions packages/sanity/src/desk/documentActions/PublishAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function getDisabledReason(
function AlreadyPublished({publishedAt}: {publishedAt: string}) {
const {t} = useTranslation(deskLocaleNamespace)
const timeSincePublished = useTimeAgo(publishedAt)
return <span>{t('action.publish.alreadyPublished.tooltip', {timeSincePublished})}</span>
return <span>{t('action.publish.already-published.tooltip', {timeSincePublished})}</span>
}

/** @internal */
Expand Down Expand Up @@ -72,7 +72,7 @@ export const PublishAction: DocumentActionComponent = (props) => {
const title = publish.disabled
? getDisabledReason(publish.disabled, (published || {})._updatedAt, t) || ''
: hasValidationErrors
? t('action.publish.validationIssues.tooltip')
? t('action.publish.validation-issues.tooltip')
: ''

const hasDraft = Boolean(draft)
Expand Down
6 changes: 3 additions & 3 deletions packages/sanity/src/desk/documentActions/UnpublishAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
} from 'sanity'

const DISABLED_REASON_KEY = {
NOT_PUBLISHED: 'action.unpublish.disabled.notPublished',
NOT_READY: 'action.unpublish.disabled.notReady',
LIVE_EDIT_ENABLED: 'action.unpublish.disabled.liveEditEnabled',
NOT_PUBLISHED: 'action.unpublish.disabled.not-published',
NOT_READY: 'action.unpublish.disabled.not-ready',
LIVE_EDIT_ENABLED: 'action.unpublish.disabled.live-edit-enabled',
}

/** @internal */
Expand Down

0 comments on commit fc11711

Please sign in to comment.