import { UTSiOS } from "DCloudUTSFoundation"; export class AppBaseInfoDeviceUtil { public static getAppID() : string { return UTSiOS.getAppId(); } public static getAppName() : string { return UTSiOS.getAppName(); } public static getHostName() : string { return UTSiOS.getHostName(); } public static getHostTheme() : string { return UTSiOS.getHostTheme(); } public static getHostLanguage() : string { return UTSiOS.getHostLanguage(); } public static getHostVersion() : string { return UTSiOS.getHostVersion(); } public static getHostPackageName() : string { return UTSiOS.getHostPackageName(); } public static getAppVersion() : string { return UTSiOS.getAppVersion(); } public static getAppVersionCode() : string { return UTSiOS.getAppVersionCode(); } public static getAppWgtVersion() : string { return UTSiOS.getAppWgtVersion(); } public static getOsLanguage() : string { return UTSiOS.getOsLanguage(); } public static getOsLanguageNormal() : string { const LOCALE_ZH_HANS = 'zh-Hans' const LOCALE_ZH_HANT = 'zh-Hant' let locale = UTSiOS.getOsLanguage(); if (locale.indexOf('zh') == 0) { if (locale.indexOf('-hans') > -1) { return LOCALE_ZH_HANS; } if (locale.indexOf('-hant') > -1) { return LOCALE_ZH_HANT; } if (locale.includes("-tw") || locale.includes("-hk") || locale.includes("-mo") || locale.includes("-cht")) { return LOCALE_ZH_HANT; } return LOCALE_ZH_HANS; } else { return locale; } } public static getAppInnerVersion() : string { return UTSiOS.getInnerVersion(); } }