🎨 Improve marketplace package for traditional Chinese https://github.com/siyuan-note/siyuan/issues/8342

This commit is contained in:
Daniel 2023-05-23 20:55:05 +08:00
parent 6de41eda82
commit df7682384e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 16 additions and 0 deletions

View file

@ -135,6 +135,10 @@ func getPreferredReadme(readme *Readme) string {
if "" != readme.ZhCN { if "" != readme.ZhCN {
ret = readme.ZhCN ret = readme.ZhCN
} }
case "zh_CHT":
if "" != readme.ZhCN {
ret = readme.ZhCN
}
case "en_US": case "en_US":
if "" != readme.EnUS { if "" != readme.EnUS {
ret = readme.EnUS ret = readme.EnUS
@ -158,6 +162,10 @@ func getPreferredName(pkg *Package) string {
if "" != pkg.DisplayName.ZhCN { if "" != pkg.DisplayName.ZhCN {
ret = pkg.DisplayName.ZhCN ret = pkg.DisplayName.ZhCN
} }
case "zh_CHT":
if "" != pkg.DisplayName.ZhCN {
ret = pkg.DisplayName.ZhCN
}
case "en_US": case "en_US":
if "" != pkg.DisplayName.EnUS { if "" != pkg.DisplayName.EnUS {
ret = pkg.DisplayName.EnUS ret = pkg.DisplayName.EnUS
@ -181,6 +189,10 @@ func getPreferredDesc(desc *Description) string {
if "" != desc.ZhCN { if "" != desc.ZhCN {
ret = desc.ZhCN ret = desc.ZhCN
} }
case "zh_CHT":
if "" != desc.ZhCN {
ret = desc.ZhCN
}
case "en_US": case "en_US":
if "" != desc.EnUS { if "" != desc.EnUS {
ret = desc.EnUS ret = desc.EnUS

View file

@ -136,6 +136,10 @@ func loadCode(petal *Petal) {
if !foundPreferredLang { if !foundPreferredLang {
if foundEnUS { if foundEnUS {
preferredLang = "en_US.json" preferredLang = "en_US.json"
if "zh_CHT" == Conf.Lang && foundZhCN {
// Improve marketplace package for traditional Chinese https://github.com/siyuan-note/siyuan/issues/8342
preferredLang = "zh_CN.json"
}
} else if foundZhCN { } else if foundZhCN {
preferredLang = "zh_CN.json" preferredLang = "zh_CN.json"
} else { } else {