未验证 提交 86518d4e 编写于 作者: O openharmony_ci 提交者: Gitee

!5042 翻译已完成4452

Merge pull request !5042 from shawn_he/4452-a
......@@ -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**
......
# 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**<br>
> - 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(): &lt;LocaleResponse&gt;
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&nbsp;language&nbsp;of&nbsp;the&nbsp;application,&nbsp;for&nbsp;example,&nbsp;**zh**. |
| countryOrRegion | string | Country&nbsp;or&nbsp;region,&nbsp;for&nbsp;example,&nbsp;**CN**. |
| dir | string | Text&nbsp;layout&nbsp;direction.&nbsp;Available&nbsp;values&nbsp;are&nbsp;as&nbsp;follows:<br/>-&nbsp;**ltr**:&nbsp;The&nbsp;text&nbsp;direction&nbsp;is&nbsp;from&nbsp;left&nbsp;to&nbsp;right.<br/>-&nbsp;**rtl**:&nbsp;The&nbsp;text&nbsp;direction&nbsp;is&nbsp;from&nbsp;right&nbsp;to&nbsp;left. |
| unicodeSetting<sup>5+</sup> | string | Unicode&nbsp;key&nbsp;set&nbsp;determined&nbsp;by&nbsp;the&nbsp;locale.<br/>For&nbsp;example,&nbsp;**{"nu":"arab"}**&nbsp;indicates&nbsp;that&nbsp;the&nbsp;current&nbsp;locale&nbsp;uses&nbsp;Arabic&nbsp;numerals.<br/>If&nbsp;the&nbsp;current&nbsp;locale&nbsp;does&nbsp;not&nbsp;have&nbsp;a&nbsp;specific&nbsp;key&nbsp;set,&nbsp;an&nbsp;empty&nbsp;set&nbsp;is&nbsp;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:<br>- **ltr**: from left to right<br>- **rtl**: from right to left|
| unicodeSetting<sup>5+</sup> | 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.<br>For example, **{"nu":"arab"}** indicates that current locale uses Arabic numerals.|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册