diff --git a/packages/sanity/src/structure/i18n/resources.ts b/packages/sanity/src/structure/i18n/resources.ts index 8daa78153ea..dddfc2fac86 100644 --- a/packages/sanity/src/structure/i18n/resources.ts +++ b/packages/sanity/src/structure/i18n/resources.ts @@ -385,6 +385,10 @@ const structureLocaleStrings = defineLocalesResources('structure', { /** The text for the "Open preview" action for a document */ 'production-preview.menu-item.title': 'Open preview', + /** Label for button when status is saved */ + 'status-bar.document-status-pulse.status.saved.text': 'Saved', + /** Label for button when status is syncing */ + 'status-bar.document-status-pulse.status.syncing.text': 'Saving...', /** Accessibility label indicating when the document was last published, in relative time, eg "3 weeks ago" */ 'status-bar.publish-status-button.last-published-time.aria-label': 'Last published {{relativeTime}}', diff --git a/packages/sanity/src/structure/panes/document/statusBar/DocumentStatusPulse/DocumentStatusPulse.tsx b/packages/sanity/src/structure/panes/document/statusBar/DocumentStatusPulse/DocumentStatusPulse.tsx index c8b6e7c8a4c..1543b629237 100644 --- a/packages/sanity/src/structure/panes/document/statusBar/DocumentStatusPulse/DocumentStatusPulse.tsx +++ b/packages/sanity/src/structure/panes/document/statusBar/DocumentStatusPulse/DocumentStatusPulse.tsx @@ -1,26 +1,28 @@ import {ButtonTone, Flex, Text} from '@sanity/ui' import React from 'react' import {AnimatedStatusIcon} from './AnimatedStatusIcon' -import {TextWithTone} from 'sanity' +import {structureLocaleNamespace} from '../../../../i18n' +import {TextWithTone, useTranslation} from 'sanity' type StatusType = 'saved' | 'syncing' interface ReviewChangesButtonProps { status?: StatusType } -const STATUS_DICTIONARY: Record = { +const STATUS_DICTIONARY: Record = { saved: { - text: 'Saved', + i18nKey: 'status-bar.document-status-pulse.status.saved.text', tone: 'positive', }, syncing: { - text: 'Saving...', + i18nKey: 'status-bar.document-status-pulse.status.syncing.text', tone: 'default', }, } export const DocumentStatusPulse = (props: ReviewChangesButtonProps) => { const {status} = props + const {t} = useTranslation(structureLocaleNamespace) if (status !== 'saved' && status !== 'syncing') { return null @@ -35,7 +37,7 @@ export const DocumentStatusPulse = (props: ReviewChangesButtonProps) => { - {currentStatus.text} + {t(currentStatus.i18nKey)} )