diff --git a/en/application-dev/dfx/Readme-EN.md b/en/application-dev/dfx/Readme-EN.md
index f46c27be2587586dfeb65552a0afe340b5a6187b..b8a4496e09420b3a7557e5c8b8996deaf14ce1c9 100644
--- a/en/application-dev/dfx/Readme-EN.md
+++ b/en/application-dev/dfx/Readme-EN.md
@@ -1,11 +1,8 @@
# DFX
-- Application Event Logging
- - [Development of Application Event Logging](hiappevent-guidelines.md)
-- Performance Tracing
- - [Development of Performance Tracing](hitracemeter-guidelines.md)
-- Distributed Call Chain Tracing
- - [Development of Distributed Call Chain Tracing](hitracechain-guidelines.md)
+- [Development of Application Event Logging](hiappevent-guidelines.md)
+- [Development of Performance Tracing](hitracemeter-guidelines.md)
+- [Development of Distributed Call Chain Tracing](hitracechain-guidelines.md)
- Error Management
- [Development of Error Manager](errormanager-guidelines.md)
- - [Development of Application Recovery](apprecovery-guidelines.md)
\ No newline at end of file
+ - [Development of Application Recovery](apprecovery-guidelines.md)
diff --git a/en/application-dev/internationalization/i18n-guidelines.md b/en/application-dev/internationalization/i18n-guidelines.md
index 8218f2561376c4119f66be0175c5c9ea16c7d024..e78bdb6437b26b8a30ee23f9fdec380087297b33 100644
--- a/en/application-dev/internationalization/i18n-guidelines.md
+++ b/en/application-dev/internationalization/i18n-guidelines.md
@@ -6,7 +6,7 @@ The [intl](intl-guidelines.md) module provides basic i18n capabilities through t
## Obtaining and Setting i18n Information
-The system provides APIs to configure information such as the system language, preferred language, country or region, 24-hour clock, and local digit switch.
+The following table lists the APIs used to configure information such as the system language, preferred language, country or region, 24-hour clock, and use of local digits.
### Available APIs
@@ -30,15 +30,15 @@ The system provides APIs to configure information such as the system language, p
| System | getPreferredLanguageList()9+ | Obtains the preferred language list. |
| System | getFirstPreferredLanguage()9+ | Obtains the first language in the preferred language list. |
| System | getAppPreferredLanguage()9+ | Obtains the preferred language of an application. |
-| System | setUsingLocalDigit(flag: boolean)9+ | Sets whether to enable the local digit switch. |
-| System | getUsingLocalDigit()9+ | Checks whether the local digit switch is turned on. |
+| System | setUsingLocalDigit(flag: boolean)9+ | Specifies whether to enable use of local digits. |
+| System | getUsingLocalDigit()9+ | Checks whether use of local digits is enabled. |
| | isRTL(locale:string):boolean9+ | Checks whether the locale uses a right-to-left (RTL) language.|
### How to Develop
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Obtain and set the system language.
@@ -51,7 +51,7 @@ The system provides APIs to configure information such as the system language, p
I18n.System.setSystemLanguage("en"); // Set the system language to en.
let language = I18n.System.getSystemLanguage(); // language = "en"
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -65,7 +65,7 @@ The system provides APIs to configure information such as the system language, p
I18n.System.setSystemRegion("CN"); // Set the system country to CN.
let region = I18n.System.getSystemRegion(); // region = "CN"
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -79,7 +79,7 @@ The system provides APIs to configure information such as the system language, p
I18n.System.setSystemLocale("zh-Hans-CN"); // Set the system locale to zh-Hans-CN.
let locale = I18n.System.getSystemLocale(); // locale = "zh-Hans-CN"
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -92,7 +92,7 @@ The system provides APIs to configure information such as the system language, p
let rtl = I18n.isRTL("zh-CN"); // rtl = false
rtl = I18n.isRTL("ar"); // rtl = true
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -106,7 +106,7 @@ The system provides APIs to configure information such as the system language, p
I18n.System.set24HourClock(true);
let hourClock = I18n.System.is24HourClock(); // hourClock = true
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -121,7 +121,7 @@ The system provides APIs to configure information such as the system language, p
let sentenceCase = false;
let localizedLanguage = I18n.System.getDisplayLanguage(language, locale, sentenceCase); // localizedLanguage = "English"
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -136,7 +136,7 @@ The system provides APIs to configure information such as the system language, p
let sentenceCase = false;
let localizedCountry = I18n.System.getDisplayCountry(country, locale, sentenceCase); // localizedCountry = "U.S."
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -150,7 +150,7 @@ The system provides APIs to configure information such as the system language, p
let languageList = I18n.System.getSystemLanguages(); // languageList = ["en-Latn-US", "zh-Hans"]
let countryList = I18n.System.getSystemCountries("zh"); // countryList = ["ZW", "YT", ..., "CN", "DE"], 240 countries and regions in total
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -162,7 +162,7 @@ The system provides APIs to configure information such as the system language, p
try {
let isSuggest = I18n.System.isSuggested("zh", "CN"); // isSuggest = true
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -182,7 +182,7 @@ The system provides APIs to configure information such as the system language, p
let firstPreferredLanguage = I18n.System.getFirstPreferredLanguage(); // firstPreferredLanguage = "en-GB"
let appPreferredLanguage = I18n.System.getAppPreferredLanguage(); // Set the preferred language of the application to en-GB if the application contains en-GB resources.
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -190,14 +190,14 @@ The system provides APIs to configure information such as the system language, p
Call **setUsingLocalDigit** to enable the local digit switch. (This is a system API and can be called only by system applications with the UPDATE_CONFIGURATION permission.)
Call **getUsingLocalDigit** to check whether the local digit switch is enabled.
- Currently, the local digit switch applies only to the following languages: "ar", "as", "bn", "fa", "mr", "my", "ne", and "ur".
+ Currently, use of local digits is supported only for the following languages: **ar**, **as**, **bn**, **fa**, **mr**, **my**, **ne**, **ur**.
```js
try {
I18n.System.setUsingLocalDigit(true); // Enable the local digit switch.
let status = I18n.System.getUsingLocalDigit(); // status = true
} catch(error) {
- console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`)
+ console.error(`call i18n.System interface failed, error code: ${error.code}, message: ${error.message}`);
}
```
@@ -220,14 +220,14 @@ try {
| Calendar | getMinimalDaysInFirstWeek():number8+ | Obtains the minimum number of days in the first week of a year. |
| Calendar | setMinimalDaysInFirstWeek(value:number): void8+ | Sets the minimum number of days in the first week of a year. |
| Calendar | getDisplayName(locale:string):string8+ | Obtains the localized display of the **Calendar** object. |
-| Calendar | isWeekend(date?:Date):boolean8+ | Checks whether the specified date in this **Calendar** object is a weekend. |
+| Calendar | isWeekend(date?:Date):boolean8+ | Checks whether a given date is a weekend in the calendar. |
### How to Develop
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Instantiate a **Calendar** object.
@@ -254,7 +254,7 @@ try {
Call **set** to set the year, month, day, hour, minute, and second for the **Calendar** object.
```js
- calendar.set(2021, 12, 21, 6, 0, 0)
+ calendar.set(2021, 12, 21, 6, 0, 0);
```
5. Set and obtain the time zone for the **Calendar** object.
@@ -317,7 +317,7 @@ try {
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Instantiate a **PhoneNumberFormat** object.
@@ -359,7 +359,7 @@ The **I18NUtil** class provides an API to implement measurement conversion.
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Convert a measurement unit.
@@ -393,7 +393,7 @@ The **I18NUtil** class provides an API to implement measurement conversion.
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Instantiates an **IndexUtil** object.
@@ -418,7 +418,7 @@ The **I18NUtil** class provides an API to implement measurement conversion.
Call **addLocale** to add the alphabet index of a new locale to the current index list.
```js
- indexUtil.addLocale("ar")
+ indexUtil.addLocale("ar");
```
5. Obtain the index of a string.
@@ -454,7 +454,7 @@ When a text is displayed in more than one line, use [BreakIterator8](../referenc
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Instantiate a **BreakIterator** object.
@@ -462,7 +462,7 @@ When a text is displayed in more than one line, use [BreakIterator8](../referenc
Call **getLineInstance** to instantiate a **BreakIterator** object.
```js
- let locale = "en-US"
+ let locale = "en-US";
let breakIterator = I18n.getLineInstance(locale);
```
@@ -531,7 +531,7 @@ When a text is displayed in more than one line, use [BreakIterator8](../referenc
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Instantiate the **TimeZone** object, and obtain the time zone information.
@@ -592,7 +592,7 @@ Call [Transliterator](../reference/apis/js-apis-i18n.md#transliterator9) APIs to
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Obtains the transliterator ID list.
@@ -637,7 +637,7 @@ Call [Transliterator](../reference/apis/js-apis-i18n.md#transliterator9) APIs to
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Check the input character has a certain attribute.
@@ -719,7 +719,7 @@ Call [Transliterator](../reference/apis/js-apis-i18n.md#transliterator9) APIs to
1. Import the **i18n** module.
```js
- import I18n from '@ohos.i18n'
+ import I18n from '@ohos.i18n';
```
2. Check the sequence of year, month, and day in a date.
diff --git a/en/application-dev/internationalization/intl-guidelines.md b/en/application-dev/internationalization/intl-guidelines.md
index 609af84500cecb0ce5bda8409216b6957182885f..bcc624aea2f3ef6b472171cfca507752fd2ca129 100644
--- a/en/application-dev/internationalization/intl-guidelines.md
+++ b/en/application-dev/internationalization/intl-guidelines.md
@@ -25,7 +25,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug
Importing an incorrect bundle can lead to unexpected API behavior.
```js
- import Intl from '@ohos.intl'
+ import Intl from '@ohos.intl';
```
2. Instantiates a **Locale** object.
@@ -100,7 +100,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug
Importing an incorrect bundle can lead to unexpected API behavior.
```js
- import Intl from '@ohos.intl'
+ import Intl from '@ohos.intl';
```
2. Instantiate a **DateTimeFormat** object.
@@ -170,7 +170,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug
Importing an incorrect bundle can lead to unexpected API behavior.
```js
- import Intl from '@ohos.intl'
+ import Intl from '@ohos.intl';
```
2. Instantiate a **NumberFormat** object.
@@ -195,7 +195,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug
```js
let options = {compactDisplay: "short", notation: "compact"};
let numberFormat = new Intl.NumberFormat("zh-CN", options);
- let number = 1234.5678
+ let number = 1234.5678;
let formatResult = numberFormat.format(number); // formatResult = "1235"
```
@@ -229,7 +229,7 @@ Users in different regions have different requirements for string sorting. [Coll
Importing an incorrect bundle can lead to unexpected API behavior.
```js
- import Intl from '@ohos.intl'
+ import Intl from '@ohos.intl';
```
2. Instantiate a **Collator** object.
@@ -290,7 +290,7 @@ According to grammars in certain languages, the singular or plural form of a nou
Importing an incorrect bundle can lead to unexpected API behavior.
```js
- import Intl from '@ohos.intl'
+ import Intl from '@ohos.intl';
```
2. Instantiate a **PluralRules** object.
@@ -313,7 +313,7 @@ According to grammars in certain languages, the singular or plural form of a nou
```js
let pluralRules = new Intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"});
- let number = 1234.5678
+ let number = 1234.5678;
let categoryResult = pluralRules.select(number); // categoryResult = "other"
```
@@ -338,7 +338,7 @@ According to grammars in certain languages, the singular or plural form of a nou
Importing an incorrect bundle can lead to unexpected API behavior.
```js
- import Intl from '@ohos.intl'
+ import Intl from '@ohos.intl';
```
2. Instantiate a **RelativeTimeFormat** object.
@@ -362,7 +362,7 @@ According to grammars in certain languages, the singular or plural form of a nou
```js
let relativeTimeFormat = new Intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"});
let number = 2;
- let unit = "year"
+ let unit = "year";
let formatResult = relativeTimeFormat.format(number, unit); // 2 years later
```
@@ -373,7 +373,7 @@ According to grammars in certain languages, the singular or plural form of a nou
```js
let relativeTimeFormat = new Intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"});
let number = 2;
- let unit = "year"
+ let unit = "year";
let formatPartsResult = relativeTimeFormat.formatToParts(number, unit); // formatPartsResult = [{"type": "integer", "value": "2", "unit": "year"}, {"type":"literal", "value": "years later"}]
```
@@ -390,6 +390,6 @@ According to grammars in certain languages, the singular or plural form of a nou
The following sample is provided to help you better understand how to develop internationalization capabilities:
--[`International`: Internationalization (JS) (API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/International)
+-[`International`: Internationalization (JS) (API8)] (https://gitee.com/openharmony/applications_app_samples/tree/OpenHarmony-3.2-Beta5/UI/International)
--[`International`: Internationalization (ArkTS) (API8) (Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/International)
+-[`International`: Internationalization (ArkTS) (API8) (Full SDK)] (https://gitee.com/openharmony/applications_app_samples/tree/OpenHarmony-3.2-Beta5/common/International)
diff --git a/en/application-dev/reference/apis/js-apis-geoLocationManager.md b/en/application-dev/reference/apis/js-apis-geoLocationManager.md
index e102353bf8b19431fab51151c9c634916fa39ff4..67fdc2b0ac3e9cf8a3d0715fb1fdf57e4975d272 100644
--- a/en/application-dev/reference/apis/js-apis-geoLocationManager.md
+++ b/en/application-dev/reference/apis/js-apis-geoLocationManager.md
@@ -506,12 +506,12 @@ For details about the following error codes, see [Location Error Codes](../error
{
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
- action: "action1",
+ action: "action1"
}
],
operationType: wantAgent.OperationType.START_ABILITY,
requestCode: 0,
- wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG],
+ wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
};
wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => {
diff --git a/en/application-dev/reference/apis/js-apis-geolocation.md b/en/application-dev/reference/apis/js-apis-geolocation.md
index 86b62bd76ff14cdd0aaa46d60f532b2b52220e4d..0d7ad63e84d28f26c0b5f071689275fa115e8589 100644
--- a/en/application-dev/reference/apis/js-apis-geolocation.md
+++ b/en/application-dev/reference/apis/js-apis-geolocation.md
@@ -413,7 +413,7 @@ Registers a listener for status change events of the specified geofence.
{
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.MainAbility",
- action: "action1",
+ action: "action1"
}
],
operationType: wantAgent.OperationType.START_ABILITY,
diff --git a/en/application-dev/reference/apis/js-apis-hichecker.md b/en/application-dev/reference/apis/js-apis-hichecker.md
index 3a5687e9ee0b31e29450d72ad7f618a128b30050..7dc240114cbcb7d3b5511f4bd8dd8f884c4cef71 100644
--- a/en/application-dev/reference/apis/js-apis-hichecker.md
+++ b/en/application-dev/reference/apis/js-apis-hichecker.md
@@ -47,11 +47,11 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac
```js
try {
// Add a rule.
- hichecker.addCheckRule(hichecker.RULE_CAUTION_PRINT_LOG);}
+ hichecker.addCheckRule(hichecker.RULE_CAUTION_PRINT_LOG);
// Add multiple rules.
- hichecker.addCheckRule(
- hichecker.RULE_CAUTION_PRINT_LOG | hichecker.RULE_CAUTION_TRIGGER_CRASH);
-catch (err) {
+ // hichecker.addCheckRule(
+ // hichecker.RULE_CAUTION_PRINT_LOG | hichecker.RULE_CAUTION_TRIGGER_CRASH);
+} catch (err) {
console.error(`code: ${err.code}, message: ${err.message}`);
}
```
@@ -77,9 +77,9 @@ try {
// Remove a rule.
hichecker.removeCheckRule(hichecker.RULE_CAUTION_PRINT_LOG);
// Remove multiple rules.
- hichecker.removeCheckRule(
- hichecker.RULE_CAUTION_PRINT_LOG | hichecker.RULE_CAUTION_TRIGGER_CRASH);
-catch (err) {
+ // hichecker.removeCheckRule(
+ // hichecker.RULE_CAUTION_PRINT_LOG | hichecker.RULE_CAUTION_TRIGGER_CRASH);
+} catch (err) {
console.error(`code: ${err.code}, message: ${err.message}`);
}
```
@@ -114,7 +114,7 @@ try {
// Check whether the added rule exists in the collection of added rules.
hichecker.containsCheckRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // return true;
hichecker.containsCheckRule(hichecker.RULE_CAUTION_PRINT_LOG); // return false;
-catch (err) {
+} catch (err) {
console.error(`code: ${err.code}, message: ${err.message}`);
}
```
diff --git a/en/application-dev/reference/apis/js-apis-hidebug.md b/en/application-dev/reference/apis/js-apis-hidebug.md
index 189d855e894451790976eee2c3816cf17ae950b9..364938ddfa2864850a1335cb886f41e3de2c1a9c 100644
--- a/en/application-dev/reference/apis/js-apis-hidebug.md
+++ b/en/application-dev/reference/apis/js-apis-hidebug.md
@@ -297,7 +297,7 @@ import hidebug from '@ohos.hidebug'
try {
hidebug.startJsCpuProfiling("cpu_profiling");
- ...
+ // ...
hidebug.stopJsCpuProfiling();
} catch (error) {
console.info(error.code)
@@ -326,7 +326,7 @@ import hidebug from '@ohos.hidebug'
try {
hidebug.startJsCpuProfiling("cpu_profiling");
- ...
+ // ...
hidebug.stopJsCpuProfiling();
} catch (error) {
console.info(error.code)
diff --git a/en/application-dev/reference/apis/js-apis-i18n.md b/en/application-dev/reference/apis/js-apis-i18n.md
index cda33f5434360fe5ca3f21f9f2c0a04ad5b50474..02cebd741ce26bd61dd4a4282efcf2cc6d89ad08 100644
--- a/en/application-dev/reference/apis/js-apis-i18n.md
+++ b/en/application-dev/reference/apis/js-apis-i18n.md
@@ -1,6 +1,6 @@
# @ohos.i18n (Internationalization)
-The **i18n** module provides system-related or enhanced i18n capabilities, such as locale management, phone number formatting, and calendar, through supplementary i18n APIs that are not defined in ECMA 402.
+ The **i18n** module provides system-related or enhanced i18n capabilities, such as locale management, phone number formatting, and calendar, through supplementary i18n APIs that are not defined in ECMA 402.
The [intl](js-apis-intl.md) module provides basic i18n capabilities through the standard i18n APIs defined in ECMA 402. It works with the i18n module to provide a complete suite of i18n capabilities.
> **NOTE**
@@ -53,7 +53,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let displayCountry = I18n.System.getDisplayCountry("zh-CN", "en-GB"); // displayCountry = "China"
} catch(error) {
- console.error(`call System.getDisplayCountry failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getDisplayCountry failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -92,7 +92,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let displayLanguage = I18n.System.getDisplayLanguage("zh", "en-GB"); // displayLanguage = Chinese
} catch(error) {
- console.error(`call System.getDisplayLanguage failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getDisplayLanguage failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -100,7 +100,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
static getSystemLanguages(): Array<string>
-Obtains the list of system languages.
+Obtains the list of system languages. For details about languages, see [Instantiating the Locale Object](../../internationalization/intl-guidelines.md#how-to-develop).
**System capability**: SystemCapability.Global.I18n
@@ -123,7 +123,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let systemLanguages = I18n.System.getSystemLanguages(); // [ "en-Latn-US", "zh-Hans" ]
} catch(error) {
- console.error(`call System.getSystemLanguages failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getSystemLanguages failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -131,7 +131,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
static getSystemCountries(language: string): Array<string>
-Obtains the list of countries and regions supported for the specified language.
+Obtains the list of countries and regions supported for the specified language. For details about countries or regions, see [Instantiating the Locale Object](../../internationalization/intl-guidelines.md#how-to-develop).
**System capability**: SystemCapability.Global.I18n
@@ -160,7 +160,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let systemCountries = I18n.System.getSystemCountries('zh'); // systemCountries = [ "ZW", "YT", "YE", ..., "ER", "CN", "DE" ], 240 countries or regions in total
} catch(error) {
- console.error(`call System.getSystemCountries failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getSystemCountries failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -198,7 +198,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let res = I18n.System.isSuggested('zh', 'CN'); // res = true
} catch(error) {
- console.error(`call System.isSuggested failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.isSuggested failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -206,7 +206,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
static getSystemLanguage(): string
-Obtains the system language.
+Obtains the system language. For details about languages, see [Instantiating the Locale Object](../../internationalization/intl-guidelines.md#how-to-develop).
**System capability**: SystemCapability.Global.I18n
@@ -229,7 +229,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let systemLanguage = I18n.System.getSystemLanguage(); // systemLanguage indicates the current system language.
} catch(error) {
- console.error(`call System.getSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -264,7 +264,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
I18n.System.setSystemLanguage('zh'); // Set the current system language to zh.
} catch(error) {
- console.error(`call System.setSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.setSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -272,7 +272,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
static getSystemRegion(): string
-Obtains the system region.
+Obtains the system region. For details about system regions, see [Instantiating the Locale Object](../../internationalization/intl-guidelines.md#how-to-develop).
**System capability**: SystemCapability.Global.I18n
@@ -295,7 +295,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let systemRegion = I18n.System.getSystemRegion(); // Obtain the current system region.
} catch(error) {
- console.error(`call System.getSystemRegion failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getSystemRegion failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -330,7 +330,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
I18n.System.setSystemRegion('CN'); // Set the current system region to CN.
} catch(error) {
- console.error(`call System.setSystemRegion failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.setSystemRegion failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -338,7 +338,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
static getSystemLocale(): string
-Obtains the system locale.
+Obtains the system locale. For details about system locales, see [Instantiating the Locale Object](../../internationalization/intl-guidelines.md#how-to-develop).
**System capability**: SystemCapability.Global.I18n
@@ -361,7 +361,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let systemLocale = I18n.System.getSystemLocale(); // Obtain the current system locale.
} catch(error) {
- console.error(`call System.getSystemLocale failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getSystemLocale failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -396,7 +396,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
I18n.System.setSystemLocale('zh-CN'); // Set the current system locale to zh-CN.
} catch(error) {
- console.error(`call System.setSystemLocale failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.setSystemLocale failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -427,7 +427,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let is24HourClock = I18n.System.is24HourClock(); // Check whether the 24-hour clock is enabled.
} catch(error) {
- console.error(`call System.is24HourClock failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.is24HourClock failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -463,7 +463,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
I18n.System.set24HourClock(true);
} catch(error) {
- console.error(`call System.set24HourClock failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.set24HourClock failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -502,7 +502,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
I18n.System.addPreferredLanguage(language, index); // Add zh-CN to the first place in the preferred language list.
} catch(error) {
- console.error(`call System.addPreferredLanguage failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.addPreferredLanguage failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -539,7 +539,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
I18n.System.removePreferredLanguage(index);
} catch(error) {
- console.error(`call System.removePreferredLanguage failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.removePreferredLanguage failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -570,7 +570,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let preferredLanguageList = I18n.System.getPreferredLanguageList(); // Obtain the current preferred language list.
} catch(error) {
- console.error(`call System.getPreferredLanguageList failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getPreferredLanguageList failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -601,7 +601,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let firstPreferredLanguage = I18n.System.getFirstPreferredLanguage(); // Obtain the first language in the preferred language list.
} catch(error) {
- console.error(`call System.getFirstPreferredLanguage failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getFirstPreferredLanguage failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -632,7 +632,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let appPreferredLanguage = I18n.System.getAppPreferredLanguage(); // Obtain the preferred language of an application.
} catch(error) {
- console.error(`call System.getAppPreferredLanguage failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getAppPreferredLanguage failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -640,7 +640,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
static setUsingLocalDigit(flag: boolean): void
-Sets whether to enable the local digit switch.
+Specifies whether to enable use of local digits.
**System API**: This is a system API.
@@ -667,7 +667,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
I18n.System.setUsingLocalDigit(true); // Enable the local digit switch.
} catch(error) {
- console.error(`call System.setUsingLocalDigit failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.setUsingLocalDigit failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -675,7 +675,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
static getUsingLocalDigit(): boolean
-Checks whether the local digit switch is turned on.
+Checks whether use of local digits is enabled.
**System capability**: SystemCapability.Global.I18n
@@ -698,7 +698,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
try {
let status = I18n.System.getUsingLocalDigit(); // Check whether the local digit switch is enabled.
} catch(error) {
- console.error(`call System.getUsingLocalDigit failed, error code: ${error.code}, message: ${error.message}.`)
+ console.error(`call System.getUsingLocalDigit failed, error code: ${error.code}, message: ${error.message}.`);
}
```
@@ -1025,7 +1025,7 @@ Checks whether the specified date in this **Calendar** object is a weekend.
| Name | Type | Mandatory | Description |
| ---- | ---- | ---- | ---------------------------------------- |
-| date | Date | No | Specified date in this **Calendar** object. If this parameter is left unspecified, the system checks whether the current date in the **Calendar** object is a weekend.|
+| date | Date | No | Specified date in this **Calendar** object. If the **date** parameter is not specified, the system checks whether the current date is a weekend.|
**Return value**
diff --git a/en/application-dev/reference/apis/js-apis-intl.md b/en/application-dev/reference/apis/js-apis-intl.md
index d4f3449adae43eed9b19236aec0d0308feed89e8..623695f1cc4c167bd984a408b5c2dde85ff42cf5 100644
--- a/en/application-dev/reference/apis/js-apis-intl.md
+++ b/en/application-dev/reference/apis/js-apis-intl.md
@@ -1,6 +1,6 @@
# @ohos.intl (Internationalization)
-The **intl** module provides basic i18n capabilities, such as time and date formatting, number formatting, and string sorting, through the standard i18n APIs defined in ECMA 402.
+ The **intl** module provides basic i18n capabilities, such as time and date formatting, number formatting, and string sorting, through the standard i18n APIs defined in ECMA 402.
The [i18n](js-apis-i18n.md) module provides enhanced i18n capabilities through supplementary interfaces that are not defined in ECMA 402. It works with the intl module to provide a complete suite of i18n capabilities.
> **NOTE**
@@ -48,9 +48,9 @@ Creates a **Locale** object.
**Example**
```js
// The default constructor uses the current system locale to create a Locale object.
- let locale = new Intl.Locale()
+ let locale = new Intl.Locale();
// Return the current system locale.
- let localeID = locale.toString()
+ let localeID = locale.toString();
```
@@ -72,8 +72,8 @@ Creates a **Locale** object.
**Example**
```js
// Create a Locale object named zh-CN.
- let locale = new Intl.Locale("zh-CN")
- let localeID = locale.toString() // localeID = "zh-CN"
+ let locale = new Intl.Locale("zh-CN");
+ let localeID = locale.toString(); // localeID = "zh-CN"
```
@@ -429,7 +429,7 @@ Obtains the options of the **NumberFormat** object.
// Obtain the options of the NumberFormat object.
let options = numfmt.resolvedOptions();
let style = options.style; // style = decimal
- let notation = options.notation // notation = scientific
+ let notation = options.notation; // notation = scientific
```
@@ -552,7 +552,7 @@ Returns properties reflecting the locale and collation options of a **Collator**
// Obtain the options of the Collator object.
let options = collator.resolvedOptions();
let usage = options.usage; // usage = "sort"
- let ignorePunctuation = options.ignorePunctuation // ignorePunctuation = true
+ let ignorePunctuation = options.ignorePunctuation; // ignorePunctuation = true
```
@@ -631,7 +631,7 @@ Obtains a string that represents the singular-plural type of the specified numbe
| Type | Description |
| ------ | ---------------------------------------- |
-| string | Singular-plural type. The value can be any of the following: **one**, **two**, **few**, **many**, **others**.|
+| string | Singular-plural type. The value can be any of the following: **zero**, **one**, **two**, **few**, **many**, **others**.|
**Example**
```js
diff --git a/en/application-dev/reference/apis/js-apis-resource-manager.md b/en/application-dev/reference/apis/js-apis-resource-manager.md
index 7dc343709c19421175b4f99e6308c1c0ad90e5dd..54cf7cc816d7def45a86a450765c5b23b9ef2a06 100644
--- a/en/application-dev/reference/apis/js-apis-resource-manager.md
+++ b/en/application-dev/reference/apis/js-apis-resource-manager.md
@@ -15,8 +15,8 @@ import resourceManager from '@ohos.resourceManager';
## Instruction
-Since API version 9, the stage model allows an application to obtain a **ResourceManager** object based on **context** and call its resource management APIs without first importing the required bundle. This approach, however, is not applicable to the FA model.
-For details about how to reference **context** in the stage model, see [Context in the Stage Model](../../application-models/application-context-stage.md).
+Since API version 9, the stage model allows an application to obtain a **ResourceManager** object based on **context** and call its resource management APIs without first importing the required bundle. This approach, however, is not applicable to the FA model. For the FA model, you need to import the required bundle and then call the [getResourceManager](#resourcemanagergetresourcemanager) API to obtain a **ResourceManager** object.
+For details about how to reference context in the stage model, see [Context in the Stage Model](../..//application-models/application-context-stage.md).
```ts
import Ability from '@ohos.application.Ability';
@@ -60,6 +60,7 @@ Obtains the **ResourceManager** object of this application. This API uses an asy
});
});
```
+> **NOTE**
In the sample code, **0x1000000** indicates the resource ID, which can be found in the compiled **ResourceTable.txt** file.
## resourceManager.getResourceManager
@@ -116,6 +117,7 @@ Obtains the **ResourceManager** object of this application. This API uses a prom
console.log("error is " + error);
});
```
+> **NOTE**
In the sample code, **0x1000000** indicates the resource ID, which can be found in the compiled **ResourceTable.txt** file.
## resourceManager.getResourceManager
@@ -1767,7 +1769,7 @@ For details about the error codes, see [Resource Manager Error Codes](../errorco
getMediaByName(resName: string, callback: AsyncCallback<Uint8Array>): void
-Obtains the content of the media file corresponding to the specified resource name. This API uses an asynchronous callback to return the result.
+Obtains the content of the media file corresponding to the specified resource ID. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Global.ResourceManager
diff --git a/en/application-dev/reference/apis/js-apis-system-location.md b/en/application-dev/reference/apis/js-apis-system-location.md
index 4f34c5ade9c9721f58ab188320291136e19eba73..70a92d0d5cb32d4a0e2d532fa1e2591cc16af9c4 100644
--- a/en/application-dev/reference/apis/js-apis-system-location.md
+++ b/en/application-dev/reference/apis/js-apis-system-location.md
@@ -68,9 +68,9 @@ export default {
},
fail: function(data, code) {
console.log('fail to get location. code:' + code + ', data:' + data);
- },
+ }
});
- },
+ }
}
```
@@ -181,7 +181,7 @@ Cancels listening to the geographical location.
export default {
unsubscribe() {
geolocation.unsubscribe();
- },
+ }
}
```
diff --git a/en/device-dev/subsystems/subsys-dfx-hisysevent-logging-config.md b/en/device-dev/subsystems/subsys-dfx-hisysevent-logging-config.md
index 9b8204bc76167f4287c9e9f09e8a5a6ebfc9fea1..361ee96986722c76e4a8947cd4c93170ebbd71b2 100644
--- a/en/device-dev/subsystems/subsys-dfx-hisysevent-logging-config.md
+++ b/en/device-dev/subsystems/subsys-dfx-hisysevent-logging-config.md
@@ -30,18 +30,18 @@ Understanding the following concepts would be helpful for you in configuring HiS
| Field| Description|
| ----- | ----- |
- | type | Indicates the type of the event. This field is mandatory.
Value: