Skip to content

Commit

Permalink
chore(sanity): remove unused bundle translations
Browse files Browse the repository at this point in the history
  • Loading branch information
RitaDias committed Sep 10, 2024
1 parent 21d5fea commit 1408182
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function ReleaseActions(props: ReleaseActionsProps): ReactNode {
description: (
<Translate
t={t}
i18nKey={'bundle.action.discard-version.success'}
i18nKey={'release.action.discard-version.success'}
values={{title: document.title as string}}
/>
),
Expand All @@ -124,7 +124,7 @@ export function ReleaseActions(props: ReleaseActionsProps): ReactNode {
toast.push({
closable: true,
status: 'error',
title: t('bundle.action.discard-version.failure'),
title: t('release.action.discard-version.failure'),
})
}

Expand All @@ -135,13 +135,13 @@ export function ReleaseActions(props: ReleaseActionsProps): ReactNode {

const bundleActionButtonProps = isInVersion
? {
text: t('bundle.action.discard-version', {title}),
text: t('release.action.discard-version', {title}),
icon: TrashIcon,
tone: 'caution' as const,
onClick: handleDiscardVersion,
}
: {
text: t('bundle.action.add-to-release', {title}),
text: t('release.action.add-to-release', {title}),
icon: AddIcon,
tone: 'primary' as const,
onClick: handleAddVersion,
Expand Down
35 changes: 7 additions & 28 deletions packages/sanity/src/core/i18n/bundles/studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,34 +118,6 @@ export const studioLocaleStrings = defineLocalesResources('studio', {
/** Label when a release has been deleted by a different user */
'banners.deleted-bundle-banner.text':
"The '<strong>{{title}}</strong>' release has been deleted.",
/** Action message to add document to release */
'bundle.action.add-to-release': 'Add to {{title}}',
/** Action message for creating releases */
'bundle.action.create': 'Create release',
/** Action message for when document is already in release */
'bundle.action.discard-version': 'Discard version',
/** Description for toast when version discarding failed */
'bundle.action.discard-version.failure': 'Failed to discard version',
/** Description for toast when version deletion is successfully discarded */
'bundle.action.discard-version.success':
'<strong>{{title}}</strong> version was successfully discarded',

/** Label for tooltip on deleted release */
'bundle.deleted-tooltip': 'This release has been deleted',
/** Title for creating releases dialog */
'bundle.dialog.create.title': 'Create release',
/** Title for editing releases dialog */
'bundle.dialog.edit.title': 'Edit release',
/** Label for the description form field when creating releases */
'bundle.form.description': 'Description',
/** Placeholder for the icon and colour picker */
'bundle.form.search-icon': 'Search icons',
/** Tooltip label for the icon display */
'bundle.form.search-icon-tooltip': 'Select release icon',
/** Label for the title form field when creating releases */
'bundle.form.title': 'Title',
/** Tooltip for the dropdown to show all versions of document */
'bundle.version-list.tooltip': 'See all document versions',

/** Action message for navigating to next month */
'calendar.action.go-to-next-month': 'Go to next month',
Expand Down Expand Up @@ -1162,6 +1134,13 @@ export const studioLocaleStrings = defineLocalesResources('studio', {
'release.action.already-in-release': 'Already in release {{title}}',
/** Action message for creating releases */
'release.action.create': 'Create release',
/** Action message for when document is already in release */
'release.action.discard-version': 'Discard version',
/** Description for toast when version discarding failed */
'release.action.discard-version.failure': 'Failed to discard version',
/** Description for toast when version deletion is successfully discarded */
'release.action.discard-version.success':
'<strong>{{title}}</strong> version was successfully discarded',
/** Label for tooltip on deleted release */
'release.deleted-tooltip': 'This release has been deleted',
/** Title for creating releases dialog */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const DocumentActions = memo(
description: (
<Translate
t={coreT}
i18nKey={'bundle.action.discard-version.success'}
i18nKey={'release.action.discard-version.success'}
values={{title: document.document.title as string}}
/>
),
Expand All @@ -49,7 +49,7 @@ export const DocumentActions = memo(
toast.push({
closable: true,
status: 'error',
title: coreT('bundle.action.discard-version.failure'),
title: coreT('release.action.discard-version.failure'),
})
} finally {
setShowDiscardDialog(false)
Expand All @@ -65,7 +65,7 @@ export const DocumentActions = memo(
menu={
<Menu>
<MenuItem
text={coreT('bundle.action.discard-version')}
text={coreT('release.action.discard-version')}
icon={CloseIcon}
onClick={() => setShowDiscardDialog(true)}
/>
Expand Down

0 comments on commit 1408182

Please sign in to comment.