index.js 752 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';
水落(YangLei)'s avatar
水落(YangLei) committed
8 9 10 11 12 13 14

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

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

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

export { en_US, zh_CN };