提交 f8ca38cb 编写于 作者: S sunyaozu

fix getLocale docs

Signed-off-by: Nsunyaozu <sunyaozu@huawei.com>
上级 a552c48e
......@@ -17,29 +17,37 @@ import configuration from '@system.configuration';
## configuration.getLocale
getLocale(): &lt;LocaleResponse&gt;
getLocale(): LocaleResponse
获取应用当前的语言和地区。默认与系统的语言和地区同步。
**系统能力:** SystemCapability.ArkUI.ArkUI.Lite
**返回值:**
**表1** LocaleResponse
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| language | string | 语言。例如:zh。 |
| countryOrRegion | string | 国家或地区。例如:CN。 |
| dir | string | 文字布局方向。取值范围:<br/>-&nbsp;ltr:从左到右;<br/>-&nbsp;rtl:从右到左。 |
| unicodeSetting<sup>5+</sup> | string | 语言环境定义的Unicode语言环境键集,如果此语言环境没有特定键集,则返回空集。<br/>例如:{"nu":"arab"},表示当前环境下的数字采用阿拉伯语的数字。 |
| 类型 | 说明 |
| -------------- | ------------- |
| LocaleResponse | 应用当前Locale相关信息。 |
**示例:**
```
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
表示应用当前Locale的属性。
**系统能力**:以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Lite
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ---- | ------ | ---- | ---- | ---------------------------------------- |
| language | string | 是 | 否 | 语言。例如:zh。 |
| countryOrRegion | string | 是 | 否 | 国家或地区。例如:CN。 |
| dir | string | 是 | 否 | 文字布局方向。取值范围:<br/>-&nbsp;ltr:从左到右;<br/>-&nbsp;rtl:从右到左。 |
| unicodeSetting<sup>5+</sup> | string | 是 | 否 | 语言环境定义的Unicode语言环境键集,如果此语言环境没有特定键集,则返回空集。<br/>例如:{"nu":"arab"},表示当前环境下的数字采用阿拉伯语的数字。 |
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册