Updated on 2025-09-19 GMT+08:00

Setting a Language

API Description

This API is used to set the meeting UI language.

1. To set the language when joining a meeting, call this API in then of the joinConf API.

2. After joining a meeting, you can call this API at any time to change the UI language.

3. By default, the meeting UI language is Chinese.

Method Definition

1
setLang(lang,path):Promise<Result>

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

lang

Yes

string

zh-CN: Chinese.

en-US: English.

ar: Arabic (custom language).

path

No

string

Request path of the custom language. (Currently, only Arabic is supported.)

1. Complete request path. Example: https://api.example.com/lang.json

2. Relative request path (the frontend and backend paths must have the same origin). Example: /lang.json

Obtain UI strings from the Web UI SDK package. For version 1.0.18, obtain the strings from the common and sdk folders and merge the obtained file content into one. From version 1.0.19, obtain the strings from the lang folder. The files, for example, en_US.json, contain a JSON body where each value indicates text of a UI string. Translate the strings into the target custom language. Example:

Current language text in JSON format:

{

"title": "My Meeting"

}

Custom language text in JSON format:

{

"title": "اجتماعاتي"

}

Return Values

For details about the error structure, see Table 3.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
/**
* Join a meeting and set the language.
*/
HWMeeting.joinConf({confId, pwd, nickName, token}).then(() => {
   HWMeeting.setLang('en-US'); // Set the language.
    ...    
   }).catch((e) => {
    // API calling failed.
    ...    
})