Skip to content

Commit

Permalink
refa: migrate yandere schema to i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan committed Aug 14, 2024
1 parent f49a535 commit 2796300
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/yande/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ namespace YandeImageSource {
export const Config: Schema<Config> = Schema.intersect([
ImageSource.createSchema({ label: 'yande' }),
Schema.object({
endpoint: Schema.string().description('Yande.re 的 URL。').default('https://yande.re'),
endpoint: Schema.string().default('https://yande.re'),
keyPairs: Schema.array(
Schema.object({
login: Schema.string().required().description('Yande.re 的用户名。'),
password: Schema.string().required().role('secret').description('Yande.re 的密码。'),
login: Schema.string().required(),
password: Schema.string().required().role('secret'),
}),
)
.default([])
.description('Yande.re 的登录凭据。'),
}).description('搜索设置'),
).default([]),
}).i18n({
'zh-CN': require('./locales/zh-CN.schema'),
}),
])
}

Expand Down
7 changes: 7 additions & 0 deletions packages/yande/src/locales/zh-CN.schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$description: 搜索设置
endpoint: Yande.re 的 URL。
keyPairs:
$description: Yande.re 的登录凭据。
$inner:
login: Yande.re 的用户名。
password: Yande.re 的密码。

0 comments on commit 2796300

Please sign in to comment.