Updated on 2024-07-30 GMT+08:00

Setting a Language

setLanguage

API Description

This API is used to set a language for the app. The set language will be used on the UI.

Method Definition

1
+ (void)setLanguage:(HWMSdkLanguageType)language;

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

language

Yes

HWMSdkLanguageType

Language to be set. Currently, only Chinese and English are supported.

Table 2 HWMSdkLanguageType parameters

Enumerated Value

Description

HWMSdkLanguageTypeZH

Chinese.

HWMSdkLanguageTypeEN

English.

HWMSdkLanguageTypeCustomized

Custom language.

Sample Code

1
2
/// Language initialization.
[HWMSdk setLanguage:HWMSdkLanguageTypeEN];
  1. You are advised to use this API after initialization.
  2. This API does not support setting during a meeting. A language set during a meeting does not take effect immediately.
  3. Currently, only Chinese and English are supported.

setLanguage:languageCode:

API Description

This API is used to customize the SDK language. The default language is Chinese.

Precautions

To implement a user-defined language, create the corresponding internationalization file in the directory at the same level as en.lproj. For example, to add Arabic, you can create ar.lproj/Localizable.strings. The language set through this API must be the same as the system language.

Method Definition

1
+ (void)setLanguage:(HWMSdkLanguageType)language languageCode:(NSString *)languageCode;

Parameter Description

Table 3 Parameter description

Parameter

Mandatory

Type

Description

language

Yes

HWMSdkLanguageType

Enumerated values of languages.

languageCode

No

NSString *

Language code. If the language is Chinese or English, this parameter can be left empty.

Return Values

None

Sample Code

1
2
/// Change the language.
[HWMSdk setLanguage:HWMSdkLanguageTypeCustomized languageCode:@"ar"];