From 4a21b037eb36d3fde47dc524e854857bcdfd695b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 31 Jul 2023 00:44:12 +0200 Subject: [PATCH] Lexical: Make labels localizable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../floating-block-type-toolbar-plugin.tsx | 16 +++++++------ .../floating-text-format-toolbar-plugin.tsx | 23 ++++++++++++++----- .../features/developers/settings-store.tsx | 2 +- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/app/soapbox/features/compose/editor/plugins/floating-block-type-toolbar-plugin.tsx b/app/soapbox/features/compose/editor/plugins/floating-block-type-toolbar-plugin.tsx index cd8afed945..8f5a951c12 100644 --- a/app/soapbox/features/compose/editor/plugins/floating-block-type-toolbar-plugin.tsx +++ b/app/soapbox/features/compose/editor/plugins/floating-block-type-toolbar-plugin.tsx @@ -21,7 +21,7 @@ import { import { useCallback, useEffect, useRef, useState } from 'react'; import * as React from 'react'; import { createPortal } from 'react-dom'; -import { useIntl } from 'react-intl'; +import { defineMessages, useIntl } from 'react-intl'; import { uploadFile } from 'soapbox/actions/compose'; import { useAppDispatch, useInstance } from 'soapbox/hooks'; @@ -34,6 +34,11 @@ import { ToolbarButton } from './floating-text-format-toolbar-plugin'; import type { List as ImmutableList } from 'immutable'; +const messages = defineMessages({ + createHorizontalLine: { id: 'compose_form.lexical.create_horizontal_line', defaultMessage: 'Create horizontal line' }, + uploadMedia: { id: 'compose_form.lexical.upload_media', defaultMessage: 'Upload media' }, +}); + interface IUploadButton { onSelectFile: (src: string) => void } @@ -61,10 +66,6 @@ const UploadButton: React.FC = ({ onSelectFile }) => { fileElement.current?.click(); }; - // if (unavailable) { - // return null; - // } - const src = ( onlyImages(attachmentTypes) ? require('@tabler/icons/photo.svg') @@ -75,7 +76,7 @@ const UploadButton: React.FC = ({ onSelectFile }) => {