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

Setting the Language

setLanguage

API Description

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

Precautions

None

Method Definition

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

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

language

Yes

HWMSdkLanguageType

Enumerated values of languages.

Table 2 HWMSdkLanguageType parameters

Enumerated Value

Description

HWMSdkLanguageTypeZH

Chinese.

HWMSdkLanguageTypeEN

English.

HWMSdkLanguageTypeCustomized

Custom language.

Return Values

None

Sample Code

1
2
/// Change the language.
[HWMSdk setLanguage:HWMSdkLanguageType];

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 *

If LanguageType is set to Chinese or English, this parameter can be left empty or set to any value.

If LanguageType is set to other languages, set this parameter to the language code, for example, ar (Arabic).

Return Values

None

Sample Code

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