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.|