diff --git a/crowdin.yml b/crowdin.yml index ba9ce169f8..9cada4ab73 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,6 +1,8 @@ +commit_message: '[skip ci]' pull_request_title: 'i18n: update translations' pull_request_labels: - i18n files: - source: /**/src/locales/zh-CN.yml translation: /%original_path%/%locale%.yml + skip_untranslated_strings: true diff --git a/plugins/database/mongo/src/index.ts b/plugins/database/mongo/src/index.ts index 19b20d0a80..78185bad8a 100644 --- a/plugins/database/mongo/src/index.ts +++ b/plugins/database/mongo/src/index.ts @@ -2,10 +2,12 @@ import { defineDriver, Schema } from 'koishi' import { MongoDriver } from '@minatojs/driver-mongo' export default defineDriver(MongoDriver, Schema.object({ - protocol: Schema.string().description('要使用的协议名。').default('mongodb'), - host: Schema.string().description('要连接到的主机名。').default('localhost'), - port: Schema.natural().max(65535).description('要连接到的端口号。'), - username: Schema.string().description('要使用的用户名。'), - password: Schema.string().description('要使用的密码。').role('secret'), - database: Schema.string().description('要访问的数据库名。').default('koishi'), + protocol: Schema.string().default('mongodb'), + host: Schema.string().default('localhost'), + port: Schema.natural().max(65535), + username: Schema.string(), + password: Schema.string().role('secret'), + database: Schema.string().default('koishi'), +}).i18n({ + 'zh-CN': require('./locales/zh-CN'), })) diff --git a/plugins/database/mongo/src/locales/zh-CN.yml b/plugins/database/mongo/src/locales/zh-CN.yml new file mode 100644 index 0000000000..0dc1eefc30 --- /dev/null +++ b/plugins/database/mongo/src/locales/zh-CN.yml @@ -0,0 +1,6 @@ +protocol: 要使用的协议名。 +host: 要连接到的主机名。 +port: 要连接到的端口号。 +username: 要使用的用户名。 +password: 要使用的密码。 +database: 要访问的数据库名。 diff --git a/plugins/database/mysql/src/index.ts b/plugins/database/mysql/src/index.ts index 1508c897d1..2554a9d3cb 100644 --- a/plugins/database/mysql/src/index.ts +++ b/plugins/database/mysql/src/index.ts @@ -2,9 +2,11 @@ import { defineDriver, Schema } from 'koishi' import { MySQLDriver } from '@minatojs/driver-mysql' export default defineDriver(MySQLDriver, Schema.object({ - host: Schema.string().description('要连接到的主机名。').default('localhost'), - port: Schema.natural().max(65535).description('要连接到的端口号。').default(3306), - user: Schema.string().description('要使用的用户名。').default('root'), - password: Schema.string().description('要使用的密码。').role('secret'), - database: Schema.string().description('要访问的数据库名。').default('koishi'), + host: Schema.string().default('localhost'), + port: Schema.natural().max(65535).default(3306), + user: Schema.string().default('root'), + password: Schema.string().role('secret'), + database: Schema.string().default('koishi'), +}).i18n({ + 'zh-CN': require('./locales/zh-CN'), })) diff --git a/plugins/database/mysql/src/locales/zh-CN.yml b/plugins/database/mysql/src/locales/zh-CN.yml new file mode 100644 index 0000000000..63eacada39 --- /dev/null +++ b/plugins/database/mysql/src/locales/zh-CN.yml @@ -0,0 +1,5 @@ +host: 要连接到的主机名。 +port: 要连接到的端口号。 +user: 要使用的用户名。 +password: 要使用的密码。 +database: 要访问的数据库名。 diff --git a/plugins/database/sqlite/src/index.ts b/plugins/database/sqlite/src/index.ts index 26bbeabd71..7dc7a43625 100644 --- a/plugins/database/sqlite/src/index.ts +++ b/plugins/database/sqlite/src/index.ts @@ -3,7 +3,9 @@ import { SQLiteDriver } from '@minatojs/driver-sqlite' import path from 'path' export default defineDriver(SQLiteDriver, Schema.object({ - path: Schema.string().description('数据库路径').default('.koishi.db'), + path: Schema.string().default('.koishi.db'), +}).i18n({ + 'zh-CN': require('./locales/zh-CN'), }), (ctx, config) => { if (config.path !== ':memory:') { config.path = path.resolve(ctx.baseDir, config.path) diff --git a/plugins/database/sqlite/src/locales/zh-CN.yml b/plugins/database/sqlite/src/locales/zh-CN.yml new file mode 100644 index 0000000000..b09c9d6bd4 --- /dev/null +++ b/plugins/database/sqlite/src/locales/zh-CN.yml @@ -0,0 +1 @@ +path: 数据库路径。 diff --git a/plugins/hmr/src/index.ts b/plugins/hmr/src/index.ts index f25d827222..12e9aaf3f6 100644 --- a/plugins/hmr/src/index.ts +++ b/plugins/hmr/src/index.ts @@ -319,11 +319,11 @@ namespace Watcher { } export const Config: Schema = Schema.object({ - base: Schema.string().description('用户显示路径的根目录,默认为当前工作路径。'), + base: Schema.string(), root: Schema.union([ Schema.array(String).role('table'), Schema.transform(String, (value) => [value]), - ]).default(['.']).description('要监听的文件或目录列表,相对于 `base` 路径。'), + ]).default(['.']), ignored: Schema.union([ Schema.array(String).role('table'), Schema.transform(String, (value) => [value]), @@ -331,8 +331,10 @@ namespace Watcher { '**/node_modules/**', '**/.git/**', '**/logs/**', - ]).description('要忽略的文件或目录。支持 [Glob Patterns](https://github.com/micromatch/micromatch) 语法。'), - debounce: Schema.natural().role('ms').default(100).description('延迟触发更新的等待时间。'), + ]), + debounce: Schema.natural().role('ms').default(100), + }).i18n({ + 'zh-CN': require('./locales/zh-CN'), }) } diff --git a/plugins/hmr/src/locales/zh-CN.yml b/plugins/hmr/src/locales/zh-CN.yml new file mode 100644 index 0000000000..7c737afa6c --- /dev/null +++ b/plugins/hmr/src/locales/zh-CN.yml @@ -0,0 +1,4 @@ +base: 用户显示路径的根目录,默认为当前工作路径。 +root: 要监听的文件或目录列表,相对于 `base` 路径。 +ignored: 要忽略的文件或目录。支持 [Glob Patterns](https://github.com/micromatch/micromatch) 语法。 +debounce: 延迟触发更新的等待时间。