mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-28 03:06:10 +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
|
|
@ -40,13 +40,13 @@ export const openBacklink = async (options: {
|
|||
}
|
||||
options.rootId = response.data.rootID;
|
||||
options.useBlockId = response.data.rootID !== response.data.id;
|
||||
options.title = response.data.name || "Untitled";
|
||||
options.title = response.data.name || window.siyuan.languages.untitled;
|
||||
} else if (!options.title) {
|
||||
const response = await fetchSyncPost("api/block/getDocInfo", {id: options.blockId});
|
||||
if (response.code === -1) {
|
||||
return;
|
||||
}
|
||||
options.title = response.data.name || "Untitled";
|
||||
options.title = response.data.name || window.siyuan.languages.untitled;
|
||||
}
|
||||
const newWnd = wnd.split("lr");
|
||||
newWnd.addTab(new Tab({
|
||||
|
|
@ -96,13 +96,13 @@ export const openGraph = async (options: {
|
|||
}
|
||||
options.rootId = response.data.rootID;
|
||||
options.useBlockId = response.data.rootID !== response.data.id;
|
||||
options.title = response.data.name || "Untitled";
|
||||
options.title = response.data.name || window.siyuan.languages.untitled;
|
||||
} else if (!options.title) {
|
||||
const response = await fetchSyncPost("api/block/getDocInfo", {id: options.blockId});
|
||||
if (response.code === -1) {
|
||||
return;
|
||||
}
|
||||
options.title = response.data.name || "Untitled";
|
||||
options.title = response.data.name || window.siyuan.languages.untitled;
|
||||
}
|
||||
const newWnd = wnd.split("lr");
|
||||
newWnd.addTab(new Tab({
|
||||
|
|
@ -142,9 +142,9 @@ export const openOutline = async (protyle: IProtyle) => {
|
|||
let title = "";
|
||||
if (!protyle.title) {
|
||||
const response = await fetchSyncPost("api/block/getDocInfo", {id: protyle.block.rootID});
|
||||
title = response.data.name || "Untitled";
|
||||
title = response.data.name || window.siyuan.languages.untitled;
|
||||
} else {
|
||||
title = protyle.title.editElement.textContent || "Untitled";
|
||||
title = protyle.title.editElement.textContent || window.siyuan.languages.untitled;
|
||||
}
|
||||
newWnd.addTab(new Tab({
|
||||
icon: "iconAlignCenter",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue