Commit 5bd0f522994728f75251583c2e0e03dfc5c869b3
1 parent
d63a3781
fixed
#1090 #2387 #2379
Showing
18 changed files
with
44 additions
and
45 deletions
Show diff stats
src/locale/index.js
... | ... | @@ -45,16 +45,4 @@ export const i18n = function(fn) { |
45 | 45 | i18nHandler = fn || i18nHandler; |
46 | 46 | }; |
47 | 47 | |
48 | -// using with vue-i18n in CDN | |
49 | -/*eslint-disable */ | |
50 | -export const setLang = function (name, lang) { | |
51 | - if (typeof window.iview !== 'undefined') { | |
52 | - if (!('langs' in iview)) { | |
53 | - iview.langs = {}; | |
54 | - } | |
55 | - iview.langs[name] = lang; | |
56 | - } | |
57 | -}; | |
58 | -/*eslint-enable */ | |
59 | - | |
60 | -export default { use, t, i18n, setLang }; | |
61 | 48 | \ No newline at end of file |
49 | +export default { use, t, i18n }; | |
62 | 50 | \ No newline at end of file | ... | ... |
1 | +// using with vue-i18n in CDN | |
2 | +/*eslint-disable */ | |
3 | +export default function (lang) { | |
4 | + if (typeof window.iview !== 'undefined') { | |
5 | + if (!('langs' in iview)) { | |
6 | + iview.langs = {}; | |
7 | + } | |
8 | + iview.langs[lang.i.locale] = lang; | |
9 | + } | |
10 | +}; | |
11 | +/*eslint-enable */ | |
0 | 12 | \ No newline at end of file | ... | ... |
src/locale/lang/de-DE.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/en-US.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/es-ES.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/fr-FR.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/id-ID.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/ja-JP.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/ko-KR.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/pt-BR.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/pt-PT.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/ru-RU.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/sv-SE.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/tr-TR.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/uk-UA.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/vi-VN.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |
src/locale/lang/zh-CN.js
src/locale/lang/zh-TW.js
1 | -import { setLang } from '../index'; | |
1 | +import setLang from '../lang'; | |
2 | 2 | |
3 | 3 | const lang = { |
4 | 4 | i: { |
... | ... | @@ -100,6 +100,6 @@ const lang = { |
100 | 100 | } |
101 | 101 | }; |
102 | 102 | |
103 | -setLang(lang.i.locale, lang); | |
103 | +setLang(lang); | |
104 | 104 | |
105 | 105 | export default lang; |
106 | 106 | \ No newline at end of file | ... | ... |