From 353332d9a427d5d9b1bd46ea8af1c3ec78ab5e9f Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Mon, 16 Oct 2023 14:47:19 -0700 Subject: [PATCH 1/5] feat(i18n): use i18n primitives for publish status button --- .../plugins/locale-no-nb/bundles/desk.ts | 40 +++++++++++-- packages/sanity/src/desk/i18n/resources.ts | 14 +++++ .../statusBar/sparkline/PublishStatus.tsx | 56 +++++++++++++------ 3 files changed, 89 insertions(+), 21 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 ca4e6a77d16..ea56d1899d2 100644 --- a/dev/test-studio/plugins/locale-no-nb/bundles/desk.ts +++ b/dev/test-studio/plugins/locale-no-nb/bundles/desk.ts @@ -26,8 +26,7 @@ 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.validation-issues.tooltip': - 'Valideringsfeil som må rettes før dokumentet kan publiseres', + 'action.publish.validation-issues.tooltip': 'Valideringsfeil må rettes før det kan publiseres', /** Tooltip when publish button is disabled because the document is already published.*/ 'action.publish.already-published.tooltip': 'Publisert for {{timeSincePublished}} siden', @@ -36,7 +35,7 @@ const deskResources: Record = { 'action.publish.already-published.no-time-ago.tooltip': 'Allerede publisert', /** Tooltip when publish button is disabled because there are no changes.*/ - 'action.publish.tooltip.no-changes': 'Ingen upubliserte endringer', + 'action.publish.no-changes.tooltip': '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', @@ -81,10 +80,10 @@ const deskResources: Record = { 'Dette dokumentet er tomt og kan ikke dupliseres', /** Label for the "Duplicate" document action */ - 'action.duplicate.label': 'Duplisèr', + 'action.duplicate.label': 'Dupliser', /** Label for the "Duplicate" document action while the document is being duplicated */ - 'action.duplicate.running.label': 'Duplisèrer…', + 'action.duplicate.running.label': 'Dupliserer…', /** --- UNPUBLISH ACTION --- */ /** Tooltip when action is disabled because the operation is not ready */ @@ -113,6 +112,37 @@ const deskResources: Record = { /** Message prompting the user to confirm that they want to restore to an earlier version*/ 'action.restore.confirm-dialog.confirm-discard-changes': 'Er du sikker på at du vil gjenopprette til valgte versjon?', + + /** --- PUBLISH STATUS BUTTON --- */ + /** Accessibility label indicating when the document was last updated, in relative time, eg "2 hours ago" */ + 'status-bar.publish-status-button.last-updated-time.aria-label': + 'Sist oppdatert {{relativeTime}}', + + /** 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': + 'Sist publisert {{relativeTime}}', + + /** Text for tooltip showing explanation of timestamp/relative time, eg "Last updated " */ + 'status-bar.publish-status-button.last-updated-time.tooltip': 'Sist oppdatert ', + + /** Text for tooltip showing explanation of timestamp/relative time, eg "Last published " */ + 'status-bar.publish-status-button.last-published-time.tooltip': 'Sist publisert ', + + /** --- REVIEW CHANGES BUTTON --- */ + /** Label for button when status is syncing */ + 'status-bar.review-changes-button.status.syncing.text': 'Lagrer...', + + /** Label for button when status is saved */ + 'status-bar.review-changes-button.status.saved.text': 'Lagret!', + + /** Primary text for tooltip for the button */ + 'status-bar.review-changes-button.tooltip.text': 'Se endringer', + + /** Text for the secondary text for tooltip for the button */ + 'status-bar.review-changes-button.tooltip.changes-saved': 'Endringer lagret', + + /** Aria label for the button */ + 'status-bar.review-changes-button.aria-label': 'Se endringer', } export default deskResources diff --git a/packages/sanity/src/desk/i18n/resources.ts b/packages/sanity/src/desk/i18n/resources.ts index 1edf7bae722..e4fcdb286ee 100644 --- a/packages/sanity/src/desk/i18n/resources.ts +++ b/packages/sanity/src/desk/i18n/resources.ts @@ -117,6 +117,20 @@ const deskLocaleStrings = { 'action.restore.confirm-dialog.confirm-discard-changes': 'Are you sure you want to restore this document?', + /** --- PUBLISH STATUS BUTTON --- */ + /** Accessibility label indicating when the document was last updated, in relative time, eg "2 hours ago" */ + 'status-bar.publish-status-button.last-updated-time.aria-label': 'Last updated {{relativeTime}}', + + /** 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}}', + + /** Text for tooltip showing explanation of timestamp/relative time, eg "Last updated " */ + 'status-bar.publish-status-button.last-updated-time.tooltip': 'Last updated ', + + /** Text for tooltip showing explanation of timestamp/relative time, eg "Last published " */ + 'status-bar.publish-status-button.last-published-time.tooltip': 'Last published ', + /** --- REVIEW CHANGES BUTTON --- */ /** Label for button when status is syncing */ 'status-bar.review-changes-button.status.syncing.text': 'Saving...', diff --git a/packages/sanity/src/desk/panes/document/statusBar/sparkline/PublishStatus.tsx b/packages/sanity/src/desk/panes/document/statusBar/sparkline/PublishStatus.tsx index 067ea573fe1..9f575dba9a0 100644 --- a/packages/sanity/src/desk/panes/document/statusBar/sparkline/PublishStatus.tsx +++ b/packages/sanity/src/desk/panes/document/statusBar/sparkline/PublishStatus.tsx @@ -2,7 +2,8 @@ import {Box, Button, Flex, Stack, Text, Tooltip} from '@sanity/ui' import {PlayIcon, PublishIcon} from '@sanity/icons' import React from 'react' import styled from 'styled-components' -import {useRelativeTime} from 'sanity' +import {deskLocaleNamespace} from '../../../../i18n' +import {Translate, useRelativeTime, useTranslation} from 'sanity' interface PublishStatusProps { collapsed?: boolean @@ -18,6 +19,7 @@ const Root = styled(Flex)` export function PublishStatus(props: PublishStatusProps) { const {collapsed, disabled, lastPublished, lastUpdated, liveEdit} = props + const {t} = useTranslation(deskLocaleNamespace) // Label with abbreviations and suffix const lastPublishedTimeAgo = useRelativeTime(lastPublished || '', { @@ -45,11 +47,15 @@ export function PublishStatus(props: PublishStatusProps) { useTemporalPhrase: true, }) const a11yLabel = liveEdit - ? `Last updated ${a11yUpdatedAgo}` - : `Last published ${a11yPublishedAgo}` + ? t('status-bar.publish-status-button.last-updated-time.aria-label', { + relativeTime: a11yUpdatedAgo, + }) + : t('status-bar.publish-status-button.last-published-time.aria-label', { + relativeTime: a11yPublishedAgo, + }) return ( - + {liveEdit ? ( - <> - Last updated{' '} - - {lastUpdated ? lastUpdatedTimeAgo : lastPublishedTimeAgo} - - + ( + + ), + }} + /> ) : ( - <> - Last published {lastPublishedTimeAgo} - + ( + + ), + }} + /> )} @@ -88,11 +110,13 @@ export function PublishStatus(props: PublishStatusProps) { {!collapsed && ( {liveEdit ? ( - + + ) : ( - {lastPublishedTime} + )} )} From 59d39cb67de3f92a4ccc33b972fddc3c8bb9790a Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Mon, 16 Oct 2023 16:19:38 -0700 Subject: [PATCH 2/5] chore(i18n): add missing norwegian resource strings --- .../plugins/locale-no-nb/bundles/studio.ts | 588 +++++++++++++++--- .../sanity/src/core/i18n/bundles/studio.ts | 19 +- .../navbar/search/components/SearchHeader.tsx | 4 +- .../document/timeline/timelineItem.styled.tsx | 6 +- .../panes/document/timeline/timelineItem.tsx | 7 +- 5 files changed, 527 insertions(+), 97 deletions(-) diff --git a/dev/test-studio/plugins/locale-no-nb/bundles/studio.ts b/dev/test-studio/plugins/locale-no-nb/bundles/studio.ts index 3109f5f81a9..e5b399242f9 100644 --- a/dev/test-studio/plugins/locale-no-nb/bundles/studio.ts +++ b/dev/test-studio/plugins/locale-no-nb/bundles/studio.ts @@ -1,12 +1,117 @@ import type {StudioLocaleResourceKeys} from 'sanity' const studioResources: Record = { - /** Placeholder text for the omnisearch input field */ - 'search.placeholder': 'Søk', - /* Relative time, just now */ 'relative-time.just-now': 'akkurat nå', + /** --- Review Changes --- */ + + /** Title for the Review Changes pane */ + 'changes.title': 'Se endringer', + + /** Label for the close button label in Review Changes pane */ + 'changes.action.close-label': 'Lukk gjennomgang av endringer', + + /** Label and text for tooltip that indicates the authors of the changes */ + 'changes.changes-by-author': 'Endringer av', + + /** Loading changes in Review Changes Pane */ + 'changes.loading-changes': 'Laster endringer', + + /** No Changes title in the Review Changes pane */ + 'changes.no-changes-title': 'Det er ingen endringer', + + /** No Changes description in the Review Changes pane */ + 'changes.no-changes-description': + 'Rediger dokumentet eller velg en eldre versjon i tidslinjen for å se en liste over endringer i dette panelet.', + + /** Prompt for reverting all changes in document in Review Changes pane. Includes a count of changes. */ + 'changes.action.revert-all-description': `Er du sikker på at du vil angre alle {{count}} endringer?`, + + /** Cancel label for revert button prompt action */ + 'changes.action.revert-all-cancel': `Avbryt`, + + /** Revert all confirm label for revert button action - used on prompt button + review changes pane */ + 'changes.action.revert-all-confirm': `Angre alle`, + + /** Loading author of change in the differences tooltip in the review changes pane */ + 'changes.loading-author': 'Laster…', + + /** --- Review Changes: Field + Group --- */ + + /** Prompt for reverting changes for a field change */ + 'changes.action.revert-changes-description': `Er du sikker på at du vil angre endringene?`, + + /** Prompt for reverting changes for a group change, eg multiple changes */ + 'changes.action.revert-changes-description_one': `Er du sikker på at du vil angre endringen?`, + + /** Prompt for confirming revert change (singular) label for field change action */ + 'changes.action.revert-changes-confirm-change_one': `Angre endring`, + + /** Revert for confirming revert (plural) label for field change action */ + 'changes.action.revert-changes-confirm-change_other': `Angre endringer`, + + /** --- Document timeline, for navigating different revisions of a document --- */ + + /** Error prompt when revision cannot be loaded */ + 'timeline.error.unable-to-load-revision': 'Kan ikke laste revisjon', + + /** Label for latest version for timeline menu dropdown */ + 'timeline.latest-version': 'Siste versjon', + + /** Label for loading history */ + 'timeline.loading-history': 'Laster historikk', + + /** + * Label for determining since which version the changes for timeline menu dropdown are showing. + * Receives the time label as a parameter. + */ + 'timeline.since': 'Siden: {{timestamp, datetime}}', + + /** Label for missing change version for timeline menu dropdown are showing */ + 'timeline.since-version-missing': 'Siden: ukjent versjon', + + /** Title for error when the timeline for the given document can't be loaded */ + 'timeline.error.load-document-changes-title': + 'En feil oppstod under henting av dokumentendringer.', + + /** Description for error when the timeline for the given document can't be loaded */ + 'timeline.error.load-document-changes-description': 'Historikk har ikke blitt påvirket.', + + /** Error title for when the document doesn't have history */ + 'timeline.error.no-document-history-title': 'Ingen historikk', + + /** Error description for when the document doesn't have history */ + 'timeline.error.no-document-history-description': + 'Når du endrer innholdet i dokumentet, vil dokumentversjonene vises i denne menyen.', + + /** --- Timeline constants --- */ + + /** Label for when the timeline item is the latest in the history */ + 'timeline.latest': 'Siste', + + /** Consts used in the timeline item component (dropdown menu) - helpers */ + 'timeline.create': 'Opprettet', + 'timeline.delete': 'Slettet', + 'timeline.discardDraft': 'Utkast forkastet', + 'timeline.initial': 'Opprettet', + 'timeline.editDraft': 'Redigert', + 'timeline.editLive': 'Live redigert', + 'timeline.publish': 'Publisert', + 'timeline.unpublish': 'Avpublisert', + + /** --- Slug Input --- */ + + /** Error message for when the source to generate a slug from is missing */ + 'inputs.slug.error.missing-source': + 'Kilde mangler. Sjekk `source` på skjematypen «{{schemaType}}»', + + /** Loading message for when the input is actively generating a slug */ + 'inputs.slug.action.generating': `Genererer…`, + + /** Action message for generating the slug */ + 'inputs.slug.action.generate': `Generer`, + /** --- DateTime (and Date) Input --- */ /** Action message for navigating to previous month */ @@ -46,6 +151,115 @@ const studioResources: Record = { /** Label for selecting a hour preset. Receives a `time` param as a string on hh:mm format and a `date` param as a Date instance denoting the preset date */ 'inputs.datetime.calendar.action.set-to-time-preset': '{{time}} on {{date, datetime}}', + /** --- File (Image, File and ImageTool) Inputs --- */ + + /** Open image edit dialog */ + 'inputs.files.image.actions-menu.edit-details.label': 'Åpne bilderedigeringsdialog', + + /** Open image options menu */ + 'inputs.files.image.actions-menu.options.label': 'Åpne bildeinnstillingsmeny', + + /** The upload could not be completed at this time. */ + 'inputs.files.image.upload-error.description': + 'Opplastingen kunne ikke fullføres på dette tidspunktet.', + + /** Upload failed */ + 'inputs.files.image.upload-error.title': 'Opplasting mislyktes', + + /** Edit hotspot and crop */ + 'inputs.files.image.hotspot-dialog.title': 'Rediger fokuspunkt og beskjær', + + /** Preview of uploaded image */ + 'inputs.files.image.preview-uploaded-image': 'Forhåndsvisning av opplastet bilde', + + /** Cannot upload this file here */ + 'inputs.files.image.drag-overlay.cannot-upload-here': 'Kan ikke laste opp denne filen her', + + /** This field is read only */ + 'inputs.files.image.drag-overlay.this-field-is-read-only': 'Dette feltet er skrivebeskyttet', + + /** Drop image to upload */ + 'inputs.files.image.drag-overlay.drop-to-upload-image': 'Slipp bilde for å laste opp', + + /** Invalid image value */ + 'inputs.files.image.invalid-image-warning.title': 'Ugyldig bildeverdi', + + /** The value of this field is not a valid image. Resetting this field will let you choose a new image. */ + 'inputs.files.image.invalid-image-warning.description': + 'Verdien i dette feltet er ikke et gyldig bilde. Ved å tilbakestille dette feltet kan du velge et nytt bilde.', + + /** The URL is copied to the clipboard */ + 'inputs.files.common.actions-menu.notification.url-copied': + 'URL-en er kopiert til utklippstavlen', + + /** Replace */ + 'inputs.files.common.actions-menu.replace.label': 'Erstatt', + + /** Upload */ + 'inputs.files.common.actions-menu.upload.label': 'Last opp', + + /** Download */ + 'inputs.files.common.actions-menu.download.label': 'Last ned', + + /** Copy URL */ + 'inputs.files.common.actions-menu.copy-url.label': 'Kopier URL', + + /** Clear field */ + 'inputs.files.common.actions-menu.clear-field.label': 'Tøm felt', + + /** Can't upload files here */ + 'inputs.files.common.placeholder.upload-not-supported': 'Kan ikke laste opp filer her', + + /** Read only */ + 'inputs.files.common.placeholder.read-only': 'Skrivebeskyttet', + + /** Drop to upload file */ + 'inputs.files.common.placeholder.drop-to-upload_file': 'Slipp for å laste opp fil', + + /** Drop to upload image */ + 'inputs.files.common.placeholder.drop-to-upload_image': 'Slipp for å laste opp bilde', + + /** Cannot upload `{{count}}` files */ + 'inputs.files.common.placeholder.cannot-upload-some-files_one': 'Kan ikke laste opp fil', + 'inputs.files.common.placeholder.cannot-upload-some-files_other': + 'Kan ikke laste opp {{count}} filer', + + /** Drag or paste file here */ + 'inputs.files.common.placeholder.drag-or-paste-to-upload_file': 'Dra eller lim inn fil her', + /** Drag or paste image here */ + 'inputs.files.common.placeholder.drag-or-paste-to-upload_image': 'Dra eller lim inn bilde her', + + /** Drop to upload */ + 'inputs.files.common.drop-message.drop-to-upload': 'Slipp for å laste opp', + + /** Drop to upload `{{count}}` file */ + 'inputs.files.common.drop-message.drop-to-upload-multi_one': + 'Slipp for å laste opp {{count}} fil', + + /** Drop to upload `{{count}}` files */ + 'inputs.files.common.drop-message.drop-to-upload-multi_other': + 'Slipp for å laste opp {{count}} filer', + + /** Uploading */ + 'input.files.common.upload-progress': 'Laster opp ', + + /** Incomplete upload */ + 'inputs.files.common.stale-upload-warning.title': 'Ufullstendig opplasting', + + /** An upload has made no progress for at least `{{staleThresholdMinutes}}` minutes and likely got interrupted. You can safely clear the incomplete upload and try uploading again. */ + 'inputs.files.common.stale-upload-warning.description': + 'En opplasting har ikke gjort fremskritt på minst {{staleThresholdMinutes}} minutter og ble sannsynligvis avbrutt. Du kan trygt fjerne den ufullstendige opplastingen og prøve å laste opp på nytt.', + + /** Clear upload */ + 'inputs.files.common.stale-upload-warning.clear': 'Fjern opplasting', + + /** Hotspot & Crop */ + 'inputs.files.imagetool.field.title': 'Fokuspunkt & beskjæring', + + /** Adjust the rectangle to crop image. Adjust the circle to specify the area that should always be visible. */ + 'inputs.files.imagetool.field.description': + 'Juster rektangelet for å beskjære bildet. Juster sirkelen for å spesifisere området som alltid skal være synlig.', + /** --- Reference (and Cross-Dataset Reference) Input --- */ /** Error title for when the search for a reference failed. Note that the message sent by the backend may not be localized. */ @@ -207,114 +421,330 @@ const studioResources: Record = { 'inputs.array.error.cannot-resolve-initial-value-title': 'Kan ikke finne startverdi for type: {{schemaTypeTitle}}: {{errorMessage}}.', - /** --- File (Image, File and ImageTool) Inputs --- */ + /** --- Workspace menu --- */ - /** Open image edit dialog */ - 'inputs.files.image.actions-menu.edit-details.label': 'Åpne bilderedigeringsdialog', + /** Title for Workplaces dropdown menu */ + 'workspaces.title': 'Arbeidsområder', - /** Open image options menu */ - 'inputs.files.image.actions-menu.options.label': 'Åpne bildeinnstillingsmeny', + /** Label for the workspace menu */ + 'workspaces.select-workspace-aria-label': 'Velg arbeidsområde', - /** The upload could not be completed at this time. */ - 'inputs.files.image.upload-error.description': - 'Opplastingen kunne ikke fullføres på dette tidspunktet.', + /** Button label for opening the workspace switcher */ + 'workspaces.select-workspace-label': 'Velg arbeidsområde', - /** Upload failed */ - 'inputs.files.image.upload-error.title': 'Opplasting mislyktes', + /** Label for heading that indicates that you can choose your workspace */ + 'workspaces.choose-your-workspace-label': 'Velg ditt arbeidsområde', - /** Edit hotspot and crop */ - 'inputs.files.image.hotspot-dialog.title': 'Rediger fokuspunkt og beskjær', + /** + * Label for action to choose a different workspace, in the case where you are not logged in, + * have selected a workspace, and are faced with the authentication options for the selected + * workspace. In other words, label for the action shown when you have reconsidered which + * workspace to authenticate in. + */ + 'workspaces.action.choose-another-workspace': 'Velg et annet arbeidsområde', - /** Preview of uploaded image */ - 'inputs.files.image.preview-uploaded-image': 'Forhåndsvisning av opplastet bilde', + /** + * Label for action to add a workspace (currently a developer-oriented action, as this will + * lead to the documentation on workspace configuration) + */ + 'workspaces.action.add-workspace': 'Legg til arbeidsområde', - /** Cannot upload this file here */ - 'inputs.files.image.drag-overlay.cannot-upload-here': 'Kan ikke laste opp denne filen her', + /** --- New Document --- */ - /** This field is read only */ - 'inputs.files.image.drag-overlay.this-field-is-read-only': 'Dette feltet er skrivebeskyttet', + /** Placeholder for the "filter" input within the new document menu */ + 'new-document.filter-placeholder': 'Filtrér', - /** Drop image to upload */ - 'inputs.files.image.drag-overlay.drop-to-upload-image': 'Slipp bilde for å laste opp', + /** Loading indicator text within the new document menu */ + 'new-document.loading': 'Laster…', - /** Invalid image value */ - 'inputs.files.image.invalid-image-warning.title': 'Ugyldig bildeverdi', + /** Title for "Create new document" dialog */ + 'new-document.title': 'Opprett nytt dokument', - /** The value of this field is not a valid image. Resetting this field will let you choose a new image. */ - 'inputs.files.image.invalid-image-warning.description': - 'Verdien i dette feltet er ikke et gyldig bilde. Ved å tilbakestille dette feltet kan du velge et nytt bilde.', + /** Aria label for the button that opens the "Create new document" popover/dialog */ + 'new-document.open-dialog-aria-label': 'Opprett nytt dokument', - /** The URL is copied to the clipboard */ - 'inputs.files.common.actions-menu.notification.url-copied': - 'URL-en er kopiert til utklippstavlen', + /** + * Tooltip message displayed when hovering/activating the "Create new document" action, + * when there are no templates/types to create from + */ + 'new-document.no-document-types-label': 'Ingen dokumenttyper', - /** Replace */ - 'inputs.files.common.actions-menu.replace.label': 'Erstatt', + /** + * Tooltip message displayed when hovering/activating the "Create new document" action, + * when there are templates/types available for creation + */ + 'new-document.create-new-document-label': 'Nytt dokument…', - /** Upload */ - 'inputs.files.common.actions-menu.upload.label': 'Last opp', + /** Message for when no results are found for a specific search query in the new document menu */ + 'new-document.no-results': 'Ingen resultater for «{{searchQuery}}»', - /** Download */ - 'inputs.files.common.actions-menu.download.label': 'Last ned', + /** Message for when there are no document type options in the new document menu */ + 'new-document.no-document-types-found': 'Ingen dokumenttyper funnet', - /** Copy URL */ - 'inputs.files.common.actions-menu.copy-url.label': 'Kopier URL', + /** Accessibility label for the list displaying options in the new document menu */ + 'new-document.new-document-aria-label': 'Nytt dokument', - /** Clear field */ - 'inputs.files.common.actions-menu.clear-field.label': 'Tøm felt', + /** Error label for when a user is unable to create a document */ + 'new-document.error.unable-to-create-document': 'opprette dette dokumentet', - /** Can't upload files here */ - 'inputs.files.common.placeholder.upload-not-supported': 'Kan ikke laste opp filer her', + /** --- Search --- */ - /** Read only */ - 'inputs.files.common.placeholder.read-only': 'Skrivebeskyttet', + /** Placeholder text for the omnisearch input field */ + 'search.placeholder': 'Søk', - /** Drop to upload file */ - 'inputs.files.common.placeholder.drop-to-upload_file': 'Slipp for å laste opp fil', + /** Accessibility label to open search action when the search would go fullscreen (eg on narrower screens) */ + 'search.action-open-aria-label': 'Åpne søk', - /** Drop to upload image */ - 'inputs.files.common.placeholder.drop-to-upload_image': 'Slipp for å laste opp bilde', + /** Accessibility label for the search results section, shown when the user has typed valid terms */ + 'search.search-results-aria-label': 'Søkeresultater', - /** Cannot upload `{{count}}` files */ - 'inputs.files.common.placeholder.cannot-upload-some-files_one': 'Kan ikke laste opp fil', - 'inputs.files.common.placeholder.cannot-upload-some-files_other': - 'Kan ikke laste opp {{count}} filer', + /** Accessibility label for the recent searches section, shown when no valid search terms has been given */ + 'search.recent-searches-aria-label': 'Nylige søk', - /** Drag or paste file here */ - 'inputs.files.common.placeholder.drag-or-paste-to-upload_file': 'Dra eller lim inn fil her', - /** Drag or paste image here */ - 'inputs.files.common.placeholder.drag-or-paste-to-upload_image': 'Dra eller lim inn bilde her', + /** Label/heading shown for the recent searches section */ + 'search.recent-searches-label': 'Nylige søk', - /** Drop to upload */ - 'inputs.files.common.drop-message.drop-to-upload': 'Slipp for å laste opp', + /** Action label for clearing search filters */ + 'search.action.clear-filters': 'Fjern filtre', - /** Drop to upload `{{count}}` file */ - 'inputs.files.common.drop-message.drop-to-upload-multi_one': - 'Slipp for å laste opp {{count}} fil', + /** Accessibility label for filtering by document type */ + 'search.action.filter-by-document-type-aria-label': 'Filtrer etter dokumenttype', - /** Drop to upload `{{count}}` files */ - 'inputs.files.common.drop-message.drop-to-upload-multi_other': - 'Slipp for å laste opp {{count}} filer', + /** Accessibility label for the "Filters" list, that is shown when using "Add filter" in search (singular) */ + 'search.filters-aria-label_one': 'Filter', - /** Uploading */ - 'input.files.common.upload-progress': 'Laster opp ', + /** Accessibility label for the "Filters" list, that is shown when using "Add filter" in search (plural) */ + 'search.filters-aria-label_other': 'Filtre', - /** Incomplete upload */ - 'inputs.files.common.stale-upload-warning.title': 'Ufullstendig opplasting', + /** Placeholder for the "Filter" input, when narrowing possible fields/filters */ + 'search.filter-placeholder': 'Filtrer', - /** An upload has made no progress for at least `{{staleThresholdMinutes}}` minutes and likely got interrupted. You can safely clear the incomplete upload and try uploading again. */ - 'inputs.files.common.stale-upload-warning.description': - 'En opplasting har ikke gjort fremskritt på minst {{staleThresholdMinutes}} minutter og ble sannsynligvis avbrutt. Du kan trygt fjerne den ufullstendige opplastingen og prøve å laste opp på nytt.', + /** Label for when no fields/filters are found for the given term */ + 'search.filter-no-matches-found': `Ingen treff for «{{filter}}»`, - /** Clear upload */ - 'inputs.files.common.stale-upload-warning.clear': 'Fjern opplasting', + /** Accessibility label for list displaying the available document types */ + 'search.document-types-aria-label': 'Dokumenttyper', - /** Hotspot & Crop */ - 'inputs.files.imagetool.field.title': 'Fokuspunkt & beskjæring', + /** Label for when no document types matching the filter are found */ + 'search.document-types-no-matches-found': 'Ingen dokumenttyper funnet', - /** Adjust the rectangle to crop image. Adjust the circle to specify the area that should always be visible. */ - 'inputs.files.imagetool.field.description': - 'Juster rektangelet for å beskjære bildet. Juster sirkelen for å spesifisere området som alltid skal være synlig.', + /** Accessibility label for action to clear all currently applied document type filters */ + 'search.action.clear-type-filters-aria-label': 'Fjern valgte filtre', + + /** Label for action to clear all currently applied document type filters */ + 'search.action.clear-type-filters-label': 'Fjern', + + /** Accessibility action label for removing an already applied search filter */ + 'search.action.remove-filter-aria-label': 'Fjern filter', + + /** Action label for adding a search filter */ + 'search.action.add-filter': 'Legg til filter', + + /** Accessibility label for list that lets you filter fields by title, when adding a new filter in search */ + 'search.filter-by-title-aria-label': 'Filtrer etter tittel', + + /** Label for "field name" shown in tooltip when navigating list of possible fields to filter */ + 'search.filter-field-tooltip-name': 'Feltnavn', + + /** Label for "field description" shown in tooltip when navigating list of possible fields to filter */ + 'search.filter-field-tooltip-description': 'Feltopplysninger', + + /** Label for "Used in document types", a list of the document types a field appears in. Shown in tooltip when navigating list of possible fields to filter */ + 'search.filter-field-tooltip-used-in-document-types': 'Brukt i dokumenttyper', + + /** Label for "All fields", a label that appears above the list of available fields when filtering. */ + 'search.filter-all-fields-header': 'Alle felter', + + /** Label for "shared fields", a label that appears above a list of fields that all filtered types have in common, when adding a new filter. */ + 'search.filter-shared-fields-header': 'Delte felter', + + /** Label for boolean filter - true */ + 'search.filter-boolean-true': 'Sant', + + /** Label for boolean filter - false */ + 'search.filter-boolean-false': 'Usant', + + /** Placeholder value for the string filter */ + 'search.filter-string-value-placeholder': 'Verdi', + + /** Placeholder value for the number filter */ + 'search.filter-number-value-placeholder': 'Verdi', + + /** Placeholder value for minimum numeric value filter */ + 'search.filter-number-min-value-placeholder': 'Min verdi', + + /** Placeholder value for maximum numeric value filter */ + 'search.filter-number-max-value-placeholder': 'Maks verdi', + + /** Label/placeholder prompting user to select one of the predefined, allowed values for a string field */ + 'search.filter-string-value-select-predefined-value': 'Velg…', + + /** Label for the action of clearing the currently selected asset in an image/file filter */ + 'search.filter-asset-clear': 'Fjern', + + /** Label for the action of clearing the currently selected document in a reference filter */ + 'search.filter-reference-clear': 'Fjern', + + /** Label for search value in a range of numbers */ + // @todo Part of `arrayOperators` - needs `` refactoring + 'search.filter-number-items-range': `{{min}} → {{max}} elementer`, + + /** Title label for when no search results are found */ + 'search.no-results-title': 'Ingen resultater funnet', + + /** Helpful description for when no search results are found */ + 'search.no-results-help-description': 'Prøv et annet nøkkelord eller juster filtrene dine', + + /** Title label for when search returned an error that we are not able to describe in detail */ + 'search.error.unspecified-error-title': 'Noe gikk galt under søket', + + /** Helpful description for when search returned an error that we are not able to describe in detail */ + 'search.error.unspecified-error-help-description': + 'Vennligst prøv igjen eller sjekk tilkoblingen din', + + /** Title for error when no valid asset sources found */ + 'search.error.no-valid-asset-source-title': 'Ingen gyldige kilder funnet.', + + /** Description for error when no valid asset source is found, describes that only the default asset is supported */ + 'search.error.no-valid-asset-source-only-default-description': + 'For øyeblikket støttes bare standardkilden for bilder/filer.', + + /** Description for error when no valid asset source is found, describes that you should check the the current studio config */ + 'search.error.no-valid-asset-source-check-config-description': `Vennligst forsikre deg om at den er aktivert i studioets konfigurasjonsfil.`, + + /** Title for error when a filter cannot be displayed (mainly a developer-oriented error) */ + 'search.error.display-filter-title': 'En feil oppstod under visning av dette filteret.', + + /** Description for error when a filter cannot be displayed, describes that you should check the schema */ + 'search.error.display-filter-description': + 'Dette kan indikere ugyldige alternativer definert i skjemaet ditt.', + + /** Label for action to clear recent searches */ + 'search.action.clear-recent-searches': 'Fjern nylige søk', + + /** Dialog title for action to select an asset of unknown type */ + 'search.action.select-asset': 'Velg element', + + /** Dialog title for action to select an image asset */ + 'search.action.select-asset_image': 'Velg bilde', + + /** Dialog title for action to select a file asset */ + 'search.action.select-asset_file': 'Velg fil', + + /** Text displayed when either no document type(s) have been selected, or we need a fallback, */ + 'search.action.search-all-types': 'Søk i alle dokumenter', + + /** Text displayed when we are able to determine one or more document types that will be used for searching */ + 'search.action.search-specific-types': `Søk etter {{types, list}}`, + + /** Text displayed when we are able to determine one or more document types that will be used for searching, but cannot list them all within the space assigned by the design */ + 'search.action.search-specific-types-truncated': `Søk etter {{types, list}} +{{count}} flere`, + + /** In the context of a list of document types - no filtering selection has been done, thus the default is "all types". */ + 'search.document-type-list-all-types': 'Alle typer', + + /** A list of provided types, formatted with the locales list formatter. */ + 'search.document-type-list': `{{types, list}}`, + + /** A list of provided types that has been truncated - more types are included but not displayed, thus we need to indicate that there are more. */ + 'search.document-type-list-truncated': `{{types, list}} +{{count}} flere`, + + /** Accessibility label for when the search is full screen (on narrow screens) and you want to close the search */ + 'search.action.close-search-aria-label': 'Lukk søk', + + /** Accessibility label for when the search is full screen (on narrow screens) and you want to toggle filters */ + 'search.action.toggle-filters-aria-label_hide': 'Skjul filtre', + 'search.action.toggle-filters-aria-label_show': 'Vis filtre', + + /** Label for instructions on how to use the search - displayed when no recent searches are available */ + 'search.instructions': 'Bruk for å rafinere søket.', + + /** --- Help & Resources Menu --- */ + + /** Title for help and resources menus */ + 'helpResources.title': 'Hjelp og ressurser', + + /** Information for what studio version the current studio is running */ + 'helpResources.studio-version': `Sanity Studio versjon {{studioVersion}}`, + + /** Information for what the latest sanity version is */ + 'helpResources.latest-sanity-version': `Siste versjon er {{latestVersion}}`, + + /** + * Label for "join our community" call to action + * These are titles for fallback links in the event the help & resources endpoint isn't able to be fetched + */ + 'helpResources.action.join-our-community': `Bli med i vårt community`, + + /** + * Label for "help and support" call to action + * These are titles for fallback links in the event the help & resources endpoint isn't able to be fetched + */ + 'helpResources.action.help-and-support': `Hjelp og støtte`, + + /** + * Label for "contact sales" call to action + * These are titles for fallback links in the event the help & resources endpoint isn't able to be fetched + */ + 'helpResources.action.contact-sales': `Kontakt salg`, + + /** --- User Menu --- */ + + /** Label for tooltip to show which provider the currently logged in user is using */ + 'user-menu.login-provider': `Logget inn med {{providerTitle}}`, + + /** Label for action to manage the current sanity project */ + 'user-menu.action.manage-project': 'Administrer prosjekt', + + /** Accessibility label for the action to manage the current project */ + 'user-menu.action.manage-project-aria-label': 'Administrer prosjekt', + + /** Label for action to invite members to the current sanity project */ + 'user-menu.action.invite-members': 'Inviter medlemmer', + + /** Accessibility label for action to invite members to the current sanity project */ + 'user-menu.action.invite-members-aria-label': 'Inviter medlemmer', + + /** Label for action to sign out of the current sanity project */ + 'user-menu.action.sign-out': 'Logg ut', + + /** Title for appearance section for the current studio (dark / light / system scheme) */ + 'user-menu.appearance-title': 'Utseende', + + /** Title for using system apparence in the appearance user menu */ + 'user-menu.color-scheme.system-title': 'System', + + /** Description for using "system apparence" in the appearance user menu */ + 'user-menu.color-scheme.system-description': 'Bruk systemutseende', + + /** Title for using the "dark theme" in the appearance user menu */ + 'user-menu.color-scheme.dark-title': 'Mørk', + + /** Description for using the "dark theme" in the appearance user menu */ + 'user-menu.color-scheme.dark-description': 'Bruk mørkt utseende', + + /** Title for using the "light theme" in the appearance user menu */ + 'user-menu.color-scheme.light-title': 'Lys', + + /** Description for using the "light theme" in the appearance user menu */ + 'user-menu.color-scheme.light-description': 'Bruk lyst utseende', + + /** Title for locale section for the current studio */ + 'user-menu.locale-title': 'Språk', + + /** --- Presence --- */ + + /** Message title for when no one else is currently present */ + 'presence.no-one-else-title': 'Ingen andre er her', + + /** Message description for when no one else is currently present */ + 'presence.no-one-else-description': 'Inviter folk til prosjektet for å se deres onlinestatus.', + + /** Label for action to manage members of the current studio project */ + 'presence.action.manage-members': 'Administrer medlemmer', + + /** Message for when a user is not in a document (displayed in the global presence menu) */ + 'presence.not-in-a-document': 'Ikke i et dokument', } export default studioResources diff --git a/packages/sanity/src/core/i18n/bundles/studio.ts b/packages/sanity/src/core/i18n/bundles/studio.ts index 13c44553bce..a44cf314111 100644 --- a/packages/sanity/src/core/i18n/bundles/studio.ts +++ b/packages/sanity/src/core/i18n/bundles/studio.ts @@ -18,7 +18,7 @@ export const studioLocaleStrings = { /** Label for the close button label in Review Changes pane */ 'changes.action.close-label': 'Close review changes', - /** Label and text for differences tooltip that indicates the authors of the changes */ + /** Label and text for tooltip that indicates the authors of the changes */ 'changes.changes-by-author': 'Changes by', /** Loading changes in Review Changes Pane */ @@ -68,7 +68,8 @@ export const studioLocaleStrings = { /** Label for loading history */ 'timeline.loading-history': 'Loading history', - /** Label for determining since which version the changes for timeline menu dropdown are showing. + /** + * Label for determining since which version the changes for timeline menu dropdown are showing. * Receives the time label as a parameter. */ 'timeline.since': 'Since: {{timestamp, datetime}}', @@ -153,6 +154,9 @@ export const studioLocaleStrings = { 'inputs.datetime.calendar.weekday-names.short.saturday': 'Sat', 'inputs.datetime.calendar.weekday-names.short.sunday': 'Sun', + /** Label for selecting a hour preset. Receives a `time` param as a string on hh:mm format and a `date` param as a Date instance denoting the preset date */ + 'inputs.datetime.calendar.action.set-to-time-preset': '{{time}} on {{date, datetime}}', + /** --- File (Image, File and ImageTool) Inputs --- */ /** Open image edit dialog */ @@ -258,9 +262,6 @@ export const studioLocaleStrings = { 'inputs.files.imagetool.field.description': 'Adjust the rectangle to crop image. Adjust the circle to specify the area that should always be visible.', - /** Label for selecting a hour preset. Receives a `time` param as a string on hh:mm format and a `date` param as a Date instance denoting the preset date */ - 'inputs.datetime.calendar.action.set-to-time-preset': '{{time}} on {{date, datetime}}', - /** --- Reference (and Cross-Dataset Reference) Input --- */ /** Error title for when the search for a reference failed. Note that the message sent by the backend may not be localized. */ @@ -486,6 +487,7 @@ export const studioLocaleStrings = { 'new-document.new-document-aria-label': 'New document', /** Error label for when a user is unable to create a document */ + // @todo refactor InsufficientPermissionsMessage 'new-document.error.unable-to-create-document': 'create this document', /** --- Search --- */ @@ -680,10 +682,11 @@ export const studioLocaleStrings = { 'search.action.close-search-aria-label': 'Close search', /** Accessibility label for when the search is full screen (on narrow screens) and you want to toggle filters */ - 'search.action.toggle-filters-aria-label': 'Toggle filters', + 'search.action.toggle-filters-aria-label_hide': 'Hide filters', + 'search.action.toggle-filters-aria-label_show': 'Show filters', /** Label for instructions on how to use the search - displayed when no recent searches are available */ - 'search.instructions': 'Use to refine your search', + 'search.instructions': 'Use to refine your search', /** --- Help & Resources Menu --- */ @@ -729,7 +732,7 @@ export const studioLocaleStrings = { 'user-menu.action.invite-members': 'Invite members', /** Accessibility label for action to invite members to the current sanity project */ - 'user-menu.action.invite-members-aria-lable': 'Invite members', + 'user-menu.action.invite-members-aria-label': 'Invite members', /** Label for action to sign out of the current sanity project */ 'user-menu.action.sign-out': 'Sign out', diff --git a/packages/sanity/src/core/studio/components/navbar/search/components/SearchHeader.tsx b/packages/sanity/src/core/studio/components/navbar/search/components/SearchHeader.tsx index 74c87b50fca..150b33ae9c9 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/components/SearchHeader.tsx +++ b/packages/sanity/src/core/studio/components/navbar/search/components/SearchHeader.tsx @@ -125,7 +125,9 @@ export const SearchHeader = forwardRef(func