🎨 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

@ -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") {