An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Title localization when creating a document https://github.com/siyuan-note/siyuan/issues/10719
Daniel2a8809bc7ef1
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.jsonindex f1dbbea37a..2ef93b8611 100644--- a/app/appearance/langs/en_US.json+++ b/app/appearance/langs/en_US.json@@ -1317,7 +1317,7 @@"102": "Processing completed","103": "The update installation package has been automatically downloaded in the background. When exiting, you will be asked whether to install the new version","104": "The update installation package failed to download, please check the network connection",- "105": "TODO",+ "105": "Untitled","106": "Maximum length is limited to 512 characters","107": "Moved document [%s]","108": "Data sync found conflicts, you can view the generated conflict content in [Data History]",diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.jsonindex 797201069d..8074c9f871 100644--- a/app/appearance/langs/es_ES.json+++ b/app/appearance/langs/es_ES.json@@ -1317,7 +1317,7 @@"102": "Procesamiento completado","103": "El paquete de instalación de la actualización se ha descargado automáticamente en segundo plano. Al salir, se le preguntará si desea instalar la nueva versión","104": "El paquete de instalación de la actualización no se pudo descargar, verifique la conexión de red",- "105": "TODO",+ "105": "Sin título","106": "La longitud máxima está limitada a 512 caracteres","107": "Documento movido [%s]","108": "La sincronizaci\u00f3n de datos encontr\u00f3 en conflictos, puede ver el contenido del conflicto generado en [Historial de datos]",diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.jsonindex adb80e6446..550c67a25c 100644--- a/app/appearance/langs/fr_FR.json+++ b/app/appearance/langs/fr_FR.json@@ -1317,7 +1317,7 @@"102": "Traitement terminé","103": "Le package d'installation de la mise à jour a été automatiquement téléchargé en arrière-plan. En quittant, il vous sera demandé si vous souhaitez installer la nouvelle version","104": "Le package d'installation de la mise à jour n'a pas pu être téléchargé, veuillez vérifier la connexion réseau",- "105": "TODO",+ "105": "Sans titre","106": "La longueur maximale est limitée à 512 caractères","107": "Document déplacé [%s]","108": "La synchronisation des données a trouvé des conflits, vous pouvez afficher le contenu du conflit généré dans [Historique des données]",diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.jsonindex d45fe32773..c2acd85a4d 100644--- a/app/appearance/langs/zh_CHT.json+++ b/app/appearance/langs/zh_CHT.json@@ -648,7 +648,7 @@"changeIcon": "修改圖示","randomIcon": "隨機圖標","includeSubFile": "\n包含 x 個子文檔",- "untitled": "新文檔",+ "untitled": "未命名","lockScreen": "鎖定畫面","cloudIntro1": "端到端加密資料同步","cloudIntro2": "加密和解密過程完全在本地設備上進行",@@ -1317,7 +1317,7 @@"102": "處理完畢","103": "已經在後台開始自動下載更新安裝檔,退出時將詢問是否安裝新版本","104": "更新安裝檔下載失敗,請檢查網絡連接",- "105": "TODO",+ "105": "未命名","106": "最大長度限制為 512 字元","107": "已經移動文檔 [%s]","108": "資料同步發現衝突,可在 [資料歷史] 中查看生成的衝突內容",diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.jsonindex b3738b36d1..443dd1f456 100644--- a/app/appearance/langs/zh_CN.json+++ b/app/appearance/langs/zh_CN.json@@ -648,7 +648,7 @@"changeIcon": "修改图标","randomIcon": "随机图标","includeSubFile": "\n包含 x 个子文档",- "untitled": "新文档",+ "untitled": "未命名","lockScreen": "锁屏","cloudIntro1": "端到端加密数据同步","cloudIntro2": "加密和解密过程完全在本地设备上进行",@@ -1317,7 +1317,7 @@"102": "处理完毕","103": "已经在后台开始自动下载更新安装包,退出时将询问是否安装新版本","104": "更新安装包下载失败,请检查网络连接",- "105": "TODO",+ "105": "未命名","106": "最大长度限制为 512 字符","107": "已经移动文档 [%s]","108": "数据同步发现冲突,可在 [数据历史] 中查看生成的冲突内容",diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.tsindex 71625b02be..c9c85d2f46 100644--- a/app/src/boot/globalEvent/keydown.ts+++ b/app/src/boot/globalEvent/keydown.ts@@ -18,8 +18,7 @@ import {newFile} from "../../util/newFile";import {Constants} from "../../constants";import {openSetting} from "../../config";import {getInstanceById} from "../../layout/util";-import {closeTabByType, copyTab, getDockByType, resizeTabs, switchTabByIndex} from "../../layout/tabUtil";-import {getActiveTab} from "../../layout/tabUtil";+import {closeTabByType, copyTab, getActiveTab, getDockByType, resizeTabs, switchTabByIndex} from "../../layout/tabUtil";import {Tab} from "../../layout/Tab";import {Editor} from "../../editor";import {setEditMode} from "../../protyle/util/setEditMode";@@ -369,7 +368,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {}if (!isFileFocus && matchHotKey(window.siyuan.config.keymap.editor.general.spaceRepetition.custom, event)) {fetchPost("/api/riff/getTreeRiffDueCards", {rootID: protyle.block.rootID}, (response) => {- openCardByData(app, response.data, "doc", protyle.block.rootID, protyle.title.editElement.textContent || "Untitled");+ openCardByData(app, response.data, "doc", protyle.block.rootID, protyle.title.editElement.textContent || window.siyuan.languages.untitled);});event.preventDefault();return true;@@ -428,7 +427,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {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,});return true;}@@ -449,7 +448,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {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,});return true;}diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.tsindex a046faf32c..5cbf26dcf1 100644--- a/app/src/dialog/processSystem.ts+++ b/app/src/dialog/processSystem.ts@@ -54,7 +54,7 @@ export const reloadSync = (app: App, data: { upsertRootIDs: string[], removeRootid: window.siyuan.mobile.editor.protyle.block.rootID}, (response) => {setTitle(response.data.name);- (document.getElementById("toolbarName") as HTMLInputElement).value = response.data.name === "Untitled" ? "" : response.data.name;+ (document.getElementById("toolbarName") as HTMLInputElement).value = response.data.name === window.siyuan.languages.untitled ? "" : response.data.name;});}}@@ -389,7 +389,7 @@ export const setTitle = (title: string) => {dragElement.setAttribute("title", versionTitle);}} else {- title = title || "Untitled";+ title = title || window.siyuan.languages.untitled;document.title = `${title} - ${workspaceName} - ${window.siyuan.languages.siyuanNote} v${Constants.SIYUAN_VERSION}`;if (!dragElement) {return;diff --git a/app/src/editor/rename.ts b/app/src/editor/rename.tsindex fe72f03733..d51c2eb6f6 100644--- a/app/src/editor/rename.ts+++ b/app/src/editor/rename.ts@@ -82,7 +82,7 @@ export const rename = (options: {return false;}if (inputElement.value.trim() === "") {- inputElement.value = "Untitled";+ inputElement.value = window.siyuan.languages.untitled;} else {inputElement.value = replaceFileName(inputElement.value);}diff --git a/app/src/layout/dock/util.ts b/app/src/layout/dock/util.tsindex 69847f702d..91669de4f3 100644--- a/app/src/layout/dock/util.ts+++ b/app/src/layout/dock/util.ts@@ -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",diff --git a/app/src/menus/commonMenuItem.ts b/app/src/menus/commonMenuItem.tsindex 79b6de468f..6fe2a19344 100644--- a/app/src/menus/commonMenuItem.ts+++ b/app/src/menus/commonMenuItem.ts@@ -476,7 +476,7 @@ export const exportMd = (id: string) => {});btnsElement[1].addEventListener("click", () => {if (inputElement.value.trim() === "") {- inputElement.value = "Untitled";+ inputElement.value = window.siyuan.languages.untitled;} else {inputElement.value = replaceFileName(inputElement.value);}diff --git a/app/src/mobile/editor.ts b/app/src/mobile/editor.tsindex 2524a6a3d0..055946fe05 100644--- a/app/src/mobile/editor.ts+++ b/app/src/mobile/editor.ts@@ -91,7 +91,7 @@ export const openMobileFileById = (app: App, id: string, action = [Constants.CB_} else {window.siyuan.mobile.editor = new Protyle(app, document.getElementById("editor"), protyleOptions);}- (document.getElementById("toolbarName") as HTMLInputElement).value = data.data.rootTitle === "Untitled" ? "" : data.data.rootTitle;+ (document.getElementById("toolbarName") as HTMLInputElement).value = data.data.rootTitle === window.siyuan.languages.untitled ? "" : data.data.rootTitle;setEditor();closePanel();});diff --git a/app/src/mobile/util/MobileBackFoward.ts b/app/src/mobile/util/MobileBackFoward.tsindex 4bb1e5d392..ef29611936 100644--- a/app/src/mobile/util/MobileBackFoward.ts+++ b/app/src/mobile/util/MobileBackFoward.ts@@ -44,7 +44,7 @@ const focusStack = (backStack: IBackStack) => {id: backStack.id,}, (response) => {setTitle(response.data.name);- (document.getElementById("toolbarName") as HTMLInputElement).value = response.data.name === "Untitled" ? "" : response.data.name;+ (document.getElementById("toolbarName") as HTMLInputElement).value = response.data.name === window.siyuan.languages.untitled ? "" : response.data.name;protyle.background.render(response.data.ial, protyle.block.rootID);protyle.wysiwyg.renderCustom(response.data.ial);});diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.tsindex 7625db6d57..21e7396ca5 100644--- a/app/src/protyle/header/Title.ts+++ b/app/src/protyle/header/Title.ts@@ -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;}}diff --git a/app/src/protyle/header/openTitleMenu.ts b/app/src/protyle/header/openTitleMenu.tsindex 28a1d324d7..e366d1f44d 100644--- a/app/src/protyle/header/openTitleMenu.ts+++ b/app/src/protyle/header/openTitleMenu.ts@@ -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);diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.tsindex 166bfa16c9..72ba693ae8 100644--- a/app/src/protyle/hint/index.ts+++ b/app/src/protyle/hint/index.ts@@ -619,7 +619,7 @@ ${genHintItemHTML(item)}fetchPost("/api/filetree/createDoc", {notebook: protyle.notebookId,path: pathPosix().join(getDisplayName(protyle.path, false, true), newSubDocId + ".sy"),- title: "Untitled",+ title: window.siyuan.languages.untitled,md: ""}, () => {insertHTML(`<span data-type="block-ref" data-id="${newSubDocId}" data-subtype="d">Untitled</span>`, protyle);diff --git a/app/src/protyle/render/av/blockAttr.ts b/app/src/protyle/render/av/blockAttr.tsindex a51936040c..f6ca9bf0e8 100644--- a/app/src/protyle/render/av/blockAttr.ts+++ b/app/src/protyle/render/av/blockAttr.ts@@ -13,9 +13,9 @@ const genAVRollupHTML = (value: IAVCellValue) => {switch (value.type) {case "block":if (value?.isDetached) {- html = `<span data-id="${value.block?.id}">${value.block?.content || "Untitled"}</span>`;+ html = `<span data-id="${value.block?.id}">${value.block?.content || window.siyuan.languages.untitled}</span>`;} else {- html = `<span data-type="block-ref" data-id="${value.block?.id}" data-subtype="s" class="av__celltext--ref">${value.block?.content || "Untitled"}</span>`;+ html = `<span data-type="block-ref" data-id="${value.block?.id}" data-subtype="s" class="av__celltext--ref">${value.block?.content || window.siyuan.languages.untitled}</span>`;}break;case "text":diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex 527dcaeb6d..0e144aaf1d 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -613,7 +613,7 @@ export const renderCell = (cellValue: IAVCellValue) => {text = `<span class="av__celltext">${cellValue.block.content || ""}</span><span class="b3-chip b3-chip--info b3-chip--small" data-type="block-more">${window.siyuan.languages.more}</span>`;} else {- text = `<span data-type="block-ref" data-id="${cellValue.block.id}" data-subtype="s" class="av__celltext av__celltext--ref">${cellValue.block.content || "Untitled"}</span>+ text = `<span data-type="block-ref" data-id="${cellValue.block.id}" data-subtype="s" class="av__celltext av__celltext--ref">${cellValue.block.content || window.siyuan.languages.untitled}</span><span class="b3-chip b3-chip--info b3-chip--small" data-type="block-more">${window.siyuan.languages.update}</span>`;}} else if (cellValue.type === "number") {@@ -691,9 +691,9 @@ const renderRollup = (cellValue: IAVCellValue) => {}} else if (cellValue.type === "block") {if (cellValue?.isDetached) {- text = `<span class="av__celltext" data-id="${cellValue.block?.id}">${cellValue.block?.content || "Untitled"}</span>`;+ text = `<span class="av__celltext" data-id="${cellValue.block?.id}">${cellValue.block?.content || window.siyuan.languages.untitled}</span>`;} else {- text = `<span data-type="block-ref" data-id="${cellValue.block?.id}" data-subtype="s" class="av__celltext av__celltext--ref">${cellValue.block?.content || "Untitled"}</span>`;+ text = `<span data-type="block-ref" data-id="${cellValue.block?.id}" data-subtype="s" class="av__celltext av__celltext--ref">${cellValue.block?.content || window.siyuan.languages.untitled}</span>`;}} else if (cellValue.type === "number") {text = cellValue?.number.formattedContent || cellValue?.number.content.toString() || "";diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.tsindex dc3c0353f0..78a5380e1a 100644--- a/app/src/protyle/render/av/relation.ts+++ b/app/src/protyle/render/av/relation.ts@@ -240,11 +240,11 @@ const filterItem = (menuElement: Element, cellElement: HTMLElement, keyword: strconst hasIds: string[] = [];cellElement.querySelectorAll("span").forEach((item) => {hasIds.push(item.dataset.id);- selectHTML += `<button data-id="${item.dataset.id}" data-type="setRelationCell" class="b3-menu__item${item.textContent.indexOf(keyword) > -1 ? "" : " fn__none"}" draggable="true">${genSelectItemHTML("selected", item.dataset.id, !item.classList.contains("av__celltext--ref"), item.textContent || "Untitled")}</button>`;+ selectHTML += `<button data-id="${item.dataset.id}" data-type="setRelationCell" class="b3-menu__item${item.textContent.indexOf(keyword) > -1 ? "" : " fn__none"}" draggable="true">${genSelectItemHTML("selected", item.dataset.id, !item.classList.contains("av__celltext--ref"), item.textContent || window.siyuan.languages.untitled)}</button>`;});cells.forEach((item) => {if (!hasIds.includes(item.block.id)) {- html += genSelectItemHTML("unselect", item.block.id, item.isDetached, item.block.content || "Untitled");+ html += genSelectItemHTML("unselect", item.block.id, item.isDetached, item.block.content || window.siyuan.languages.untitled);}});menuElement.querySelector(".b3-menu__items").innerHTML = `${selectHTML || genSelectItemHTML("empty")}@@ -270,11 +270,11 @@ export const bindRelationEvent = (options: {const hasIds: string[] = [];options.cellElements[0].querySelectorAll("span").forEach((item) => {hasIds.push(item.dataset.id);- selectHTML += `<button data-id="${item.dataset.id}" data-type="setRelationCell" class="b3-menu__item" draggable="true">${genSelectItemHTML("selected", item.dataset.id, !item.classList.contains("av__celltext--ref"), item.textContent || "Untitled")}</button>`;+ selectHTML += `<button data-id="${item.dataset.id}" data-type="setRelationCell" class="b3-menu__item" draggable="true">${genSelectItemHTML("selected", item.dataset.id, !item.classList.contains("av__celltext--ref"), item.textContent || window.siyuan.languages.untitled)}</button>`;});cells.forEach((item) => {if (!hasIds.includes(item.block.id)) {- html += genSelectItemHTML("unselect", item.block.id, item.isDetached, item.block.content || "Untitled");+ html += genSelectItemHTML("unselect", item.block.id, item.isDetached, item.block.content || window.siyuan.languages.untitled);}});options.menuElement.querySelector(".b3-menu__label").innerHTML = response.data.name;diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.tsindex db99efc6d0..0d175872ae 100644--- a/app/src/util/newFile.ts+++ b/app/src/util/newFile.ts@@ -96,7 +96,7 @@ export const newFile = (optios: {if (data.data.path.startsWith("/") || optios.currentPath === "/") {fetchPost("/api/filetree/createDocWithMd", {notebook: optios.notebookId,- path: pathPosix().join(data.data.path, optios.name || (data.data.path.endsWith("/") ? "Untitled" : "")),+ path: pathPosix().join(data.data.path, optios.name || (data.data.path.endsWith("/") ? window.siyuan.languages.untitled : "")),// 根目录时无法确定 parentIDmarkdown: ""}, response => {@@ -117,7 +117,7 @@ export const newFile = (optios: {}, (responseHPath) => {fetchPost("/api/filetree/createDocWithMd", {notebook: optios.notebookId,- path: pathPosix().join(responseHPath.data, data.data.path, optios.name || (data.data.path.endsWith("/") ? "Untitled" : "")),+ path: pathPosix().join(responseHPath.data, data.data.path, optios.name || (data.data.path.endsWith("/") ? window.siyuan.languages.untitled : "")),parentID: getDisplayName(optios.currentPath, true, true),markdown: ""}, response => {@@ -134,7 +134,7 @@ export const newFile = (optios: {});}} else {- const title = pathPosix().basename(data.data.path || "Untitled");+ const title = pathPosix().basename(data.data.path || window.siyuan.languages.untitled);if (!validateName(title)) {return;}@@ -191,12 +191,12 @@ export const newFileByName = (app: App, value: string) => {newFile({app,useSavePath: true,- name: replaceFileName(value.trim()) || "Untitled"+ name: replaceFileName(value.trim()) || window.siyuan.languages.untitled});};export const newFileBySelect = (protyle: IProtyle, selectText: string, nodeElement: HTMLElement, pathDir: string) => {- const newFileName = replaceFileName(selectText.trim() ? selectText.trim() : protyle.lute.BlockDOM2Content(nodeElement.outerHTML).replace(/\n/g, "")) || "Untitled";+ const newFileName = replaceFileName(selectText.trim() ? selectText.trim() : protyle.lute.BlockDOM2Content(nodeElement.outerHTML).replace(/\n/g, "")) || window.siyuan.languages.untitled;const hPath = pathPosix().join(pathDir, newFileName);fetchPost("/api/filetree/getIDsByHPath", {path: hPath,diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.goindex 52fc6e3253..ff356fb4c3 100644--- a/kernel/model/attribute_view.go+++ b/kernel/model/attribute_view.go@@ -1738,7 +1738,7 @@ func getAvNames(avIDs string) (ret string) {continue}if "" == nodeAvName {- nodeAvName = "Untitled"+ nodeAvName = Conf.language(105)}tpl := strings.ReplaceAll(attrAvNameTpl, "${avID}", nodeAvID)diff --git a/kernel/model/blockinfo.go b/kernel/model/blockinfo.goindex cd3702dd2c..5b3ac3cc4d 100644--- a/kernel/model/blockinfo.go+++ b/kernel/model/blockinfo.go@@ -101,7 +101,7 @@ func GetDocInfo(blockID string) (ret *BlockInfo) {}if "" == avName {- avName = "Untitled"+ avName = Conf.language(105)}attrView := &AttrView{ID: avID, Name: avName}diff --git a/kernel/model/export.go b/kernel/model/export.goindex eba5ee4ec6..38b39563f6 100644--- a/kernel/model/export.go+++ b/kernel/model/export.go@@ -76,7 +76,7 @@ func ExportAv2CSV(avID, blockID string) (zipPath string, err error) {name := util.FilterFileName(attrView.Name)if "" == name {- name = "Untitled"+ name = Conf.language(105)}table, err := renderAttributeViewTable(attrView, view, "")@@ -1375,7 +1375,7 @@ func BatchExportMarkdown(boxID, folderPath string) (zipPath string) {baseFolderName = path.Base(block.HPath)}if "" == baseFolderName {- baseFolderName = "Untitled"+ baseFolderName = Conf.language(105)}docFiles := box.ListFiles(folderPath)diff --git a/kernel/model/file.go b/kernel/model/file.goindex 2e1a236639..90ce4656fb 100644--- a/kernel/model/file.go+++ b/kernel/model/file.go@@ -1568,7 +1568,7 @@ func RenameDoc(boxID, p, title string) (err error) {return}if "" == title {- title = "Untitled"+ title = Conf.language(105)}title = strings.ReplaceAll(title, "/", "")@@ -1604,6 +1604,10 @@ func createDoc(boxID, p, title, dom string) (tree *parse.Tree, err error) {return}title = strings.ReplaceAll(title, "/", "")+ title = strings.TrimSpace(title)+ if "" == title {+ title = Conf.Language(105)+ }baseName := strings.TrimSpace(path.Base(p))if "" == strings.TrimSuffix(baseName, ".sy") {diff --git a/kernel/model/history.go b/kernel/model/history.goindex 35bff75a3f..8fd1cdce81 100644--- a/kernel/model/history.go+++ b/kernel/model/history.go@@ -687,7 +687,7 @@ func indexHistoryDir(name string, luteEngine *lute.Lute) {title := tree.Root.IALAttr("title")if "" == title {- title = "Untitled"+ title = Conf.language(105)}content := tree.Root.Content()p := strings.TrimPrefix(doc, util.HistoryDir)diff --git a/kernel/model/mount.go b/kernel/model/mount.goindex 988f530e6c..2d79e64e3f 100644--- a/kernel/model/mount.go+++ b/kernel/model/mount.go@@ -40,6 +40,9 @@ func CreateBox(name string) (id string, err error) {err = errors.New(Conf.Language(106))return}+ if "" == name {+ name = Conf.language(105)+ }WaitForWritingFiles()@@ -67,6 +70,16 @@ func RenameBox(boxID, name string) (err error) {return errors.New(Conf.Language(0))}+ if 512 < utf8.RuneCountInString(name) {+ // 限制笔记本名和文档名最大长度为 `512`+ err = errors.New(Conf.Language(106))+ return+ }++ if "" == name {+ name = Conf.language(105)+ }+boxConf := box.GetConf()boxConf.Name = namebox.Name = name