feat(i18n): add Chinese translations

This commit is contained in:
Xmader 2021-01-02 10:46:14 -05:00
parent 7f860faf66
commit 86c5429dce
No known key found for this signature in database
GPG Key ID: A20B97FB9EB730E4
2 changed files with 41 additions and 2 deletions

View File

@ -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 extends { [n: string]: LOCALE } /** type checking */> (l: L) => Object.freeze(l))({
en,
es,
it,
zh,
})
// detect browser language

37
src/i18n/zh.ts Normal file
View File

@ -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' <T extends string> (fileType: T) {
return `下载 ${fileType}` as const
},
'DOWNLOAD_AUDIO' <T extends string> (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
},
})