🐛 The marketplace language does not change after switching the appearance language https://github.com/siyuan-note/siyuan/issues/12892

This commit is contained in:
Daniel 2024-10-26 21:36:08 +08:00
parent b599c87112
commit e25e8042ba
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 11 additions and 0 deletions

View file

@ -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"
@ -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
}

View file

@ -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