Send the remaining interface text through the catalog and audit it
Phase 4f. - scripts/i18nAudit.mjs runs in pnpm check. It fails for a key that the catalog does not have, a catalog key that the code does not use, and a row without all four languages. - message() marks a key that a variable carries to the translation call later: table formats, formula errors, and browser status messages. - 53 new rows with French, Japanese, and Simplified Chinese text for the status and error messages of the workbench, the tree, Settings, theme import, images, the built-in browser, and code blocks. The backlinks toggle now translates too. - 13 unused rows are gone. - Errors of the plugin API stay in English. docs/development.md has the rule in "Interface text". pnpm check, pnpm test (350 of 350), and the full smoke suite pass, except two tests that failed one time under load and passed on retry and 3 of 3 times alone.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { tr } from "../i18n/index.ts";
|
||||
import MarkdownIt from "markdown-it";
|
||||
import type { Token } from "markdown-it";
|
||||
import { inlineMathEnd } from "./inlineMath.ts";
|
||||
@@ -147,9 +148,9 @@ markdown.renderer.rules.link_open = (tokens, index, options, _env, renderer) =>
|
||||
markdown.renderer.rules.fence = (tokens, index) => {
|
||||
const token = tokens[index];
|
||||
const language = token.info.trim().split(/\s+/)[0];
|
||||
const code = `<pre class="md-code" data-lang="${escapeHtml(language || "code")}"><button type="button" class="rs-fence-copy" aria-label="Copy code" title="Copy code">${copyIcon}</button><code${language ? ` class="language-${escapeHtml(language)}"` : ""}>${escapeHtml(token.content)}</code></pre>\n`;
|
||||
const code = `<pre class="md-code" data-lang="${escapeHtml(language || "code")}"><button type="button" class="rs-fence-copy" aria-label="${tr("Copy code")}" title="${tr("Copy code")}">${copyIcon}</button><code${language ? ` class="language-${escapeHtml(language)}"` : ""}>${escapeHtml(token.content)}</code></pre>\n`;
|
||||
return language.toLowerCase() === "mermaid"
|
||||
? `<div class="md-mermaid"><div class="md-diagram" aria-label="Mermaid diagram"></div><details class="md-diagram-source"><summary>Diagram source</summary>${code}</details></div>\n`
|
||||
? `<div class="md-mermaid"><div class="md-diagram" aria-label="${tr("Mermaid diagram")}"></div><details class="md-diagram-source"><summary>${tr("Diagram source")}</summary>${code}</details></div>\n`
|
||||
: code;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user