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 11import Mustache from 'mustache'
22import util from '../util'
3+ import cn from './cn'
4+ import da from './da'
35import de from './de'
46import en from './en'
5- import pt from './pt'
67import es from './es'
7- import da from './da '
8+ import pt from './pt '
89const { genItems, pad, traverse } = util
910
1011const locales = {
1112 en,
1213 de,
1314 pt,
1415 es,
15- da
16+ da,
17+ zh_cn : cn ,
18+ zh : cn
1619}
1720
1821class Locale {
@@ -38,7 +41,8 @@ class Locale {
3841 * @returns {Locale } Dictionary with all strings in the requested language
3942 */
4043function getLocale ( locale , mixin ) {
41- const l = locales [ locale ] || locales . en
44+ const [ language ] = locale . split ( '-' )
45+ const l = locales [ locale ] || locales [ language ] || locales . en
4246 const dict = util . deepMerge ( l , mixin || { } )
4347 return new Locale ( dict )
4448}
You can’t perform that action at this time.
0 commit comments