diff --git a/en/application-dev/reference/apis/js-apis-hichecker.md b/en/application-dev/reference/apis/js-apis-hichecker.md index 3eac39f8f2000f845fcd6c0288fea80343c62752..1095d5f9aa56c1077c8db6ba2fcb81ea29642309 100644 --- a/en/application-dev/reference/apis/js-apis-hichecker.md +++ b/en/application-dev/reference/apis/js-apis-hichecker.md @@ -21,15 +21,15 @@ Provides the constants of all rule types. | Name | Type| Description | | ---------------------------------- | -------- | ------------------------------------------------------ | -| RULE_CAUTION_PRINT_LOG | bigint | Alarm rule, which is programmed to print a log when an alarm is generated. | -| RULE_CAUTION_TRIGGER_CRASH | bigint | Alarm rule, which is programmed to force the application to exit when an alarm is generated. | -| RULE_THREAD_CHECK_SLOW_PROCESS | bigint | Caution rule, which is programmed to detect whether any time-consuming function is invoked. | -| RULE_CHECK_ABILITY_CONNECTION_LEAK | bigint | Caution rule, which is programmed to detect whether ability leakage has occurred. | +| RULE_CAUTION_PRINT_LOG | bigInt | Alarm rule, which is programmed to print a log when an alarm is generated. | +| RULE_CAUTION_TRIGGER_CRASH | bigInt | Alarm rule, which is programmed to force the application to exit when an alarm is generated. | +| RULE_THREAD_CHECK_SLOW_PROCESS | bigInt | Caution rule, which is programmed to detect whether any time-consuming function is invoked. | +| RULE_CHECK_ABILITY_CONNECTION_LEAK | bigInt | Caution rule, which is programmed to detect whether ability leakage has occurred. | ## hichecker.addRule -addRule(rule: bigint): void +addRule(rule: bigInt): void Adds one or more rules. HiChecker detects unexpected operations or gives feedback based on the added rules. @@ -39,7 +39,7 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------- | -| rule | bigint | Yes | Rule to be added.| +| rule | bigInt | Yes | Rule to be added.| **Example** @@ -54,7 +54,7 @@ hichecker.addRule( ## hichecker.removeRule -removeRule(rule: bigint): void +removeRule(rule: bigInt): void Removes one or more rules. The removed rules will become ineffective. @@ -64,7 +64,7 @@ Removes one or more rules. The removed rules will become ineffective. | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------- | -| rule | bigint | Yes | Rule to be removed.| +| rule | bigInt | Yes | Rule to be removed.| **Example** @@ -79,7 +79,7 @@ hichecker.removeRule( ## hichecker.getRule -getRule(): bigint +getRule(): bigInt Obtains a collection of thread, process, and alarm rules that have been added. @@ -89,7 +89,7 @@ Obtains a collection of thread, process, and alarm rules that have been added. | Type | Description | | ------ | ---------------------- | -| bigint | Collection of added rules. | +| bigInt | Collection of added rules.| **Example** @@ -103,7 +103,7 @@ hichecker.getRule(); // Return 1n. ## hichecker.contains -contains(rule: bigint): boolean +contains(rule: bigInt): boolean Checks whether the specified rule exists in the collection of added rules. If the rule is of the thread level, this operation is performed only on the current thread. @@ -113,7 +113,7 @@ Checks whether the specified rule exists in the collection of added rules. If th | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------- | -| rule | bigint | Yes | Rule to be checked. | +| rule | bigInt | Yes | Rule to be checked.| **Return value** diff --git a/en/application-dev/reference/apis/js-apis-system-configuration.md b/en/application-dev/reference/apis/js-apis-system-configuration.md index 310abffe5779e336ca676161d09172eb39af5bac..dfeb0cf7db9c94d7831fe96cc19c6a6c09afd471 100644 --- a/en/application-dev/reference/apis/js-apis-system-configuration.md +++ b/en/application-dev/reference/apis/js-apis-system-configuration.md @@ -1,7 +1,7 @@ # Application Configuration -> ![icon-note.gif](public_sys-resources/icon-note.gif) **Noteļ¼š** -> - The APIs of this module are no longer maintained since API version 7. It is recommended that you use [`@ohos.i18n`](js-apis-i18n.md) and [`@ohos.intl`](js-apis-intl.md) instead. +> **NOTE**
+> - The APIs of this module are no longer maintained since API version 7. You are advised to use [`@ohos.i18n`](js-apis-i18n.md) and [`@ohos.intl`](js-apis-intl.md) instead. > > > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -17,29 +17,37 @@ import configuration from '@system.configuration'; ## configuration.getLocale -getLocale(): <LocaleResponse> +static getLocale(): LocaleResponse Obtains the current locale of the application, which is the same as the system locale. **System capability**: SystemCapability.ArkUI.ArkUI.Lite -**Return values** -**Table 1** LocaleResponse - -| Name | Type | Description | -| -------- | -------- | -------- | -| language | string | Current language of the application, for example, **zh**. | -| countryOrRegion | string | Country or region, for example, **CN**. | -| dir | string | Text layout direction. Available values are as follows:
- **ltr**: The text direction is from left to right.
- **rtl**: The text direction is from right to left. | -| unicodeSetting5+ | string | Unicode key set determined by the locale.
For example, **{"nu":"arab"}** indicates that the current locale uses Arabic numerals.
If the current locale does not have a specific key set, an empty set is returned. | +**Return value** +| Type | Description | +| -------------- | ------------- | +| LocaleResponse | Current locale information.| **Example** - -``` -export default { - getLocale() { - const localeInfo = configuration.getLocale(); - console.info(localeInfo.language); + ``` + export default { + getLocale() { + const localeInfo = configuration.getLocale(); + console.info(localeInfo.language); + } } -} -``` \ No newline at end of file + ``` + + +## LocaleResponse + +Defines attributes of the current locale. + +**System capability**: SystemCapability.ArkUI.ArkUI.Lite + +| Name | Type | Readable | Writable | Description | +| ---- | ------ | ---- | ---- | ---------------------------------------- | +| language | string | Yes | No | Language, for example, **zh**.| +| countryOrRegion | string | Yes | No | Country or region, for example, **CN** or **US**.| +| dir | string | Yes | No | Text layout direction. The value can be:
- **ltr**: from left to right
- **rtl**: from right to left| +| unicodeSetting5+ | string | Yes | No | Unicode language key set determined by the locale. If current locale does not have a specific key set, an empty set is returned.
For example, **{"nu":"arab"}** indicates that current locale uses Arabic numerals.|