diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 4ec8e18..1b31733 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -4,6 +4,7 @@ import isNodeJs from 'detect-node' import en from './en' import es from './es' import it from './it' +import zh from './zh' export interface LOCALE { 'PROCESSING' (): string; @@ -17,15 +18,16 @@ export interface LOCALE { 'IND_PARTS' (): string; 'IND_PARTS_TOOLTIP' (): string; - 'FULL_SCORE' (): string; - 'VIEW_IN_LIBRESCORE' (): string; + + 'FULL_SCORE' (): string; } const locales = ( (l: L) => Object.freeze(l))({ en, es, it, + zh, }) // detect browser language diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts new file mode 100644 index 0000000..2c25f60 --- /dev/null +++ b/src/i18n/zh.ts @@ -0,0 +1,37 @@ + +import { createLocale } from './utils' + +export default createLocale({ + 'PROCESSING' () { + return '处理中…' as const + }, + 'BTN_ERROR' () { + return '❌下载失败!' as const + }, + + 'DEPRECATION_NOTICE' (btnName: string) { + return `不建议使用\n请使用 \`单独分谱\` 里的 \`${btnName}\` 按钮代替\n(这也许仍会起作用。单击\`确定\`以继续。)` as const + }, + + 'DOWNLOAD' (fileType: T) { + return `下载 ${fileType}` as const + }, + 'DOWNLOAD_AUDIO' (fileType: T) { + return `下载 ${fileType} 音频` as const + }, + + 'IND_PARTS' () { + return '单独分谱' as const + }, + 'IND_PARTS_TOOLTIP' () { + return '下载单独分谱 (BETA)' as const + }, + + 'VIEW_IN_LIBRESCORE' () { + return '在 LibreScore 中查看' as const + }, + + 'FULL_SCORE' () { + return '完整乐谱' as const + }, +})