Home > SYS_I18n > getCurrentLanguage
SYS_I18n.getCurrentLanguage() method
Get Current language environment
Signature
typescript
function getCurrentLanguage(): Promise<string>;1
Returns
Promise<string>
Language
Remarks
The languages that can be obtained are limited by the languages currently supported by EDA. Languages supported by other APIs need to explicitly specify the language parameter to be used
Example
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