mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-19 23:06:09 +01:00
🎨 Title localization when creating a document https://github.com/siyuan-note/siyuan/issues/10719
This commit is contained in:
parent
f5043a8c46
commit
2a8809bc7e
25 changed files with 72 additions and 61 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,6 @@
|
|||
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
||||
import {MenuItem} from "../../menus/Menu";
|
||||
import {
|
||||
copySubMenu,
|
||||
exportMd,
|
||||
movePathToMenu,
|
||||
openFileAttr,
|
||||
openFileWechatNotify,
|
||||
} from "../../menus/commonMenuItem";
|
||||
import {copySubMenu, exportMd, movePathToMenu, openFileAttr, openFileWechatNotify,} from "../../menus/commonMenuItem";
|
||||
import {deleteFile} from "../../editor/deleteFile";
|
||||
import {updateHotkeyTip} from "../util/compatibility";
|
||||
/// #if !MOBILE
|
||||
|
|
@ -105,7 +99,7 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
|||
blockId: protyle.block.id,
|
||||
rootId: protyle.block.rootID,
|
||||
useBlockId: protyle.block.showAll,
|
||||
title: protyle.title ? (protyle.title.editElement.textContent || "Untitled") : null
|
||||
title: protyle.title ? (protyle.title.editElement.textContent || window.siyuan.languages.untitled) : null
|
||||
});
|
||||
}
|
||||
}).element);
|
||||
|
|
@ -119,7 +113,7 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
|||
blockId: protyle.block.id,
|
||||
rootId: protyle.block.rootID,
|
||||
useBlockId: protyle.block.showAll,
|
||||
title: protyle.title ? (protyle.title.editElement.textContent || "Untitled") : null
|
||||
title: protyle.title ? (protyle.title.editElement.textContent || window.siyuan.languages.untitled) : null
|
||||
});
|
||||
}
|
||||
}).element);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue