mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-01-14 23:11:06 +00:00
19 lines
474 B
JavaScript
19 lines
474 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_MINIGAME;
|
|
sys.language = languageMap[sys.language] || sys.language;
|
|
},
|
|
}); |