index.js 808 Bytes
Newer Older
水落(YangLei)'s avatar
水落(YangLei) committed
1
import selectLang from './select';
shuiluo's avatar
shuiluo committed
2 3 4
import tableLang from './table';
import userLang from './user';
import systemLang from './system';
陈浩玮's avatar
陈浩玮 committed
5 6
import InputLang from './input';
import OtherLang from './other';
shuiluo's avatar
shuiluo committed
7
import acronLang from './acron';
8
import basicLang from './basic';
水落(YangLei)'s avatar
水落(YangLei) committed
9 10 11 12 13 14 15

const zh_CN = {};
const en_US = {};

function formatLang(langObject) {
    for (const key in langObject) {
        const element = langObject[key];
shuiluo's avatar
shuiluo committed
16 17 18
        if (zh_CN[key]) {
            console.warn('当前key值: ', key, '已经被注册了');
        }
水落(YangLei)'s avatar
水落(YangLei) committed
19 20 21 22 23 24
        zh_CN[key] = element[0];
        en_US[key] = element[1];
    }
}

formatLang(selectLang);
shuiluo's avatar
shuiluo committed
25 26 27
formatLang(tableLang);
formatLang(userLang);
formatLang(systemLang);
陈浩玮's avatar
陈浩玮 committed
28 29
formatLang(InputLang);
formatLang(OtherLang);
shuiluo's avatar
shuiluo committed
30
formatLang(acronLang);
31
formatLang(basicLang);
水落(YangLei)'s avatar
水落(YangLei) committed
32 33

export { en_US, zh_CN };