🐛 The marketplace language does not change after switching the appearance language https://github.com/siyuan-note/siyuan/issues/12892
This commit is contained in:
parent
b599c87112
commit
e25e8042ba
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue