diff --git a/src/components/views/rooms/SendMessageComposer.js b/src/components/views/rooms/SendMessageComposer.js index 994c28f531..7870699fec 100644 --- a/src/components/views/rooms/SendMessageComposer.js +++ b/src/components/views/rooms/SendMessageComposer.js @@ -43,9 +43,6 @@ import ContentMessages from '../../../ContentMessages'; import {Key} from "../../../Keyboard"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; -const SEND_ANYWAY = Symbol("send-anyway"); -const UNKNOWN_CMD = Symbol("unknown-cmd"); - function addReplyToMessageContent(content, repliedToEvent, permalinkCreator) { const replyContent = ReplyThread.makeReplyMixIn(repliedToEvent); Object.assign(content, replyContent); @@ -256,14 +253,26 @@ export default class SendMessageComposer extends React.Component { shouldSend = false; this._runSlashCommand(cmd); } else { - // ask the user if their unknown command should be sent as a message instead + // ask the user if their unknown command should be sent as a message const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); - // unknown command, ask the user if they meant to send it as a message const {finished} = Modal.createTrackedDialog("Unknown command", "", QuestionDialog, { title: _t("Unknown Command"), - description: _t("Unrecognised command: ") + commandText, + description:
+

+ { _t("Unrecognised command: %(commandText)s", {commandText}) } +

+

+ { _t("You can use /help to list available commands. Did you mean to send this as a message?", {}, { + code: t => { t }, + }) } +

+

+ { _t("Protip: Begin your message with // to start it with a slash.", {}, { + code: t => { t }, + }) } +

+
, button: _t('Send as message'), - danger: true, }); const [sendAnyway] = await finished; // if !sendAnyway bail to let the user edit the composer and try again diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 314731a910..da4111aec8 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1077,7 +1077,9 @@ "Command error": "Command error", "Server unavailable, overloaded, or something else went wrong.": "Server unavailable, overloaded, or something else went wrong.", "Unknown Command": "Unknown Command", - "Unrecognised command: ": "Unrecognised command: ", + "Unrecognised command: %(commandText)s": "Unrecognised command: %(commandText)s", + "You can use /help to list available commands. Did you mean to send this as a message?": "You can use /help to list available commands. Did you mean to send this as a message?", + "Protip: Begin your message with // to start it with a slash.": "Protip: Begin your message with // to start it with a slash.", "Send as message": "Send as message", "Failed to connect to integration manager": "Failed to connect to integration manager", "You don't currently have any stickerpacks enabled": "You don't currently have any stickerpacks enabled",