-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathtranslate.config.js
94 lines (91 loc) · 2.04 KB
/
translate.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// https://github.com/hymhub/language-translate
import { Lang } from 'language-translate/types';
import { defineConfig } from 'language-translate/utils';
const configEn = {
fromLang: Lang.en,
fromPath: 'i18n/en.ts',
translate: [
{
label: '将结果翻译到i18n/auto文件夹下',
targetConfig: [
{
targetLang: Lang.ar,
outPath: 'i18n/auto/ar.ts',
},
{
targetLang: Lang.de,
outPath: 'i18n/auto/de.ts',
},
{
targetLang: Lang.es,
outPath: 'i18n/auto/es.ts',
},
{
targetLang: Lang.fa,
outPath: 'i18n/auto/fa.ts',
},
{
targetLang: Lang.fr,
outPath: 'i18n/auto/fr.ts',
},
{
targetLang: Lang.kk,
outPath: 'i18n/auto/kk.ts',
},
{
targetLang: Lang.ja,
outPath: 'i18n/auto/ja.ts',
},
{
targetLang: Lang.ko,
outPath: 'i18n/auto/ko.ts',
},
{
targetLang: Lang.pa,
outPath: 'i18n/auto/pa.ts',
},
{
targetLang: Lang.pl,
outPath: 'i18n/auto/pl.ts',
},
{
targetLang: Lang.pt,
outPath: 'i18n/auto/pt.ts',
},
{
targetLang: Lang.ru,
outPath: 'i18n/auto/ru.ts',
},
{
targetLang: Lang.tr,
outPath: 'i18n/auto/tr.ts',
},
{
targetLang: Lang.uk,
outPath: 'i18n/auto/uk.ts',
},
{
targetLang: Lang.uz,
outPath: 'i18n/auto/uz.ts',
},
]
},
]
}
const configZh = {
fromLang: Lang['zh-CN'],
fromPath: 'i18n/zh-CN.ts',
translate: [
{
label: '将结果翻译到i18n/auto文件夹下',
targetConfig: [
{
targetLang: Lang['zh-TW'], // zh-HK会翻译成英文
outPath: 'i18n/auto/zh-HK.ts',
}
]
},
]
}
export default defineConfig(configEn)
//export default defineConfig(configZh)