🎨 Title localization when creating a document https://github.com/siyuan-note/siyuan/issues/10719

This commit is contained in:
Daniel 2024-03-24 22:15:19 +08:00
parent f5043a8c46
commit 2a8809bc7e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
25 changed files with 72 additions and 61 deletions

View file

@ -1,14 +1,15 @@
import {
focusBlock, focusByOffset,
focusByRange, focusByWbr,
getEditorRange, getSelectionOffset,
focusBlock,
focusByOffset,
focusByRange,
focusByWbr,
getEditorRange,
getSelectionOffset,
} from "../util/selection";
import {fetchPost} from "../../util/fetch";
import {replaceFileName, validateName} from "../../editor/rename";
import {MenuItem} from "../../menus/Menu";
import {
openFileAttr,
} from "../../menus/commonMenuItem";
import {openFileAttr,} from "../../menus/commonMenuItem";
import {Constants} from "../../constants";
import {matchHotKey} from "../util/hotKey";
import {isMac, readText, writeText} from "../util/compatibility";
@ -264,7 +265,7 @@ export class Title {
public setTitle(title: string) {
if (code160to32(title) !== code160to32(this.editElement.textContent)) {
this.editElement.textContent = title === "Untitled" ? "" : title;
this.editElement.textContent = title === window.siyuan.languages.untitled ? "" : title;
}
}