i18n: Mark info overlay usage_html for translation.

This commit is contained in:
Daniil Fadeev 2023-07-23 15:53:35 +03:00 committed by Tim Abbott
parent 1e85683570
commit c99c8f4640
1 changed files with 15 additions and 3 deletions

View File

@ -20,14 +20,26 @@ import * as util from "./util";
// set_up_toggler is called. // set_up_toggler is called.
export let toggler; export let toggler;
function format_usage_html(...keys) {
const get_formatted_keys = () => keys.map((key) => `<kbd>${key}</kbd>`).join("+");
return $t_html(
{
defaultMessage: "(or <key-html></key-html>)",
},
{
"key-html": get_formatted_keys,
},
);
}
const markdown_help_rows = [ const markdown_help_rows = [
{ {
markdown: "**bold**", markdown: "**bold**",
usage_html: "(or <kbd>Ctrl</kbd>+<kbd>B</kbd>)", usage_html: format_usage_html("Ctrl", "B"),
}, },
{ {
markdown: "*italic*", markdown: "*italic*",
usage_html: "(or <kbd>Ctrl</kbd>+<kbd>I</kbd>)", usage_html: format_usage_html("Ctrl", "I"),
}, },
{ {
markdown: "~~strikethrough~~", markdown: "~~strikethrough~~",
@ -37,7 +49,7 @@ const markdown_help_rows = [
}, },
{ {
markdown: "[Zulip website](https://zulip.org)", markdown: "[Zulip website](https://zulip.org)",
usage_html: "(or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>L</kbd>)", usage_html: format_usage_html("Ctrl", "Shift", "L"),
}, },
{ {
markdown: "#**stream name**", markdown: "#**stream name**",