use dist's locale
This commit is contained in:
parent
cd92d87821
commit
5fbe80fe0e
2 changed files with 7 additions and 38 deletions
10
src/index.js
10
src/index.js
|
@ -50,7 +50,6 @@ import Upload from './components/upload';
|
|||
import {Row, Col} from './components/grid';
|
||||
import {Select, Option, OptionGroup} from './components/select';
|
||||
import locale from './locale/index';
|
||||
import locales from './locale/locales';
|
||||
|
||||
const iview = {
|
||||
Affix,
|
||||
|
@ -155,7 +154,6 @@ module.exports = { // eslint-disable-line no-undef
|
|||
locale: locale.use,
|
||||
i18n: locale.i18n,
|
||||
install,
|
||||
locales,
|
||||
Affix,
|
||||
Alert,
|
||||
AutoComplete,
|
||||
|
@ -223,4 +221,10 @@ module.exports = { // eslint-disable-line no-undef
|
|||
Upload
|
||||
};
|
||||
|
||||
module.exports.default = module.exports; // eslint-disable-line no-undef
|
||||
module.exports.lang = (code) => { // eslint-disable-line no-undef
|
||||
const langObject = window['iview/locale'].default;
|
||||
if (code === langObject.i.locale) locale.use(langObject);
|
||||
else console.log(`The ${code} language pack is not loaded.`); // eslint-disable-line no-console
|
||||
};
|
||||
|
||||
module.exports.default = module.exports; // eslint-disable-line no-undef
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
// export all locale files
|
||||
|
||||
import deDE from './lang/de-DE.js';
|
||||
import enUS from './lang/en-US.js';
|
||||
import esES from './lang/es-ES.js';
|
||||
import frFR from './lang/fr-FR.js';
|
||||
import idID from './lang/id-ID.js';
|
||||
import jaJP from './lang/ja-JP.js';
|
||||
import koKR from './lang/ko-KR.js';
|
||||
import ptBR from './lang/pt-BR.js';
|
||||
import ptPT from './lang/pt-PT.js';
|
||||
import ruRU from './lang/ru-RU.js';
|
||||
import svSE from './lang/sv-SE.js';
|
||||
import trTR from './lang/tr-TR.js';
|
||||
import viVN from './lang/vi-VN.js';
|
||||
import zhCN from './lang/zh-CN.js';
|
||||
import zhTW from './lang/zh-TW.js';
|
||||
|
||||
export default {
|
||||
'de-DE': deDE,
|
||||
'en-US': enUS,
|
||||
'es-ES': esES,
|
||||
'fr-FR': frFR,
|
||||
'id-ID': idID,
|
||||
'ja-JP': jaJP,
|
||||
'ko-KR': koKR,
|
||||
'pt-BR': ptBR,
|
||||
'pt-PT': ptPT,
|
||||
'ru-RU': ruRU,
|
||||
'sv-SE': svSE,
|
||||
'tr-TR': trTR,
|
||||
'vi-VN': viVN,
|
||||
'zh-CN': zhCN,
|
||||
'zh-TW': zhTW
|
||||
};
|
Loading…
Add table
Reference in a new issue