Skip to content

支持在基础库里面的多语言被应用程序项目替换 - #35

Draft
lindexi wants to merge 7 commits into
mainfrom
t/lindexi/LocalizedStringProvider
Draft

lindexi wants to merge 7 commits into
mainfrom
t/lindexi/LocalizedStringProvider

Conversation

@lindexi

@lindexi lindexi commented Sep 17, 2026

Copy link
Copy Markdown
Member

需求:

  • 库要开箱即用,库要支持多语言。于是就应该在库项目提供一份多语言,但是允许被上层业务项目覆盖
  • 插件项目也要多语言。插件项目的内容不是主项目可以提前知道的,但是处理一些统一多语言是在主项目实现的,比如 HeaderToolManager 之类的业务,其中的 HeaderTool 是可以插件注入的

解决方法:

提供 AddProvider 的方法,用于提供多个多语言源头

对于库来说,直接用自己的源代码生成器的 LibLang 类;只是要求采用字典的方式才能被注入

对于插件来说,提供的是 Provider 可以主动加入到主项目中

边界处理:

要求采用字典的方式,否则构建异常

带通知的方式加入,自动加事件

@dotnet-campus dotnet-campus deleted a comment from xinyuehtx Sep 17, 2026
@lindexi
lindexi requested a review from walterlv September 17, 2026 11:49
@lindexi
lindexi marked this pull request as draft September 17, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant