Skip to content

Commit

Permalink
🐛 The marketplace language does not change after switching the appear…
Browse files Browse the repository at this point in the history
…ance language #12892
  • Loading branch information
88250 committed Oct 26, 2024
1 parent b599c87 commit e25e804
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/api/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/88250/gulu"
"github.com/gin-gonic/gin"
"github.com/siyuan-note/siyuan/kernel/bazaar"
"github.com/siyuan-note/siyuan/kernel/conf"
"github.com/siyuan-note/siyuan/kernel/model"
"github.com/siyuan-note/siyuan/kernel/server/proxy"
Expand Down Expand Up @@ -527,10 +528,16 @@ func setAppearance(c *gin.Context) {

model.Conf.Appearance = appearance
model.Conf.Lang = appearance.Lang
oldLang := util.Lang
util.Lang = model.Conf.Lang
model.Conf.Save()
model.InitAppearance()

if oldLang != util.Lang {
// The marketplace language does not change after switching the appearance language https://github.com/siyuan-note/siyuan/issues/12892
bazaar.CleanBazaarPackageCache()
}

ret.Data = model.Conf.Appearance
}

Expand Down
4 changes: 4 additions & 0 deletions kernel/bazaar/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,4 +722,8 @@ func disallowDisplayBazaarPackage(pkg *Package) bool {

var packageCache = gcache.New(6*time.Hour, 30*time.Minute) // [repoURL]*Package

func CleanBazaarPackageCache() {
packageCache.Flush()
}

var packageInstallSizeCache = gcache.New(48*time.Hour, 6*time.Hour) // [repoURL]*int64

0 comments on commit e25e804

Please sign in to comment.