Add interface languages and improve themes and workspace controls for 0.1.36

This commit is contained in:
Knotty Wyvern
2026-10-15 10:55:59 -07:00
parent b066359b66
commit 68e86ab6eb
98 changed files with 5499 additions and 874 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
import { tr } from '../i18n/index.ts';
import { StateField, type EditorState, type Range } from "@codemirror/state";
import { Decoration, EditorView, WidgetType, keymap } from "@codemirror/view";
import { codeFolding, foldEffect, foldKeymap, foldedRanges, foldService, syntaxTree, unfoldEffect } from "@codemirror/language";
@@ -29,7 +30,7 @@ export function headingButton(label: string, collapsed: boolean): HTMLButtonElem
button.type = "button";
button.className = "rs-heading-toggle";
button.setAttribute("aria-expanded", String(!collapsed));
const title = `${collapsed ? "Expand" : "Collapse"} ${label || "heading"}`;
const title = tr(collapsed ? "Expand {name}" : "Collapse {name}", { name: label || tr("heading") });
button.setAttribute("aria-label", title);
tooltipCleanups.set(button, attachTooltip(button, () => button.getAttribute("aria-label") || ""));
const icon = actionIcon("chevron");
@@ -100,7 +101,7 @@ export function readerHeadingFolding(root: HTMLElement, collapsed: Set<string>)
headings.forEach(item => {
const button = item.heading.querySelector<HTMLButtonElement>(".rs-heading-toggle");
if (button) {
const label = `${collapsed.has(item.key) ? "Expand" : "Collapse"} ${item.label}`;
const label = tr(collapsed.has(item.key) ? "Expand {name}" : "Collapse {name}", { name: item.label });
button.setAttribute("aria-expanded", String(!collapsed.has(item.key)));
button.setAttribute("aria-label", label);