mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-07 01:08:49 +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,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 = name
|
||||
box.Name = name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue