Skip to content

Commit

Permalink
🎨 Improve marketplace package for traditional Chinese #8342
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed May 23, 2023
1 parent 6de41ed commit df76823
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kernel/bazaar/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ func getPreferredReadme(readme *Readme) string {
if "" != readme.ZhCN {
ret = readme.ZhCN
}
case "zh_CHT":
if "" != readme.ZhCN {
ret = readme.ZhCN
}
case "en_US":
if "" != readme.EnUS {
ret = readme.EnUS
Expand All @@ -158,6 +162,10 @@ func getPreferredName(pkg *Package) string {
if "" != pkg.DisplayName.ZhCN {
ret = pkg.DisplayName.ZhCN
}
case "zh_CHT":
if "" != pkg.DisplayName.ZhCN {
ret = pkg.DisplayName.ZhCN
}
case "en_US":
if "" != pkg.DisplayName.EnUS {
ret = pkg.DisplayName.EnUS
Expand All @@ -181,6 +189,10 @@ func getPreferredDesc(desc *Description) string {
if "" != desc.ZhCN {
ret = desc.ZhCN
}
case "zh_CHT":
if "" != desc.ZhCN {
ret = desc.ZhCN
}
case "en_US":
if "" != desc.EnUS {
ret = desc.EnUS
Expand Down
4 changes: 4 additions & 0 deletions kernel/model/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ func loadCode(petal *Petal) {
if !foundPreferredLang {
if foundEnUS {
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 {
preferredLang = "zh_CN.json"
} else {
Expand Down

0 comments on commit df76823

Please sign in to comment.