Skip to content

Commit

Permalink
fix: localize create new document button
Browse files Browse the repository at this point in the history
  • Loading branch information
robinpyon authored and rexxars committed Dec 19, 2023
1 parent b8197d6 commit b720e4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/sanity/src/core/i18n/bundles/studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,8 @@ export const studioLocaleStrings = defineLocalesResources('studio', {
/** Unexpected error: `{{error}}` */
'member-field-error.unexpected-error': 'Unexpected error: {{error}}',

/** Button label for "Create new document" button */
'new-document.button': 'Create new',
/**
* Tooltip message displayed when hovering/activating the "Create new document" action,
* when there are templates/types available for creation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,13 @@ export function NewDocumentButton(props: NewDocumentButtonProps) {
'data-testid': 'new-document-button',
disabled: disabled || loading,
icon: AddIcon,
// @todo: localize text
text: 'Create',
text: t('new-document.button'),
mode: 'ghost',
onClick: handleToggleOpen,
ref: setButtonElement,
selected: open,
}),
[disabled, handleToggleOpen, loading, open, openDialogAriaLabel],
[disabled, handleToggleOpen, loading, open, openDialogAriaLabel, t],
)

// Tooltip content for the open button
Expand Down

0 comments on commit b720e4a

Please sign in to comment.