Commit 012cbf285ff72100851ffcfefbe2f5ee0c8e247b
1 parent
d5d4d8e3
update locale
update locale
Showing
9 changed files
with
126 additions
and
22 deletions
Show diff stats
src/components/modal/confirm.js
... | ... | @@ -3,6 +3,7 @@ import Modal from './modal.vue'; |
3 | 3 | import Icon from '../icon/icon.vue'; |
4 | 4 | import iButton from '../button/button.vue'; |
5 | 5 | import { camelcaseToHyphen } from '../../utils/assist'; |
6 | +import { t } from '../../locale'; | |
6 | 7 | |
7 | 8 | const prefixCls = 'ivu-modal-confirm'; |
8 | 9 | |
... | ... | @@ -44,8 +45,8 @@ Modal.newInstance = properties => { |
44 | 45 | body: '', |
45 | 46 | iconType: '', |
46 | 47 | iconName: '', |
47 | - okText: '确定', | |
48 | - cancelText: '取消', | |
48 | + okText: t('i.modal.okText'), | |
49 | + cancelText: t('i.modal.cancelText'), | |
49 | 50 | showCancel: false, |
50 | 51 | loading: false, |
51 | 52 | buttonLoading: false | ... | ... |
src/components/modal/modal.vue
... | ... | @@ -24,6 +24,7 @@ |
24 | 24 | import Icon from '../icon'; |
25 | 25 | import iButton from '../button/button.vue'; |
26 | 26 | import { getScrollBarSize } from '../../utils/assist'; |
27 | + import { t } from '../../locale'; | |
27 | 28 | |
28 | 29 | const prefixCls = 'ivu-modal'; |
29 | 30 | |
... | ... | @@ -51,11 +52,15 @@ |
51 | 52 | }, |
52 | 53 | okText: { |
53 | 54 | type: String, |
54 | - default: '确定' | |
55 | + default () { | |
56 | + return t('i.modal.okText'); | |
57 | + } | |
55 | 58 | }, |
56 | 59 | cancelText: { |
57 | 60 | type: String, |
58 | - default: '取消' | |
61 | + default () { | |
62 | + return t('i.modal.cancelText'); | |
63 | + } | |
59 | 64 | }, |
60 | 65 | loading: { |
61 | 66 | type: Boolean, | ... | ... |
src/components/page/options.vue
... | ... | @@ -2,19 +2,20 @@ |
2 | 2 | <div v-if="showSizer || showElevator" :class="optsClasses"> |
3 | 3 | <div v-if="showSizer" :class="sizerClasses"> |
4 | 4 | <i-select :model.sync="pageSize" :size="size" @on-change="changeSize"> |
5 | - <i-option v-for="item in pageSizeOpts" :value="item" style="text-align:center;">{{ item }} 条/页</i-option> | |
5 | + <i-option v-for="item in pageSizeOpts" :value="item" style="text-align:center;">{{ item }} {{ t('i.page.page') }}</i-option> | |
6 | 6 | </i-select> |
7 | 7 | </div> |
8 | 8 | <div v-if="showElevator" :class="ElevatorClasses"> |
9 | - 跳至 | |
9 | + {{ t('i.page.goto') }} | |
10 | 10 | <input type="text" :value="_current" @keyup.enter="changePage"> |
11 | - 页 | |
11 | + {{ t('i.page.p') }} | |
12 | 12 | </div> |
13 | 13 | </div> |
14 | 14 | </template> |
15 | 15 | <script> |
16 | 16 | import iSelect from '../../components/select/select.vue'; |
17 | 17 | import iOption from '../../components/select/option.vue'; |
18 | + import Locale from '../../mixins/locale'; | |
18 | 19 | |
19 | 20 | const prefixCls = 'ivu-page'; |
20 | 21 | |
... | ... | @@ -23,6 +24,7 @@ |
23 | 24 | } |
24 | 25 | |
25 | 26 | export default { |
27 | + mixins: [ Locale ], | |
26 | 28 | components: { iSelect, iOption }, |
27 | 29 | props: { |
28 | 30 | pageSizeOpts: Array, | ... | ... |
src/components/page/page.vue
1 | 1 | <template> |
2 | 2 | <ul :class="simpleWrapClasses" :style="style" v-if="simple"> |
3 | 3 | <li |
4 | - title="上一页" | |
4 | + :title="t('i.page.prev')" | |
5 | 5 | :class="prevClasses" |
6 | 6 | @click="prev"> |
7 | 7 | <a><i class="ivu-icon ivu-icon-ios-arrow-left"></i></a> |
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | {{ allPages }} |
18 | 18 | </div> |
19 | 19 | <li |
20 | - title="下一页" | |
20 | + :title="t('i.page.next')" | |
21 | 21 | :class="nextClasses" |
22 | 22 | @click="next"> |
23 | 23 | <a><i class="ivu-icon ivu-icon-ios-arrow-right"></i></a> |
... | ... | @@ -25,25 +25,25 @@ |
25 | 25 | </ul> |
26 | 26 | <ul :class="wrapClasses" :style="style" v-else> |
27 | 27 | <span :class="[prefixCls + '-total']" v-if="showTotal"> |
28 | - <slot>共 {{ total }} 条</slot> | |
28 | + <slot>{{ t('i.page.total') }} {{ total }} <template v-if="total <= 1">{{ t('i.page.item') }}</template><template v-else>{{ t('i.page.items') }}</template></slot> | |
29 | 29 | </span> |
30 | 30 | <li |
31 | - title="上一页" | |
31 | + :title="t('i.page.prev')" | |
32 | 32 | :class="prevClasses" |
33 | 33 | @click="prev"> |
34 | 34 | <a><i class="ivu-icon ivu-icon-ios-arrow-left"></i></a> |
35 | 35 | </li> |
36 | - <li title="第一页" :class="firstPageClasses" @click="changePage(1)"><a>1</a></li> | |
37 | - <li title="向前 5 页" v-if="current - 3 > 1" :class="[prefixCls + '-item-jump-prev']" @click="fastPrev"><a><i class="ivu-icon ivu-icon-ios-arrow-left"></i></a></li> | |
36 | + <li title="1" :class="firstPageClasses" @click="changePage(1)"><a>1</a></li> | |
37 | + <li :title="t('i.page.prev5')" v-if="current - 3 > 1" :class="[prefixCls + '-item-jump-prev']" @click="fastPrev"><a><i class="ivu-icon ivu-icon-ios-arrow-left"></i></a></li> | |
38 | 38 | <li :title="current - 2" v-if="current - 2 > 1" :class="[prefixCls + '-item']" @click="changePage(current - 2)"><a>{{ current - 2 }}</a></li> |
39 | 39 | <li :title="current - 1" v-if="current - 1 > 1" :class="[prefixCls + '-item']" @click="changePage(current - 1)"><a>{{ current - 1 }}</a></li> |
40 | 40 | <li :title="current" v-if="current != 1 && current != allPages" :class="[prefixCls + '-item',prefixCls + '-item-active']"><a>{{ current }}</a></li> |
41 | 41 | <li :title="current + 1" v-if="current + 1 < allPages" :class="[prefixCls + '-item']" @click="changePage(current + 1)"><a>{{ current + 1 }}</a></li> |
42 | 42 | <li :title="current + 2" v-if="current + 2 < allPages" :class="[prefixCls + '-item']" @click="changePage(current + 2)"><a>{{ current + 2 }}</a></li> |
43 | - <li title="向后 5 页" v-if="current + 3 < allPages" :class="[prefixCls + '-item-jump-next']" @click="fastNext"><a><i class="ivu-icon ivu-icon-ios-arrow-right"></i></a></li> | |
44 | - <li :title="'最后一页:' + allPages" v-if="allPages > 1" :class="lastPageClasses" @click="changePage(allPages)"><a>{{ allPages }}</a></li> | |
43 | + <li :title="t('i.page.next5')" v-if="current + 3 < allPages" :class="[prefixCls + '-item-jump-next']" @click="fastNext"><a><i class="ivu-icon ivu-icon-ios-arrow-right"></i></a></li> | |
44 | + <li :title="allPages" v-if="allPages > 1" :class="lastPageClasses" @click="changePage(allPages)"><a>{{ allPages }}</a></li> | |
45 | 45 | <li |
46 | - title="下一页" | |
46 | + :title="t('i.page.next')" | |
47 | 47 | :class="nextClasses" |
48 | 48 | @click="next"> |
49 | 49 | <a><i class="ivu-icon ivu-icon-ios-arrow-right"></i></a> |
... | ... | @@ -65,10 +65,12 @@ |
65 | 65 | <script> |
66 | 66 | import { oneOf } from '../../utils/assist'; |
67 | 67 | import Options from './options.vue'; |
68 | + import Locale from '../../mixins/locale'; | |
68 | 69 | |
69 | 70 | const prefixCls = 'ivu-page'; |
70 | 71 | |
71 | 72 | export default { |
73 | + mixins: [ Locale ], | |
72 | 74 | components: { Options }, |
73 | 75 | props: { |
74 | 76 | current: { | ... | ... |
src/components/poptip/poptip.vue
... | ... | @@ -40,6 +40,7 @@ |
40 | 40 | import iButton from '../button/button.vue'; |
41 | 41 | import clickoutside from '../../directives/clickoutside'; |
42 | 42 | import { oneOf } from '../../utils/assist'; |
43 | + import { t } from '../../locale'; | |
43 | 44 | |
44 | 45 | const prefixCls = 'ivu-poptip'; |
45 | 46 | |
... | ... | @@ -76,11 +77,15 @@ |
76 | 77 | }, |
77 | 78 | okText: { |
78 | 79 | type: String, |
79 | - default: '确定' | |
80 | + default () { | |
81 | + return t('i.poptip.okText'); | |
82 | + } | |
80 | 83 | }, |
81 | 84 | cancelText: { |
82 | 85 | type: String, |
83 | - default: '取消' | |
86 | + default () { | |
87 | + return t('i.poptip.cancelText'); | |
88 | + } | |
84 | 89 | } |
85 | 90 | }, |
86 | 91 | data () { | ... | ... |
src/components/transfer/transfer.vue
... | ... | @@ -38,6 +38,7 @@ |
38 | 38 | <script> |
39 | 39 | import List from './list.vue'; |
40 | 40 | import Operation from './operation.vue'; |
41 | + import { t } from '../../locale'; | |
41 | 42 | |
42 | 43 | const prefixCls = 'ivu-transfer'; |
43 | 44 | |
... | ... | @@ -77,7 +78,7 @@ |
77 | 78 | titles: { |
78 | 79 | type: Array, |
79 | 80 | default () { |
80 | - return ['源列表', '目的列表']; | |
81 | + return [t('i.transfer.titles.source'), t('i.transfer.titles.target')]; | |
81 | 82 | } |
82 | 83 | }, |
83 | 84 | operations: { |
... | ... | @@ -92,7 +93,9 @@ |
92 | 93 | }, |
93 | 94 | filterPlaceholder: { |
94 | 95 | type: String, |
95 | - default: '请输入搜索内容' | |
96 | + default () { | |
97 | + return t('i.transfer.filterPlaceholder'); | |
98 | + } | |
96 | 99 | }, |
97 | 100 | filterMethod: { |
98 | 101 | type: Function, |
... | ... | @@ -103,7 +106,9 @@ |
103 | 106 | }, |
104 | 107 | notFoundText: { |
105 | 108 | type: String, |
106 | - default: '列表为空' | |
109 | + default () { | |
110 | + return t('i.transfer.notFoundText'); | |
111 | + } | |
107 | 112 | } |
108 | 113 | }, |
109 | 114 | data () { | ... | ... |
src/locale/lang/en-US.js
... | ... | @@ -17,7 +17,7 @@ export default { |
17 | 17 | startTime: 'Start Time', |
18 | 18 | endTime: 'End Time', |
19 | 19 | clear: 'Clear', |
20 | - ok: 'Ok', | |
20 | + ok: 'OK', | |
21 | 21 | month: '', |
22 | 22 | month1: 'January', |
23 | 23 | month2: 'February', |
... | ... | @@ -55,6 +55,34 @@ export default { |
55 | 55 | m11: 'Nov', |
56 | 56 | m12: 'Dec' |
57 | 57 | } |
58 | + }, | |
59 | + transfer: { | |
60 | + titles: { | |
61 | + source: 'Source', | |
62 | + target: 'Target' | |
63 | + }, | |
64 | + filterPlaceholder: 'Search here', | |
65 | + notFoundText: 'Not Found' | |
66 | + }, | |
67 | + modal: { | |
68 | + okText: 'OK', | |
69 | + cancelText: 'Cancel' | |
70 | + }, | |
71 | + poptip: { | |
72 | + okText: 'OK', | |
73 | + cancelText: 'Cancel' | |
74 | + }, | |
75 | + page: { | |
76 | + prev: 'Previous Page', | |
77 | + next: 'Next Page', | |
78 | + total: 'Total', | |
79 | + item: 'item', | |
80 | + items: 'items', | |
81 | + prev5: 'Previous 5 Pages', | |
82 | + next5: 'Next 5 Pages', | |
83 | + page: '/page', | |
84 | + goto: 'Goto', | |
85 | + p: '' | |
58 | 86 | } |
59 | 87 | } |
60 | 88 | }; |
61 | 89 | \ No newline at end of file | ... | ... |
src/locale/lang/zh-CN.js
... | ... | @@ -55,6 +55,34 @@ export default { |
55 | 55 | m11: '11月', |
56 | 56 | m12: '12月' |
57 | 57 | } |
58 | + }, | |
59 | + transfer: { | |
60 | + titles: { | |
61 | + source: '源列表', | |
62 | + target: '目的列表' | |
63 | + }, | |
64 | + filterPlaceholder: '请输入搜索内容', | |
65 | + notFoundText: '列表为空' | |
66 | + }, | |
67 | + modal: { | |
68 | + okText: '确定', | |
69 | + cancelText: '取消' | |
70 | + }, | |
71 | + poptip: { | |
72 | + okText: '确定', | |
73 | + cancelText: '取消' | |
74 | + }, | |
75 | + page: { | |
76 | + prev: '上一页', | |
77 | + next: '下一页', | |
78 | + total: '共', | |
79 | + item: '条', | |
80 | + items: '条', | |
81 | + prev5: '向前 5 页', | |
82 | + next5: '向后 5 页', | |
83 | + page: '条/页', | |
84 | + goto: '跳至', | |
85 | + p: '页' | |
58 | 86 | } |
59 | 87 | } |
60 | 88 | }; |
61 | 89 | \ No newline at end of file | ... | ... |
src/locale/lang/zh-TW.js
... | ... | @@ -55,6 +55,34 @@ export default { |
55 | 55 | m11: '11月', |
56 | 56 | m12: '12月' |
57 | 57 | } |
58 | + }, | |
59 | + transfer: { | |
60 | + titles: { | |
61 | + source: '源列表', | |
62 | + target: '目的列表' | |
63 | + }, | |
64 | + filterPlaceholder: '請輸入搜索內容', | |
65 | + notFoundText: '列表爲空' | |
66 | + }, | |
67 | + modal: { | |
68 | + okText: '確定', | |
69 | + cancelText: '取消' | |
70 | + }, | |
71 | + poptip: { | |
72 | + okText: '確定', | |
73 | + cancelText: '取消' | |
74 | + }, | |
75 | + page: { | |
76 | + prev: '上壹頁', | |
77 | + next: '下壹頁', | |
78 | + total: '共', | |
79 | + item: '條', | |
80 | + items: '條', | |
81 | + prev5: '向前 5 頁', | |
82 | + next5: '向後 5 頁', | |
83 | + page: '條/頁', | |
84 | + goto: '跳至', | |
85 | + p: '頁' | |
58 | 86 | } |
59 | 87 | } |
60 | 88 | }; |
61 | 89 | \ No newline at end of file | ... | ... |