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 { StateEffect, StateField, type EditorState, type Range } from "@codemirror/state";
|
||||
import { Decoration, EditorView, ViewPlugin, WidgetType, type DecorationSet } from "@codemirror/view";
|
||||
import { syntaxTree, foldedRanges, foldEffect, unfoldEffect } from "@codemirror/language";
|
||||
@@ -40,8 +41,8 @@ class CodeCopy extends WidgetType {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.className = "rs-fence-copy writer-code-copy";
|
||||
button.setAttribute("aria-label", "Copy code");
|
||||
button.dataset.editorTooltip = "Copy code";
|
||||
button.setAttribute("aria-label", tr("Copy code"));
|
||||
button.dataset.editorTooltip = tr("Copy code");
|
||||
button.append(actionIcon("copy"));
|
||||
button.onmousedown = event => event.preventDefault();
|
||||
button.onclick = async event => {
|
||||
@@ -49,11 +50,11 @@ class CodeCopy extends WidgetType {
|
||||
try {
|
||||
await navigator.clipboard.writeText(this.code);
|
||||
button.dataset.copied = "true";
|
||||
button.dataset.editorTooltip = "Copied";
|
||||
button.setAttribute("aria-label", "Code copied");
|
||||
button.dataset.editorTooltip = tr("Copied");
|
||||
button.setAttribute("aria-label", tr("Code copied"));
|
||||
} catch {
|
||||
button.dataset.editorTooltip = "Could not copy code";
|
||||
button.setAttribute("aria-label", "Could not copy code");
|
||||
button.dataset.editorTooltip = tr("Could not copy code");
|
||||
button.setAttribute("aria-label", tr("Could not copy code"));
|
||||
}
|
||||
};
|
||||
return button;
|
||||
@@ -86,7 +87,7 @@ class Checkbox extends WidgetType {
|
||||
box.type = "checkbox";
|
||||
box.checked = this.checked;
|
||||
box.className = "writer-checkbox";
|
||||
box.setAttribute("aria-label", this.checked ? "Mark task incomplete" : "Mark task complete");
|
||||
box.setAttribute("aria-label", this.checked ? tr("Mark task incomplete") : tr("Mark task complete"));
|
||||
box.addEventListener("mousedown", event => event.preventDefault());
|
||||
box.addEventListener("click", event => {
|
||||
event.stopPropagation();
|
||||
|
||||
Reference in New Issue
Block a user