Home > SYS_I18n > getCurrentLanguage
SYS_I18n.getCurrentLanguage() method
获取当前语言环境
签名
typescript
function getCurrentLanguage(): Promise<string>;1
返回值
Promise<string>
语言
备注
能够获取到的语言受 EDA 当前支持语言限制,其它 API 支持的语言需要显式指定 language 参数才能使用
示例
javascript
// 1. 获取当前显示语言
const current = await eda.sys_I18n.getCurrentLanguage();
// 2. 判断当前是否中文环境
console.log('当前语言:', current);
console.log('是否中文环境:', current.startsWith('zh'));1
2
3
4
5
6
2
3
4
5
6