Skip to content

Commit

Permalink
refactor: migrate i18n files to compatiable others (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan authored Apr 5, 2024
1 parent 6926b5a commit 73f97a9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const Config: Schema<Config> = Schema.object({
.default('auto'),
threshold: Schema.number().default(3),
}).i18n({
'zh': require('./locales/zh-CN/macrodict.schema.yml'),
'zh-CN': require('./locales/zh-CN/macrodict.schema.yml'),
'en': require('./locales/en-US/macrodict.schema.yml'),
'en': require('./locales/en-US.schema.yml'),
'en-US': require('./locales/en-US.schema.yml'),
'zh': require('./locales/zh-CN.schema.yml'),
'zh-CN': require('./locales/zh-CN.schema.yml'),
})
File renamed without changes.
File renamed without changes.
11 changes: 7 additions & 4 deletions src/locales/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import { Context } from 'koishi'

import enUS from './en-US.yml'
import zhCN from './zh-CN.yml'

export function apply(ctx: Context) {
ctx.i18n.define('en', require('./en-US/macrodict.yml'))
ctx.i18n.define('zh', require('./zh-CN/macrodict.yml'))
ctx.i18n.define('zh-CN', require('./zh-CN/macrodict.yml'))
ctx.i18n.define('en', enUS)
ctx.i18n.define('en-US', enUS)
ctx.i18n.define('zh', zhCN)
ctx.i18n.define('zh-CN', zhCN)
}
File renamed without changes.
File renamed without changes.

0 comments on commit 73f97a9

Please sign in to comment.