mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-01-15 07:21:07 +00:00
19 lines
465 B
JavaScript
19 lines
465 B
JavaScript
|
const adapter = window.__globalAdapter;
|
||
|
let adaptSysFunc = adapter.adaptSys;
|
||
|
|
||
|
//taobao IDE language ("Chinese")
|
||
|
//taobao phone language (Andrond: "cn", iPad: 'zh_CN')
|
||
|
const languageMap = {
|
||
|
Ch: "zh",
|
||
|
cn: "zh",
|
||
|
zh: "zh",
|
||
|
};
|
||
|
|
||
|
Object.assign(adapter, {
|
||
|
// Extend adaptSys interface
|
||
|
adaptSys (sys) {
|
||
|
adaptSysFunc.call(this, sys);
|
||
|
sys.platform = sys.TAOBAO;
|
||
|
sys.language = languageMap[sys.language] || sys.language;
|
||
|
},
|
||
|
});
|