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

i18n(core/cli/helper): add traditional chinese #666

Merged
merged 6 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/cli/src/locales/zht.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
commands:
exit:
description: 關閉機器人

options:
restart: 重啓

messages:
exiting: 正在關閉……
restarting: 正在重啓……
restarted: 已重啓。
1 change: 1 addition & 0 deletions packages/cli/src/worker/daemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function apply(ctx: Context, config: Config = {}) {
ctx.i18n.define('zh', require('../locales/zh'))
ctx.i18n.define('ja', require('../locales/ja'))
ctx.i18n.define('fr', require('../locales/fr'))
ctx.i18n.define('zht', require('../locales/zht'))
shigma marked this conversation as resolved.
Show resolved Hide resolved

ctx
.command('exit', { authority: 4 })
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class I18n {
this.define('en', require('./locales/en'))
this.define('ja', require('./locales/ja'))
this.define('fr', require('./locales/fr'))
this.define('zht', require('./locales/zht'))
this.registerBuiltins()
}

Expand Down
53 changes: 53 additions & 0 deletions packages/core/src/locales/zht.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
general:
name: 中文
paren: '({0})'
quote: '「{0}」'
comma: ,
and: 和
or: 或
day: 天
hour: 小時
minute: 分鐘
second: 秒

internal:
low-authority: 沒有足夠的權限。
insufficient-arguments: 參數個數不足,輸入「help」查看用法。
redunant-arguments: 參數個數冗餘,輸入「help」查看用法。
invalid-argument: 參數 {0} 無效,{1}
unknown-option: 存在未知選項 {0},輸入「help」查看用法。
invalid-option: 選項 {0} 無效,{1}
check-syntax: 輸入「help」查看用法。
invalid-number: 請輸入有效數字。
invalid-integer: 請輸入有效整數。
invalid-posint: 請輸入有效正整數。
invalid-natural: 請輸入有效非負整數。
invalid-date: 請輸入有效時間。
invalid-user: 請指定有效用戶。
invalid-channel: 請指定有效頻道。

suggest:
hint: 你想輸入的是{0}嗎?
command-prefix: ''
command-suffix: 發送句號可使用推測的指令。
help-prefix: 未找到指令。
help-suffix: 發送句號可使用推測的指令。

commands:
help:
description: 顯示幫助信息
options:
help: 顯示當前信息
authority: 顯示權限設置
showHidden: 顯示隱藏的指令和選項
messages:
hint-authority: 括弧内為對應的最低權限
hint-subcommand: 附有星號的表示其包含子指令
command-aliases: 別名:{0}。
command-examples: 使用示例:
command-authority: 最低權限:{0} 級。
subcommand-prolog: 可用的子指令有{0}:
global-prolog: 當前可用的子指令有{0}:
global-epilog: 輸入「help 指令名」查看特定指令的語法及使用示例。
available-options: 可用的選項有:
available-options-with-authority: 可用的選項有(括弧表示額外的權限要求):
1 change: 1 addition & 0 deletions packages/helpers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function loadI18n(app: App) {
app.i18n.define('en', require('./locales/en'))
app.i18n.define('ja', require('./locales/ja'))
app.i18n.define('fr', require('./locales/fr'))
app.i18n.define('zht', require('./locales/zht'))
}

export function handleError<U extends User.Field, G extends Channel.Field, A extends any[], O extends {}>(
Expand Down
12 changes: 12 additions & 0 deletions packages/helpers/src/locales/zht.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
internal:
error-encountered: 出現未知錯誤:{0}

admin:
user-not-found: 找不到指定的用戶。
user-unchanged: 沒有改變用戶數據。
user-updated: 已改變用戶數據。
channel-option: 指定目標頻道
channel-not-found: 找不到指定的頻道。
channel-unchanged: 沒有改變頻道數據。
channel-updated: 已改變頻道數據。
not-in-group: 當前不在群組上下文中,請使用 -c 參數指定目標頻道。