diff --git a/components/media-toolbar/index.tsx b/components/media-toolbar/index.tsx index cf7f5bf6..aaa49670 100644 --- a/components/media-toolbar/index.tsx +++ b/components/media-toolbar/index.tsx @@ -25,6 +25,15 @@ interface MediaToolbarProps { * The ID of the media, in this case the image. */ id: number; + + /** + * Labels for the buttons. + */ + labels?: { + replace?: string; + remove?: string; + add?: string; + }; } /* @@ -40,6 +49,11 @@ export const MediaToolbar: React.FC = ({ onRemove, isOptional = false, id, + labels = { + replace: __('Replace Image', '10up-block-components'), + remove: __('Remove Image', '10up-block-components'), + add: __('Add Image', '10up-block-components'), + }, }) => { const hasImage = !!id; const { media } = useMedia(id); @@ -51,11 +65,11 @@ export const MediaToolbar: React.FC = ({ {!!isOptional && ( - {__('Remove Image', '10up-block-components')} + {labels.remove} )} @@ -65,7 +79,7 @@ export const MediaToolbar: React.FC = ({ onSelect={onSelect} render={({ open }) => ( - {__('Add Image', '10up-block-components')} + {labels.add} )} />