未验证 提交 2e59eb68 编写于 作者: O openharmony_ci 提交者: Gitee

!21618 翻译已完成20461+21070+21022+21001+20775+20547+20481

Merge pull request !21618 from shawn_he/20481-d
......@@ -610,8 +610,10 @@ Call [Transliterator](../reference/apis/js-apis-i18n.md#transliterator9) APIs to
Call **transform** to obtain the transliterated string.
```js
let transliterator = I18n.Transliterator.getInstance("Any-Latn"); // Any-Latn means to convert any text to Latn text.
let transformText = transliterator.transform ("Hello"); // transformText = "nǐ hǎo"
let transliterator = I18n.Transliterator.getInstance("Any-Latin"); // Any-Latin means to convert any text to Latin text.
let transformText = transliterator.transform ("你好"); // transformText = "nǐ hǎo"
let transliterator2 = I18n.Transliterator.getInstance("Latin-ASCII"); // Latin-ASCII means to convert Latin text to ASCII text.
let transformText = transliterator2.transform(transformText); // transformText = "ni hao"
```
## Obtaining the Character Type
......@@ -730,3 +732,4 @@ Call [Transliterator](../reference/apis/js-apis-i18n.md#transliterator9) APIs to
```js
let order = I18n.I18NUtil.getDateOrder("zh-CN"); // order = "y-L-d" indicates that the sequence of year, month, and day in Chinese is year-month-day.
```
<!--no_check-->
\ No newline at end of file
......@@ -1757,8 +1757,8 @@ Obtains a list of IDs supported by the **Transliterator** object.
**Example**
```ts
// ids = ["ASCII-Latin", "Accents-Any", "Amharic-Latin/BGN", ...], 671 IDs supported in total
// Each ID consists of two parts separated by a hyphen (-). The format is source-destination.
// A total of 671 IDs are supported. One ID is comprised of two parts separated by a hyphen (-) in the format of source-destination. For example, in **ids = ["Han-Latin","Latin-ASCII", "Amharic-Latin/BGN","Accents-Any", ...]**, **Han-Latin** indicates conversion from Chinese to Latin, and **Amharic-Latin** indicates conversion from Amharic to Latin.
// For more information, see ISO-15924.
let ids = I18n.Transliterator.getAvailableIDs();
```
......
......@@ -16,7 +16,7 @@ import runningLock from '@ohos.runningLock';
isSupported(type: RunningLockType): boolean;
Checks whether the specified type of **RunningLock** is supported. This API uses an asynchronous callback to return the result.
Checks whether the specified type of **RunningLock** is supported.
**System capability:** SystemCapability.PowerManager.PowerManager.Core
......@@ -26,7 +26,7 @@ Checks whether the specified type of **RunningLock** is supported. This API uses
| ------ | ----------------------------------- | ---- | -------------------- |
| type | [RunningLockType](#runninglocktype) | Yes | Type of the **RunningLock** object.|
**Return Value**
**Return value**
| Type | Description |
| ------- | --------------------------------------- |
......@@ -69,14 +69,6 @@ Creates a **RunningLock** object.
| type | [RunningLockType](#runninglocktype) | Yes | Type of the **RunningLock** object to be created. |
| callback | AsyncCallback<[RunningLock](#runninglock)> | Yes | Callback used to return the result. If a lock is successfully created, **err** is **undefined** and **data** is the created **RunningLock**. Otherwise, **err** is an error object.|
**Error codes**
For details about the error codes, see [RunningLock Error Codes](../errorcodes/errorcode-runninglock.md).
| ID | Error Message |
|---------|----------|
| 4900101 | If connecting to the service failed. |
**Example**
```js
......@@ -106,20 +98,12 @@ Creates a **RunningLock** object.
| name | string | Yes | Name of the **RunningLock** object. |
| type | [RunningLockType](#runninglocktype) | Yes | Type of the **RunningLock** object to be created.|
**Return Value**
**Return value**
| Type | Description |
| ------------------------------------------ | ------------------------------------ |
| Promise&lt;[RunningLock](#runninglock)&gt; | Promise used to return the result.|
**Error codes**
For details about the error codes, see [RunningLock Error Codes](../errorcodes/errorcode-runninglock.md).
| ID | Error Message |
|---------|----------|
| 4900101 | If connecting to the service failed. |
**Example**
```js
......@@ -138,7 +122,7 @@ isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback&lt;boo
> **NOTE**<br>This API is deprecated since API version 9. You are advised to use [runningLock.isSupported](#runninglockissupported9).
Checks whether the specified type of **RunningLock** is supported. This API uses an asynchronous callback to return the result. This API uses an asynchronous callback to return the result.
Checks whether the specified type of **RunningLock** is supported. This API uses an asynchronous callback to return the result.
**System capability:** SystemCapability.PowerManager.PowerManager.Core
......@@ -167,7 +151,7 @@ isRunningLockTypeSupported(type: RunningLockType): Promise&lt;boolean>
> **NOTE**<br>This API is deprecated since API version 9. You are advised to use [runningLock.isSupported](#runninglockissupported9).
Checks whether the specified type of **RunningLock** is supported. This API uses an asynchronous callback to return the result. This API uses a promise to return the result.
Checks whether the specified type of **RunningLock** is supported. This API uses a promise to return the result.
**System capability:** SystemCapability.PowerManager.PowerManager.Core
......@@ -177,7 +161,7 @@ Checks whether the specified type of **RunningLock** is supported. This API uses
| ------ | ----------------------------------- | ---- | -------------------- |
| type | [RunningLockType](#runninglocktype) | Yes | Type of the **RunningLock** object.|
**Return Value**
**Return value**
| Type | Description |
| ---------------------- | ---------------------------------------------------- |
......@@ -246,7 +230,7 @@ Creates a **RunningLock** object.
| name | string | Yes | Name of the **RunningLock** object. |
| type | [RunningLockType](#runninglocktype) | Yes | Type of the **RunningLock** object to be created.|
**Return Value**
**Return value**
| Type | Description |
| ------------------------------------------ | ------------------------------------ |
......@@ -354,7 +338,7 @@ Checks the hold status of the **Runninglock** object.
**System capability:** SystemCapability.PowerManager.PowerManager.Core
**Return Value**
**Return value**
| Type | Description |
| ------- | ------------------------------------------------------------ |
......@@ -452,7 +436,7 @@ Checks the hold status of the **Runninglock** object.
**System capability:** SystemCapability.PowerManager.PowerManager.Core
**Return Value**
**Return value**
| Type | Description |
| ------- | ------------------------------------------------------------ |
| boolean | The value **true** indicates that the **Runninglock** object is held; and the value **false** indicates that the **Runninglock** object is released.|
......@@ -476,7 +460,7 @@ Enumerates the types of **RunningLock** objects.
**System capability:** SystemCapability.PowerManager.PowerManager.Core
| Name | Value | Description |
| --------------------------------- | ---- | ------------------------------------------------------------ |
| BACKGROUND<sup>(deprecated)</sup> | 1 | A lock that prevents the system from hibernating when the screen is off.<br>**NOTE**<br>This parameter is supported since API version 7 and deprecated since API version 10.|
| PROXIMITY_SCREEN_CONTROL | 2 | A lock that determines whether to turn on or off the screen based on the distance away from the screen. |
| Name | Value | Description |
| ------------------------ | ---- | -------------------------------------- |
| BACKGROUND | 1 | A lock that prevents the system from hibernating when the screen is off. |
| PROXIMITY_SCREEN_CONTROL | 2 | A lock that determines whether to turn on or off the screen based on the distance away from the screen.|
......@@ -280,7 +280,6 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
let devicesList = usb.getDevices();
if (devicesList.length == 0) {
console.log(`device list is empty`);
return;
}
let device = devicesList[0];
......@@ -320,7 +319,6 @@ Before you do this, ensure that you have claimed the interface by calling [usb.c
let devicesList = usb.getDevices();
if (devicesList.length == 0) {
console.log(`device list is empty`);
return;
}
let device = devicesList[0];
......@@ -361,7 +359,6 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
let devicesList = usb.getDevices();
if (devicesList.length == 0) {
console.log(`device list is empty`);
return;
}
let device = devicesList[0];
......@@ -401,7 +398,6 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
let devicesList = usb.getDevices();
if (devicesList.length == 0) {
console.log(`device list is empty`);
return;
}
let device = devicesList[0];
......@@ -441,7 +437,6 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
let devicesList = usb.getDevices();
if (devicesList.length == 0) {
console.log(`device list is empty`);
return;
}
usb.requestRight(devicesList[0].name);
......@@ -477,7 +472,6 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
let devicesList = usb.getDevices();
if (devicesList.length == 0) {
console.log(`device list is empty`);
return;
}
usb.requestRight(devicesList[0].name);
......@@ -524,14 +518,13 @@ let param = {
let devicesList = usb.getDevices();
if (devicesList.length == 0) {
console.log(`device list is empty`);
return;
}
usb.requestRight(devicesList[0].name);
let devicepipe = usb.connectDevice(devicesList[0]);
usb.controlTransfer(devicepipe, param).then((ret) => {
console.log(`controlTransfer = ${ret}`);
})
});
```
## usb.bulkTransfer
......@@ -568,7 +561,6 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
let devicesList = usb.getDevices();
if (devicesList.length == 0) {
console.log(`device list is empty`);
return;
}
let device = devicesList[0];
......@@ -612,7 +604,6 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
let devicesList = usb.getDevices();
if (devicesList.length == 0) {
console.log(`device list is empty`);
return;
}
usb.requestRight(devicesList[0].name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册