Skip to content

Commit 24bc996

Browse files
committed
fix bug of i18n
1 parent d8ce579 commit 24bc996

32 files changed

+99
-104
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@ npm install vue-cron-generator
2020
import Vue from 'vue'
2121
import VueI18n from 'vue-i18n'
2222
import elementEnLocale from 'element-ui/lib/locale/lang/en'
23-
import elementZhCNLocale from 'element-ui/lib/locale/lang/zh-CN'
24-
import enUSLocale from './en-US'
25-
import zhCNLocale from './zh-CN'
26-
import { getLocale } from '../util/tools'
23+
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'
24+
import cronEnLocale from 'vue-cron-generator/src/locale/en'
25+
import cronZhLocale from 'vue-cron-generator/src/locale/zh'
26+
import { getLocale } from 'vue-cron-generator/src/util/tools'
2727

2828
Vue.use(VueI18n)
2929

3030
const messages = {
31-
en_US: {
32-
...enUSLocale,
31+
en: {
32+
...enLocale,
3333
...elementEnLocale
3434
},
35-
zh_CN: {
36-
...zhCNLocale,
37-
...elementZhCNLocale
35+
zh: {
36+
...zhLocale,
37+
...elementZhLocale
3838
}
3939
},
4040

4141
i18n = new VueI18n({
4242
// set locale
43-
// options: 'en_US' | 'zh_CN'
43+
// options: 'en' | 'zh'
4444
locale: getLocale(),
4545
// set locale messages
4646
messages

README_zh_CN.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,38 @@
1111

1212
## 使用(例子代码)
1313
- 下载依赖([npm](https://www.npmjs.com/package/vue-cron-generator))
14-
``` bash
15-
npm install vue-cron-generator
16-
```
17-
18-
- [src/lang/index.js](https://github.com/attemper/attemper/blob/master/attemper-admin/src/lang/index.js)
1914
``` typescript
2015
import Vue from 'vue'
2116
import VueI18n from 'vue-i18n'
2217
import elementEnLocale from 'element-ui/lib/locale/lang/en'
23-
import elementZhCNLocale from 'element-ui/lib/locale/lang/zh-CN'
24-
import enUSLocale from './en-US'
25-
import zhCNLocale from './zh-CN'
26-
import { getLocale } from '../util/tools'
18+
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'
19+
import cronEnLocale from 'vue-cron-generator/src/locale/en'
20+
import cronZhLocale from 'vue-cron-generator/src/locale/zh'
21+
import { getLocale } from 'vue-cron-generator/src/util/tools'
2722

2823
Vue.use(VueI18n)
2924

3025
const messages = {
31-
en_US: {
32-
...enUSLocale,
26+
en: {
27+
...enLocale,
3328
...elementEnLocale
3429
},
35-
zh_CN: {
36-
...zhCNLocale,
37-
...elementZhCNLocale
30+
zh: {
31+
...zhLocale,
32+
...elementZhLocale
3833
}
3934
},
4035

4136
i18n = new VueI18n({
4237
// set locale
43-
// options: 'en_US' | 'zh_CN'
38+
// options: 'en' | 'zh'
4439
locale: getLocale(),
4540
// set locale messages
4641
messages
4742
})
4843

4944
export default i18n
5045

51-
5246
```
5347

5448
- [main.js](https://github.com/attemper/attemper/blob/master/attemper-admin/src/lang/index.js)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-cron-generator",
33
"description": "a project using vue,element-ui to generate cron expression",
4-
"version": "0.2.0",
4+
"version": "0.2.2",
55
"author": "ldang264 <[email protected]>",
66
"license": "MIT",
77
"private": false,

src/components/config/common/every.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</template>
88

99
<script>
10-
import { EVERY } from '@/constant/filed'
11-
import watchValue from '@/mixins/watchValue'
10+
import { EVERY } from '../../../constant/filed'
11+
import watchValue from '../../../mixins/watchValue'
1212
1313
export default {
1414
mixins: [watchValue],

src/components/config/common/fixed.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
</template>
3232

3333
<script>
34-
import { sortNum } from '@/util/tools'
35-
import { FIXED } from '@/constant/filed'
36-
import watchValue from '@/mixins/watchValue'
37-
import { isNumber } from '@/util/tools'
34+
import { sortNum } from '../../../util/tools'
35+
import { FIXED } from '../../../constant/filed'
36+
import watchValue from '../../../mixins/watchValue'
37+
import { isNumber } from '../../../util/tools'
3838
3939
export default {
4040
mixins: [watchValue],

src/components/config/common/period.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
</template>
1313

1414
<script>
15-
import { EVERY, PERIOD } from '@/constant/filed'
16-
import watchValue from '@/mixins/watchValue'
17-
import { isNumber } from '@/util/tools'
15+
import { EVERY, PERIOD } from '../../../constant/filed'
16+
import watchValue from '../../../mixins/watchValue'
17+
import { isNumber } from '../../../util/tools'
1818
1919
export default {
2020
mixins: [watchValue],

src/components/config/common/range.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
</template>
1313

1414
<script>
15-
import { RANGE } from '@/constant/filed'
16-
import watchValue from '@/mixins/watchValue'
17-
import { isNumber } from '@/util/tools'
15+
import { RANGE } from '../../../constant/filed'
16+
import watchValue from '../../../mixins/watchValue'
17+
import { isNumber } from '../../../util/tools'
1818
1919
export default {
2020
mixins: [watchValue],

src/components/config/custom/dayOfWeek/last.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
</template>
2323

2424
<script>
25-
import { LAST } from '@/constant/filed'
26-
import watchValue from '@/mixins/watchValue'
27-
import { isNumber } from '@/util/tools'
25+
import { LAST } from '../../../../constant/filed'
26+
import watchValue from '../../../../mixins/watchValue'
27+
import { isNumber } from '../../../../util/tools'
2828
2929
export default {
3030
mixins: [watchValue],

src/components/config/custom/dayOfWeek/period.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
</template>
2727

2828
<script>
29-
import { PERIOD } from '@/constant/filed'
30-
import watchValue from '@/mixins/watchValue'
31-
import { isNumber } from '@/util/tools'
29+
import { PERIOD } from '../../../../constant/filed'
30+
import watchValue from '../../../../mixins/watchValue'
31+
import { isNumber } from '../../../../util/tools'
3232
3333
export default {
3434
mixins: [watchValue],

src/components/config/custom/dayOfWeek/range.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
</template>
4343

4444
<script>
45-
import { RANGE } from '@/constant/filed'
46-
import watchValue from '@/mixins/watchValue'
47-
import { isNumber } from '@/util/tools'
45+
import { RANGE } from '../../../../constant/filed'
46+
import watchValue from '../../../../mixins/watchValue'
47+
import { isNumber } from '../../../../util/tools'
4848
4949
export default {
5050
mixins: [watchValue],

0 commit comments

Comments
 (0)