Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Schema.computed 无法正确应用 i18n 文本 #345

Open
dingyi222666 opened this issue Feb 11, 2025 · 0 comments
Open

Bug: Schema.computed 无法正确应用 i18n 文本 #345

dingyi222666 opened this issue Feb 11, 2025 · 0 comments

Comments

@dingyi222666
Copy link

参考下面的复现代码:

import { Context, Schema } from "koishi";

export const name = "test";

export interface Config {}

export const Config: Schema<Config> = Schema.object({
  foo: Schema.number().computed(),
  bar: Schema.number().description("bar").computed(),
  abc: Schema.number(),
}).i18n({
  "zh-CN": {
    foo: "测试",
    abc: "测试2",
  },
});

export function apply(ctx: Context, config: Config) {}

运行后得到:

Image

可以发现只有 abc 选项正常显示了描述,foobar 都无法显示描述。

补充说明:
当去除下方的 i18n 代码后,bar 配置项又能正常显示描述。

版本号:

"koishi": "^4.18.7",
"@koishijs/plugin-console": "^5.30.3",
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

No branches or pull requests

1 participant