Skip to content

bazaar 用 map 替代 i18n struct - #16960

Merged
88250 merged 1 commit into
siyuan-note:devfrom
TCOTC:fix/bazaar-re
Feb 3, 2026
Merged

bazaar 用 map 替代 i18n struct#16960
88250 merged 1 commit into
siyuan-note:devfrom
TCOTC:fix/bazaar-re

Conversation

@TCOTC

@TCOTC TCOTC commented Feb 1, 2026

Copy link
Copy Markdown
Contributor
  • package.go:DisplayName/Description/Readme 改为 map[string]string,统一 getPreferredLocaleString
  • bazzar.go:搜索匹配适配 LocaleStrings,抽出 packageContainsKeyword
  • bazaar.ts:keyword 仅在有值时传入 API,提升查询性能
  • appearance:主题「默认主题」与 displayName 改为多语言 key 与 map 取值

原来的方式拓展性比较差,添加语种的时候还容易漏改。

之后还要优化 https://github.com/siyuan-note/bazaar ,目前 json 里有大量的空值字段。→ siyuan-note/bazaar@a191200

- package.go:DisplayName/Description/Readme 改为 map[string]string,统一 getPreferredLocaleString
- bazzar.go:搜索匹配适配 LocaleStrings,抽出 packageContainsKeyword
- bazaar.ts:keyword 仅在有值时传入 API
- appearance:主题「默认主题」与 displayName 改为多语言 key 与 map 取值
@88250
88250 merged commit 9642f48 into siyuan-note:dev Feb 3, 2026
4 checks passed
@88250

88250 commented Feb 3, 2026

Copy link
Copy Markdown
Member

v3.5.5

Vanessa219 added a commit that referenced this pull request Feb 3, 2026
@TCOTC

TCOTC commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

@Vanessa219 前端传空 keyword 的话接口会有不必要的开销,会慢一些

@TCOTC

TCOTC commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

要不我再看看后端能不能针对性优化一下

@88250

88250 commented Feb 4, 2026

Copy link
Copy Markdown
Member

这个应该不会有太大差别吧

@TCOTC
TCOTC deleted the fix/bazaar-re branch February 4, 2026 08:49
@TCOTC

TCOTC commented Feb 4, 2026

Copy link
Copy Markdown
Contributor Author

确实没啥差别,筛选空字符串只多花 1000 微秒,不过我已经改好了 #16973

@TCOTC

TCOTC commented Feb 4, 2026

Copy link
Copy Markdown
Contributor Author

我改完后端之后发现这个实际上不是前端的问题,后端没有接受到 keyword 参数的时候也是一样当做空字符串处理的,之前测试以为有很大的开销估计是别的地方的代码导致的,反正现在是解决了。

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants