Add interface languages and improve themes and workspace controls for 0.1.36
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user