Commit 4ab118119aff1543ac2c963b5717fdcf13f2fd4d
1 parent
d33b5143
some component support i18n
some component support i18n
Showing
13 changed files
with
238 additions
and
30 deletions
Show diff stats
src/components/date-picker/base/confirm.vue
1 | <template> | 1 | <template> |
2 | <div :class="[prefixCls + '-confirm']"> | 2 | <div :class="[prefixCls + '-confirm']"> |
3 | <span :class="timeClasses" v-if="showTime" @click="handleToggleTime"> | 3 | <span :class="timeClasses" v-if="showTime" @click="handleToggleTime"> |
4 | - <template v-if="isTime">选择日期</template> | ||
5 | - <template v-else>选择时间</template> | 4 | + <template v-if="isTime">{{ t('i.datepicker.selectDate') }}</template> |
5 | + <template v-else>{{ t('i.datepicker.selectTime') }}</template> | ||
6 | </span> | 6 | </span> |
7 | - <i-button size="small" type="text" @click="handleClear">清空</i-button> | ||
8 | - <i-button size="small" type="primary" @click="handleSuccess">确定</i-button> | 7 | + <i-button size="small" type="text" @click="handleClear">{{ t('i.datepicker.clear') }}</i-button> |
8 | + <i-button size="small" type="primary" @click="handleSuccess">{{ t('i.datepicker.ok') }}</i-button> | ||
9 | </div> | 9 | </div> |
10 | </template> | 10 | </template> |
11 | <script> | 11 | <script> |
12 | import iButton from '../../button/button.vue'; | 12 | import iButton from '../../button/button.vue'; |
13 | + import Locale from '../../../mixins/locale'; | ||
13 | 14 | ||
14 | const prefixCls = 'ivu-picker'; | 15 | const prefixCls = 'ivu-picker'; |
15 | 16 | ||
16 | export default { | 17 | export default { |
18 | + mixins: [ Locale ], | ||
17 | components: { iButton }, | 19 | components: { iButton }, |
18 | props: { | 20 | props: { |
19 | showTime: false, | 21 | showTime: false, |
src/components/date-picker/base/date-table.vue
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | @click="handleClick" | 4 | @click="handleClick" |
5 | @mousemove="handleMouseMove"> | 5 | @mousemove="handleMouseMove"> |
6 | <div :class="[prefixCls + '-header']"> | 6 | <div :class="[prefixCls + '-header']"> |
7 | - <span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span> | 7 | + <span>{{ t('i.datepicker.weeks.sun') }}</span><span>{{ t('i.datepicker.weeks.mon') }}</span><span>{{ t('i.datepicker.weeks.tue') }}</span><span>{{ t('i.datepicker.weeks.wed') }}</span><span>{{ t('i.datepicker.weeks.thu') }}</span><span>{{ t('i.datepicker.weeks.fri') }}</span><span>{{ t('i.datepicker.weeks.sat') }}</span> |
8 | </div> | 8 | </div> |
9 | <span :class="getCellCls(cell)" v-for="cell in readCells"><em :index="$index">{{ cell.text }}</em></span> | 9 | <span :class="getCellCls(cell)" v-for="cell in readCells"><em :index="$index">{{ cell.text }}</em></span> |
10 | </div> | 10 | </div> |
@@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
12 | <script> | 12 | <script> |
13 | import { getFirstDayOfMonth, getDayCountOfMonth } from '../util'; | 13 | import { getFirstDayOfMonth, getDayCountOfMonth } from '../util'; |
14 | import { deepCopy } from '../../../utils/assist'; | 14 | import { deepCopy } from '../../../utils/assist'; |
15 | + import Locale from '../../../mixins/locale'; | ||
15 | 16 | ||
16 | const prefixCls = 'ivu-date-picker-cells'; | 17 | const prefixCls = 'ivu-date-picker-cells'; |
17 | 18 | ||
@@ -22,6 +23,7 @@ | @@ -22,6 +23,7 @@ | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | export default { | 25 | export default { |
26 | + mixins: [ Locale ], | ||
25 | props: { | 27 | props: { |
26 | date: {}, | 28 | date: {}, |
27 | year: {}, | 29 | year: {}, |
src/components/date-picker/base/month-table.vue
1 | <template> | 1 | <template> |
2 | <div :class="classes" @click="handleClick"> | 2 | <div :class="classes" @click="handleClick"> |
3 | - <span :class="getCellCls(cell)" v-for="cell in cells"><em :index="$index">{{ cell.text }}月</em></span> | 3 | + <span :class="getCellCls(cell)" v-for="cell in cells"><em :index="$index">{{ tCell(cell.text) }}</em></span> |
4 | </div> | 4 | </div> |
5 | </template> | 5 | </template> |
6 | <script> | 6 | <script> |
7 | import { deepCopy } from '../../../utils/assist'; | 7 | import { deepCopy } from '../../../utils/assist'; |
8 | + import Locale from '../../../mixins/locale'; | ||
8 | const prefixCls = 'ivu-date-picker-cells'; | 9 | const prefixCls = 'ivu-date-picker-cells'; |
9 | 10 | ||
10 | export default { | 11 | export default { |
12 | + mixins: [ Locale ], | ||
11 | props: { | 13 | props: { |
12 | date: {}, | 14 | date: {}, |
13 | month: { | 15 | month: { |
@@ -68,6 +70,9 @@ | @@ -68,6 +70,9 @@ | ||
68 | this.$emit('on-pick', index); | 70 | this.$emit('on-pick', index); |
69 | } | 71 | } |
70 | this.$emit('on-pick-click'); | 72 | this.$emit('on-pick-click'); |
73 | + }, | ||
74 | + tCell (cell) { | ||
75 | + return this.t(`i.datepicker.months.m${cell}`); | ||
71 | } | 76 | } |
72 | } | 77 | } |
73 | }; | 78 | }; |
src/components/date-picker/panel/date-range.vue
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | <span | 22 | <span |
23 | :class="[datePrefixCls + '-header-label']" | 23 | :class="[datePrefixCls + '-header-label']" |
24 | @click="showMonthPicker('left')" | 24 | @click="showMonthPicker('left')" |
25 | - v-show="leftCurrentView === 'date'">{{ leftMonth + 1 }} 月</span> | 25 | + v-show="leftCurrentView === 'date'">{{ leftMonthLabel }}</span> |
26 | <span | 26 | <span |
27 | :class="iconBtnCls('next', '-double')" | 27 | :class="iconBtnCls('next', '-double')" |
28 | @click="nextYear('left')" | 28 | @click="nextYear('left')" |
@@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
72 | <span | 72 | <span |
73 | :class="[datePrefixCls + '-header-label']" | 73 | :class="[datePrefixCls + '-header-label']" |
74 | @click="showMonthPicker('right')" | 74 | @click="showMonthPicker('right')" |
75 | - v-show="rightCurrentView === 'date'">{{ rightMonth + 1 }} 月</span> | 75 | + v-show="rightCurrentView === 'date'">{{ rightMonthLabel }}</span> |
76 | <span | 76 | <span |
77 | :class="iconBtnCls('next', '-double')" | 77 | :class="iconBtnCls('next', '-double')" |
78 | @click="nextYear('right')"><Icon type="ios-arrow-right"></Icon></span> | 78 | @click="nextYear('right')"><Icon type="ios-arrow-right"></Icon></span> |
@@ -141,13 +141,14 @@ | @@ -141,13 +141,14 @@ | ||
141 | import { toDate, prevMonth, nextMonth, initTimeDate } from '../util'; | 141 | import { toDate, prevMonth, nextMonth, initTimeDate } from '../util'; |
142 | 142 | ||
143 | import Mixin from './mixin'; | 143 | import Mixin from './mixin'; |
144 | + import Locale from '../../../mixins/locale'; | ||
144 | 145 | ||
145 | const prefixCls = 'ivu-picker-panel'; | 146 | const prefixCls = 'ivu-picker-panel'; |
146 | const datePrefixCls = 'ivu-date-picker'; | 147 | const datePrefixCls = 'ivu-date-picker'; |
147 | 148 | ||
148 | export default { | 149 | export default { |
149 | name: 'DatePicker', | 150 | name: 'DatePicker', |
150 | - mixins: [Mixin], | 151 | + mixins: [ Mixin, Locale ], |
151 | components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm }, | 152 | components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm }, |
152 | data () { | 153 | data () { |
153 | return { | 154 | return { |
@@ -195,20 +196,25 @@ | @@ -195,20 +196,25 @@ | ||
195 | } | 196 | } |
196 | }, | 197 | }, |
197 | leftYearLabel () { | 198 | leftYearLabel () { |
199 | + const tYear = this.t('i.datepicker.year'); | ||
198 | if (this.leftCurrentView === 'year') { | 200 | if (this.leftCurrentView === 'year') { |
199 | const year = this.leftTableYear; | 201 | const year = this.leftTableYear; |
200 | if (!year) return ''; | 202 | if (!year) return ''; |
201 | const startYear = Math.floor(year / 10) * 10; | 203 | const startYear = Math.floor(year / 10) * 10; |
202 | - return `${startYear}年 - ${startYear + 9}年`; | 204 | + return `${startYear}${tYear} - ${startYear + 9}${tYear}`; |
203 | } else { | 205 | } else { |
204 | const year = this.leftCurrentView === 'month' ? this.leftTableYear : this.leftYear; | 206 | const year = this.leftCurrentView === 'month' ? this.leftTableYear : this.leftYear; |
205 | if (!year) return ''; | 207 | if (!year) return ''; |
206 | - return `${year}年`; | 208 | + return `${year}${tYear}`; |
207 | } | 209 | } |
208 | }, | 210 | }, |
209 | leftMonth () { | 211 | leftMonth () { |
210 | return this.date.getMonth(); | 212 | return this.date.getMonth(); |
211 | }, | 213 | }, |
214 | + leftMonthLabel () { | ||
215 | + const month = this.leftMonth + 1; | ||
216 | + return this.t(`i.datepicker.month${month}`); | ||
217 | + }, | ||
212 | rightYear () { | 218 | rightYear () { |
213 | return this.rightDate.getFullYear(); | 219 | return this.rightDate.getFullYear(); |
214 | }, | 220 | }, |
@@ -220,20 +226,25 @@ | @@ -220,20 +226,25 @@ | ||
220 | } | 226 | } |
221 | }, | 227 | }, |
222 | rightYearLabel () { | 228 | rightYearLabel () { |
229 | + const tYear = this.t('i.datepicker.year'); | ||
223 | if (this.rightCurrentView === 'year') { | 230 | if (this.rightCurrentView === 'year') { |
224 | const year = this.rightTableYear; | 231 | const year = this.rightTableYear; |
225 | if (!year) return ''; | 232 | if (!year) return ''; |
226 | const startYear = Math.floor(year / 10) * 10; | 233 | const startYear = Math.floor(year / 10) * 10; |
227 | - return `${startYear}年 - ${startYear + 9}年`; | 234 | + return `${startYear}${tYear} - ${startYear + 9}${tYear}`; |
228 | } else { | 235 | } else { |
229 | const year = this.rightCurrentView === 'month' ? this.rightTableYear : this.rightYear; | 236 | const year = this.rightCurrentView === 'month' ? this.rightTableYear : this.rightYear; |
230 | if (!year) return ''; | 237 | if (!year) return ''; |
231 | - return `${year}年`; | 238 | + return `${year}${tYear}`; |
232 | } | 239 | } |
233 | }, | 240 | }, |
234 | rightMonth () { | 241 | rightMonth () { |
235 | return this.rightDate.getMonth(); | 242 | return this.rightDate.getMonth(); |
236 | }, | 243 | }, |
244 | + rightMonthLabel () { | ||
245 | + const month = this.rightMonth + 1; | ||
246 | + return this.t(`i.datepicker.month${month}`); | ||
247 | + }, | ||
237 | rightDate () { | 248 | rightDate () { |
238 | const newDate = new Date(this.date); | 249 | const newDate = new Date(this.date); |
239 | const month = newDate.getMonth(); | 250 | const month = newDate.getMonth(); |
src/components/date-picker/panel/date.vue
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | <span | 21 | <span |
22 | :class="[datePrefixCls + '-header-label']" | 22 | :class="[datePrefixCls + '-header-label']" |
23 | @click="showMonthPicker" | 23 | @click="showMonthPicker" |
24 | - v-show="currentView === 'date'">{{ month + 1 + '月' }}</span> | 24 | + v-show="currentView === 'date'">{{ monthLabel }}</span> |
25 | <span | 25 | <span |
26 | :class="iconBtnCls('next', '-double')" | 26 | :class="iconBtnCls('next', '-double')" |
27 | @click="nextYear"><Icon type="ios-arrow-right"></Icon></span> | 27 | @click="nextYear"><Icon type="ios-arrow-right"></Icon></span> |
@@ -85,6 +85,7 @@ | @@ -85,6 +85,7 @@ | ||
85 | import Confirm from '../base/confirm.vue'; | 85 | import Confirm from '../base/confirm.vue'; |
86 | 86 | ||
87 | import Mixin from './mixin'; | 87 | import Mixin from './mixin'; |
88 | + import Locale from '../../../mixins/locale'; | ||
88 | 89 | ||
89 | import { initTimeDate } from '../util'; | 90 | import { initTimeDate } from '../util'; |
90 | 91 | ||
@@ -93,7 +94,7 @@ | @@ -93,7 +94,7 @@ | ||
93 | 94 | ||
94 | export default { | 95 | export default { |
95 | name: 'DatePicker', | 96 | name: 'DatePicker', |
96 | - mixins: [Mixin], | 97 | + mixins: [ Mixin, Locale ], |
97 | components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm }, | 98 | components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm }, |
98 | data () { | 99 | data () { |
99 | return { | 100 | return { |
@@ -123,13 +124,18 @@ | @@ -123,13 +124,18 @@ | ||
123 | ]; | 124 | ]; |
124 | }, | 125 | }, |
125 | yearLabel () { | 126 | yearLabel () { |
127 | + const tYear = this.t('i.datepicker.year'); | ||
126 | const year = this.year; | 128 | const year = this.year; |
127 | if (!year) return ''; | 129 | if (!year) return ''; |
128 | if (this.currentView === 'year') { | 130 | if (this.currentView === 'year') { |
129 | const startYear = Math.floor(year / 10) * 10; | 131 | const startYear = Math.floor(year / 10) * 10; |
130 | - return `${startYear}年 - ${startYear + 9}年`; | 132 | + return `${startYear}${tYear} - ${startYear + 9}${tYear}`; |
131 | } | 133 | } |
132 | - return `${year}年`; | 134 | + return `${year}${tYear}`; |
135 | + }, | ||
136 | + monthLabel () { | ||
137 | + const month = this.month + 1; | ||
138 | + return this.t(`i.datepicker.month${month}`); | ||
133 | } | 139 | } |
134 | }, | 140 | }, |
135 | watch: { | 141 | watch: { |
src/components/date-picker/panel/time-range.vue
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <div :class="[prefixCls + '-content', prefixCls + '-content-left']"> | 4 | <div :class="[prefixCls + '-content', prefixCls + '-content-left']"> |
5 | <div :class="[timePrefixCls + '-header']"> | 5 | <div :class="[timePrefixCls + '-header']"> |
6 | <template v-if="showDate">{{ visibleDate }}</template> | 6 | <template v-if="showDate">{{ visibleDate }}</template> |
7 | - <template v-else>开始时间</template> | 7 | + <template v-else>{{ t('i.datepicker.startTime') }}</template> |
8 | </div> | 8 | </div> |
9 | <time-spinner | 9 | <time-spinner |
10 | v-ref:time-spinner | 10 | v-ref:time-spinner |
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | <div :class="[prefixCls + '-content', prefixCls + '-content-right']"> | 22 | <div :class="[prefixCls + '-content', prefixCls + '-content-right']"> |
23 | <div :class="[timePrefixCls + '-header']"> | 23 | <div :class="[timePrefixCls + '-header']"> |
24 | <template v-if="showDate">{{ visibleDateEnd }}</template> | 24 | <template v-if="showDate">{{ visibleDateEnd }}</template> |
25 | - <template v-else>结束时间</template> | 25 | + <template v-else>{{ t('i.datepicker.endTime') }}</template> |
26 | </div> | 26 | </div> |
27 | <time-spinner | 27 | <time-spinner |
28 | v-ref:time-spinner-end | 28 | v-ref:time-spinner-end |
@@ -49,6 +49,7 @@ | @@ -49,6 +49,7 @@ | ||
49 | import Confirm from '../base/confirm.vue'; | 49 | import Confirm from '../base/confirm.vue'; |
50 | 50 | ||
51 | import Mixin from './mixin'; | 51 | import Mixin from './mixin'; |
52 | + import Locale from '../../../mixins/locale'; | ||
52 | 53 | ||
53 | import { initTimeDate, toDate, formatDate } from '../util'; | 54 | import { initTimeDate, toDate, formatDate } from '../util'; |
54 | 55 | ||
@@ -56,7 +57,7 @@ | @@ -56,7 +57,7 @@ | ||
56 | const timePrefixCls = 'ivu-time-picker'; | 57 | const timePrefixCls = 'ivu-time-picker'; |
57 | 58 | ||
58 | export default { | 59 | export default { |
59 | - mixins: [Mixin], | 60 | + mixins: [ Mixin, Locale ], |
60 | components: { TimeSpinner, Confirm }, | 61 | components: { TimeSpinner, Confirm }, |
61 | data () { | 62 | data () { |
62 | return { | 63 | return { |
@@ -95,11 +96,17 @@ | @@ -95,11 +96,17 @@ | ||
95 | }, | 96 | }, |
96 | visibleDate () { | 97 | visibleDate () { |
97 | const date = this.date || initTimeDate(); | 98 | const date = this.date || initTimeDate(); |
98 | - return `${date.getFullYear()}年 ${date.getMonth() + 1}月`; | 99 | + const tYear = this.t('i.datepicker.year'); |
100 | + const month = date.getMonth() + 1; | ||
101 | + const tMonth = this.t(`i.datepicker.month${month}`); | ||
102 | + return `${date.getFullYear()}${tYear} ${tMonth}`; | ||
99 | }, | 103 | }, |
100 | visibleDateEnd () { | 104 | visibleDateEnd () { |
101 | const date = this.dateEnd || initTimeDate(); | 105 | const date = this.dateEnd || initTimeDate(); |
102 | - return `${date.getFullYear()}年 ${date.getMonth() + 1}月`; | 106 | + const tYear = this.t('i.datepicker.year'); |
107 | + const month = date.getMonth() + 1; | ||
108 | + const tMonth = this.t(`i.datepicker.month${month}`); | ||
109 | + return `${date.getFullYear()}${tYear} ${tMonth}`; | ||
103 | } | 110 | } |
104 | }, | 111 | }, |
105 | watch: { | 112 | watch: { |
src/components/date-picker/panel/time.vue
@@ -28,6 +28,7 @@ | @@ -28,6 +28,7 @@ | ||
28 | import Confirm from '../base/confirm.vue'; | 28 | import Confirm from '../base/confirm.vue'; |
29 | 29 | ||
30 | import Mixin from './mixin'; | 30 | import Mixin from './mixin'; |
31 | + import Locale from '../../../mixins/locale'; | ||
31 | 32 | ||
32 | import { initTimeDate } from '../util'; | 33 | import { initTimeDate } from '../util'; |
33 | 34 | ||
@@ -35,7 +36,7 @@ | @@ -35,7 +36,7 @@ | ||
35 | const timePrefixCls = 'ivu-time-picker'; | 36 | const timePrefixCls = 'ivu-time-picker'; |
36 | 37 | ||
37 | export default { | 38 | export default { |
38 | - mixins: [Mixin], | 39 | + mixins: [ Mixin, Locale ], |
39 | components: { TimeSpinner, Confirm }, | 40 | components: { TimeSpinner, Confirm }, |
40 | data () { | 41 | data () { |
41 | return { | 42 | return { |
@@ -61,7 +62,10 @@ | @@ -61,7 +62,10 @@ | ||
61 | }, | 62 | }, |
62 | visibleDate () { | 63 | visibleDate () { |
63 | const date = this.date; | 64 | const date = this.date; |
64 | - return `${date.getFullYear()}年 ${date.getMonth() + 1}月`; | 65 | + const month = date.getMonth() + 1; |
66 | + const tYear = this.t('i.datepicker.year'); | ||
67 | + const tMonth = this.t(`i.datepicker.month${month}`); | ||
68 | + return `${date.getFullYear()}${tYear} ${tMonth}`; | ||
65 | } | 69 | } |
66 | }, | 70 | }, |
67 | watch: { | 71 | watch: { |
src/components/table/table-head.vue
@@ -29,15 +29,15 @@ | @@ -29,15 +29,15 @@ | ||
29 | </checkbox-group> | 29 | </checkbox-group> |
30 | </div> | 30 | </div> |
31 | <div :class="[prefixCls + '-filter-footer']"> | 31 | <div :class="[prefixCls + '-filter-footer']"> |
32 | - <i-button type="text" size="small" :disabled="!column._filterChecked.length" @click="handleFilter($index)">筛选</i-button> | ||
33 | - <i-button type="text" size="small" @click="handleReset($index)">重置</i-button> | 32 | + <i-button type="text" size="small" :disabled="!column._filterChecked.length" @click="handleFilter($index)">{{ t('i.table.confirmFilter') }}</i-button> |
33 | + <i-button type="text" size="small" @click="handleReset($index)">{{ t('i.table.resetFilter') }}</i-button> | ||
34 | </div> | 34 | </div> |
35 | </div> | 35 | </div> |
36 | <div slot="content" :class="[prefixCls + '-filter-list']" v-else> | 36 | <div slot="content" :class="[prefixCls + '-filter-list']" v-else> |
37 | <ul :class="[prefixCls + '-filter-list-single']"> | 37 | <ul :class="[prefixCls + '-filter-list-single']"> |
38 | <li | 38 | <li |
39 | :class="itemAllClasses(column)" | 39 | :class="itemAllClasses(column)" |
40 | - @click="handleReset($index)">全部</li> | 40 | + @click="handleReset($index)">{{ t('i.table.clearFilter') }}</li> |
41 | <li | 41 | <li |
42 | :class="itemClasses(column, item)" | 42 | :class="itemClasses(column, item)" |
43 | v-for="item in column.filters" | 43 | v-for="item in column.filters" |
@@ -58,9 +58,10 @@ | @@ -58,9 +58,10 @@ | ||
58 | import Poptip from '../poptip/poptip.vue'; | 58 | import Poptip from '../poptip/poptip.vue'; |
59 | import iButton from '../button/button.vue'; | 59 | import iButton from '../button/button.vue'; |
60 | import Mixin from './mixin'; | 60 | import Mixin from './mixin'; |
61 | + import Locale from '../../mixins/locale'; | ||
61 | 62 | ||
62 | export default { | 63 | export default { |
63 | - mixins: [ Mixin ], | 64 | + mixins: [ Mixin, Locale ], |
64 | components: { CheckboxGroup, Checkbox, Poptip, iButton }, | 65 | components: { CheckboxGroup, Checkbox, Poptip, iButton }, |
65 | props: { | 66 | props: { |
66 | prefixCls: String, | 67 | prefixCls: String, |
src/components/table/table.vue
@@ -86,6 +86,7 @@ | @@ -86,6 +86,7 @@ | ||
86 | import tableHead from './table-head.vue'; | 86 | import tableHead from './table-head.vue'; |
87 | import tableBody from './table-body.vue'; | 87 | import tableBody from './table-body.vue'; |
88 | import { oneOf, getStyle, deepCopy, getScrollBarSize } from '../../utils/assist'; | 88 | import { oneOf, getStyle, deepCopy, getScrollBarSize } from '../../utils/assist'; |
89 | + import { t } from '../../locale'; | ||
89 | import Csv from '../../utils/csv'; | 90 | import Csv from '../../utils/csv'; |
90 | import ExportCsv from './export-csv'; | 91 | import ExportCsv from './export-csv'; |
91 | const prefixCls = 'ivu-table'; | 92 | const prefixCls = 'ivu-table'; |
@@ -143,11 +144,15 @@ | @@ -143,11 +144,15 @@ | ||
143 | }, | 144 | }, |
144 | noDataText: { | 145 | noDataText: { |
145 | type: String, | 146 | type: String, |
146 | - default: '暂无数据' | 147 | + default () { |
148 | + return t('i.table.noDataText'); | ||
149 | + } | ||
147 | }, | 150 | }, |
148 | noFilteredDataText: { | 151 | noFilteredDataText: { |
149 | type: String, | 152 | type: String, |
150 | - default: '暂无筛选结果' | 153 | + default () { |
154 | + return t('i.table.noFilteredDataText'); | ||
155 | + } | ||
151 | } | 156 | } |
152 | }, | 157 | }, |
153 | data () { | 158 | data () { |
src/locale/lang/en-US.js
@@ -3,6 +3,58 @@ export default { | @@ -3,6 +3,58 @@ export default { | ||
3 | select: { | 3 | select: { |
4 | placeholder: 'Select', | 4 | placeholder: 'Select', |
5 | noMatch: 'No matching data' | 5 | noMatch: 'No matching data' |
6 | + }, | ||
7 | + table: { | ||
8 | + noDataText: 'No Data', | ||
9 | + noFilteredDataText: 'No filter data', | ||
10 | + confirmFilter: 'Confirm', | ||
11 | + resetFilter: 'Reset', | ||
12 | + clearFilter: 'All' | ||
13 | + }, | ||
14 | + datepicker: { | ||
15 | + selectDate: 'Select date', | ||
16 | + selectTime: 'Select time', | ||
17 | + startTime: 'Start Time', | ||
18 | + endTime: 'End Time', | ||
19 | + clear: 'Clear', | ||
20 | + ok: 'Ok', | ||
21 | + month: '', | ||
22 | + month1: 'January', | ||
23 | + month2: 'February', | ||
24 | + month3: 'March', | ||
25 | + month4: 'April', | ||
26 | + month5: 'May', | ||
27 | + month6: 'June', | ||
28 | + month7: 'July', | ||
29 | + month8: 'August', | ||
30 | + month9: 'September', | ||
31 | + month10: 'October', | ||
32 | + month11: 'November', | ||
33 | + month12: 'December', | ||
34 | + year: '', | ||
35 | + weeks: { | ||
36 | + sun: 'Sun', | ||
37 | + mon: 'Mon', | ||
38 | + tue: 'Tue', | ||
39 | + wed: 'Wed', | ||
40 | + thu: 'Thu', | ||
41 | + fri: 'Fri', | ||
42 | + sat: 'Sat' | ||
43 | + }, | ||
44 | + months: { | ||
45 | + m1: 'Jan', | ||
46 | + m2: 'Feb', | ||
47 | + m3: 'Mar', | ||
48 | + m4: 'Apr', | ||
49 | + m5: 'May', | ||
50 | + m6: 'Jun', | ||
51 | + m7: 'Jul', | ||
52 | + m8: 'Aug', | ||
53 | + m9: 'Sep', | ||
54 | + m10: 'Oct', | ||
55 | + m11: 'Nov', | ||
56 | + m12: 'Dec' | ||
57 | + } | ||
6 | } | 58 | } |
7 | } | 59 | } |
8 | }; | 60 | }; |
9 | \ No newline at end of file | 61 | \ No newline at end of file |
src/locale/lang/zh-CN.js
@@ -3,6 +3,58 @@ export default { | @@ -3,6 +3,58 @@ export default { | ||
3 | select: { | 3 | select: { |
4 | placeholder: '请选择', | 4 | placeholder: '请选择', |
5 | noMatch: '无匹配数据' | 5 | noMatch: '无匹配数据' |
6 | + }, | ||
7 | + table: { | ||
8 | + noDataText: '暂无数据', | ||
9 | + noFilteredDataText: '暂无筛选结果', | ||
10 | + confirmFilter: '筛选', | ||
11 | + resetFilter: '重置', | ||
12 | + clearFilter: '全部' | ||
13 | + }, | ||
14 | + datepicker: { | ||
15 | + selectDate: '选择日期', | ||
16 | + selectTime: '选择时间', | ||
17 | + startTime: '开始时间', | ||
18 | + endTime: '结束时间', | ||
19 | + clear: '清空', | ||
20 | + ok: '确定', | ||
21 | + month: '月', | ||
22 | + month1: '1 月', | ||
23 | + month2: '2 月', | ||
24 | + month3: '3 月', | ||
25 | + month4: '4 月', | ||
26 | + month5: '5 月', | ||
27 | + month6: '6 月', | ||
28 | + month7: '7 月', | ||
29 | + month8: '8 月', | ||
30 | + month9: '9 月', | ||
31 | + month10: '10 月', | ||
32 | + month11: '11 月', | ||
33 | + month12: '12 月', | ||
34 | + year: '年', | ||
35 | + weeks: { | ||
36 | + sun: '日', | ||
37 | + mon: '一', | ||
38 | + tue: '二', | ||
39 | + wed: '三', | ||
40 | + thu: '四', | ||
41 | + fri: '五', | ||
42 | + sat: '六' | ||
43 | + }, | ||
44 | + months: { | ||
45 | + m1: '1月', | ||
46 | + m2: '2月', | ||
47 | + m3: '3月', | ||
48 | + m4: '4月', | ||
49 | + m5: '5月', | ||
50 | + m6: '6月', | ||
51 | + m7: '7月', | ||
52 | + m8: '8月', | ||
53 | + m9: '9月', | ||
54 | + m10: '10月', | ||
55 | + m11: '11月', | ||
56 | + m12: '12月' | ||
57 | + } | ||
6 | } | 58 | } |
7 | } | 59 | } |
8 | }; | 60 | }; |
9 | \ No newline at end of file | 61 | \ No newline at end of file |
src/locale/lang/zh-TW.js
@@ -3,6 +3,58 @@ export default { | @@ -3,6 +3,58 @@ export default { | ||
3 | select: { | 3 | select: { |
4 | placeholder: '請選擇', | 4 | placeholder: '請選擇', |
5 | noMatch: '無匹配數據' | 5 | noMatch: '無匹配數據' |
6 | + }, | ||
7 | + table: { | ||
8 | + noDataText: '暫無數據', | ||
9 | + noFilteredDataText: '暫無篩選結果', | ||
10 | + confirmFilter: '篩選', | ||
11 | + resetFilter: '重置', | ||
12 | + clearFilter: '全部' | ||
13 | + }, | ||
14 | + datepicker: { | ||
15 | + selectDate: '選擇日期', | ||
16 | + selectTime: '選擇時間', | ||
17 | + startTime: '開始時間', | ||
18 | + endTime: '結束時間', | ||
19 | + clear: '清空', | ||
20 | + ok: '確定', | ||
21 | + month: '月', | ||
22 | + month1: '1 月', | ||
23 | + month2: '2 月', | ||
24 | + month3: '3 月', | ||
25 | + month4: '4 月', | ||
26 | + month5: '5 月', | ||
27 | + month6: '6 月', | ||
28 | + month7: '7 月', | ||
29 | + month8: '8 月', | ||
30 | + month9: '9 月', | ||
31 | + month10: '10 月', | ||
32 | + month11: '11 月', | ||
33 | + month12: '12 月', | ||
34 | + year: '年', | ||
35 | + weeks: { | ||
36 | + sun: '日', | ||
37 | + mon: '一', | ||
38 | + tue: '二', | ||
39 | + wed: '三', | ||
40 | + thu: '四', | ||
41 | + fri: '五', | ||
42 | + sat: '六' | ||
43 | + }, | ||
44 | + months: { | ||
45 | + m1: '1月', | ||
46 | + m2: '2月', | ||
47 | + m3: '3月', | ||
48 | + m4: '4月', | ||
49 | + m5: '5月', | ||
50 | + m6: '6月', | ||
51 | + m7: '7月', | ||
52 | + m8: '8月', | ||
53 | + m9: '9月', | ||
54 | + m10: '10月', | ||
55 | + m11: '11月', | ||
56 | + m12: '12月' | ||
57 | + } | ||
6 | } | 58 | } |
7 | } | 59 | } |
8 | }; | 60 | }; |
9 | \ No newline at end of file | 61 | \ No newline at end of file |