info_overlay: Convert note_html messages to FormatJS.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-04-12 16:58:09 -07:00
committed by Tim Abbott
parent 70bf9914b2
commit a33ee8c36f

View File

@@ -5,7 +5,7 @@ import render_markdown_help from "../templates/markdown_help.hbs";
import * as browser_history from "./browser_history";
import * as common from "./common";
import * as components from "./components";
import {i18n} from "./i18n";
import {$t_html, i18n} from "./i18n";
import * as keydown_util from "./keydown_util";
import * as markdown from "./markdown";
import * as overlays from "./overlays";
@@ -101,8 +101,15 @@ def zulip():
<span class="k">print</span> <span class="s">"Zulip"</span></pre></div>`,
},
{
note_html: i18n.t(
'To add syntax highlighting to a multi-line code block, add the language\'s <b>first</b> <a target="_blank" rel="noopener noreferrer" href="https://pygments.org/docs/lexers/">Pygments short name</a> after the first set of back-ticks. You can also make a code block by indenting each line with 4 spaces.',
note_html: $t_html(
{
defaultMessage:
"To add syntax highlighting to a multi-line code block, add the language's <b>first</b> <z-link>Pygments short name</z-link> after the first set of back-ticks. You can also make a code block by indenting each line with 4 spaces.",
},
{
"z-link": (content_html) =>
`<a target="_blank" rel="noopener noreferrer" href="https://pygments.org/docs/lexers/">${content_html}</a>`,
},
),
},
{
@@ -130,8 +137,15 @@ This text won't be visible until the user clicks.
\`\`\``,
},
{
note_html: i18n.t(
'You can also make <a target="_blank" rel="noopener noreferrer" href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables">tables</a> with this <a target="_blank" rel="noopener noreferrer" href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables">Markdown-ish table syntax</a>.',
note_html: $t_html(
{
defaultMessage:
"You can also make <z-link>tables</z-link> with this <z-link>Markdown-ish table syntax</z-link>.",
},
{
"z-link": (content_html) =>
`<a target="_blank" rel="noopener noreferrer" href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables">${content_html}</a>`,
},
),
},
];