🌐 启动界面进度提示加入多语言

This commit is contained in:
Liang Ding 2022-09-19 23:46:43 +08:00
parent b7faccc126
commit 899b38ab0a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 19 additions and 19 deletions

View file

@ -523,11 +523,11 @@ func InitBoxes() {
initialized := false
if 1 > treenode.CountBlocks() {
if gulu.File.IsExist(util.BlockTreePath) {
util.IncBootProgress(20, "Reading block trees...")
util.IncBootProgress(20, Conf.Language(91))
go func() {
for i := 0; i < 40; i++ {
util.RandomSleep(50, 100)
util.IncBootProgress(1, "Reading block trees...")
util.IncBootProgress(1, Conf.Language(91))
}
}()

View file

@ -84,7 +84,7 @@ func (box *Box) Index(fullRebuildIndex bool) (treeCount int, treeSize int64) {
docIAL := parse.IAL2MapUnEsc(tree.Root.KramdownIAL)
cache.PutDocIAL(p, docIAL)
util.IncBootProgress(bootProgressPart, "Parsing tree "+util.ShortPathForBootingDisplay(tree.Path))
util.IncBootProgress(bootProgressPart, fmt.Sprintf(Conf.Language(92), util.ShortPathForBootingDisplay(tree.Path)))
treeSize += file.size
treeCount++
// 缓存文档标题,后面做 Path -> HPath 路径映射时需要
@ -161,7 +161,7 @@ func (box *Box) Index(fullRebuildIndex bool) (treeCount int, treeSize int64) {
continue
}
util.IncBootProgress(bootProgressPart, "Indexing tree "+util.ShortPathForBootingDisplay(tree.Path))
util.IncBootProgress(bootProgressPart, fmt.Sprintf(Conf.Language(93), util.ShortPathForBootingDisplay(tree.Path)))
tx, err := sql.BeginTx()
if nil != err {
continue