File tree Expand file tree Collapse file tree 2 files changed +87
-4
lines changed Expand file tree Collapse file tree 2 files changed +87
-4
lines changed Original file line number Diff line number Diff line change
1
+ export default {
2
+ '*' : {
3
+ prefix : '每' ,
4
+ suffix : '' ,
5
+ text : '未知' ,
6
+ '*' : {
7
+ empty : { text : '每 {{field.id}}' } ,
8
+ value : { text : '{{val.text}}' } ,
9
+ range : { text : '{{start.text}}-{{end.text}}' } ,
10
+ everyX : { text : '每 {{every.value}}' }
11
+ } ,
12
+ month : {
13
+ '*' : { prefix : '的' } ,
14
+ empty : { text : '每月' } ,
15
+ value : { text : '{{val.alt}}' } ,
16
+ range : { text : '{{start.alt}}-{{end.alt}}' }
17
+ } ,
18
+ day : {
19
+ '*' : { prefix : '的' } ,
20
+ empty : { text : '每日' } ,
21
+ value : { text : '{{val.alt}}号' } ,
22
+ range : { text : '{{start.alt}}号-{{end.alt}}号' }
23
+ } ,
24
+ dayOfWeek : {
25
+ '*' : { prefix : '的' } ,
26
+ empty : { text : '一周的每一天' } ,
27
+ value : { text : '{{val.alt}}' } ,
28
+ range : { text : '{{start.alt}}-{{end.alt}}' }
29
+ } ,
30
+ hour : {
31
+ '*' : { prefix : '的' } ,
32
+ empty : { text : '每小时' }
33
+ } ,
34
+ minute : {
35
+ '*' : { prefix : ':' } ,
36
+ empty : { text : '每分钟' }
37
+ }
38
+ } ,
39
+ minute : {
40
+ text : '分'
41
+ } ,
42
+ hour : {
43
+ text : '小时' ,
44
+ minute : {
45
+ '*' : {
46
+ prefix : ':' ,
47
+ suffix : '分钟'
48
+ } ,
49
+ empty : { text : '每' }
50
+ }
51
+ } ,
52
+ day : {
53
+ text : '天'
54
+ } ,
55
+ week : {
56
+ text : '周' ,
57
+ dayOfWeek : {
58
+ '*' : { prefix : '的' } ,
59
+ empty : { text : '每天' } ,
60
+ value : { text : '{{val.alt}}' } ,
61
+ range : { text : '{{start.alt}}-{{end.alt}}' }
62
+ }
63
+ } ,
64
+ month : {
65
+ text : '月' ,
66
+ dayOfWeek : {
67
+ '*' : { prefix : '和' }
68
+ } ,
69
+ day : {
70
+ prefix : '的'
71
+ }
72
+ } ,
73
+ year : {
74
+ text : '年' ,
75
+ dayOfWeek : {
76
+ '*' : { prefix : '和' }
77
+ }
78
+ }
79
+ }
Original file line number Diff line number Diff line change 1
1
import Mustache from 'mustache'
2
2
import util from '../util'
3
+ import cn from './cn'
4
+ import da from './da'
3
5
import de from './de'
4
6
import en from './en'
5
- import pt from './pt'
6
7
import es from './es'
7
- import da from './da '
8
+ import pt from './pt '
8
9
const { genItems, pad, traverse } = util
9
10
10
11
const locales = {
11
12
en,
12
13
de,
13
14
pt,
14
15
es,
15
- da
16
+ da,
17
+ zh_cn : cn ,
18
+ zh : cn
16
19
}
17
20
18
21
class Locale {
@@ -38,7 +41,8 @@ class Locale {
38
41
* @returns {Locale } Dictionary with all strings in the requested language
39
42
*/
40
43
function getLocale ( locale , mixin ) {
41
- const l = locales [ locale ] || locales . en
44
+ const [ language ] = locale . split ( '-' )
45
+ const l = locales [ locale ] || locales [ language ] || locales . en
42
46
const dict = util . deepMerge ( l , mixin || { } )
43
47
return new Locale ( dict )
44
48
}
You can’t perform that action at this time.
0 commit comments