• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2020 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit ArkUI
19 */
20
21/**
22 * @interface LocaleResponse
23 * @syscap SystemCapability.ArkUI.ArkUI.Lite
24 * @since 3
25 */
26/**
27 * @interface LocaleResponse
28 * @syscap SystemCapability.ArkUI.ArkUI.Lite
29 * @atomicservice
30 * @since 12
31 */
32export interface LocaleResponse {
33  /**
34   * Current language of the application. Example: zh.
35   *
36   * @type { string }
37   * @syscap SystemCapability.ArkUI.ArkUI.Lite
38   * @since 3
39   */
40  /**
41   * Current language of the application. Example: zh.
42   *
43   * @type { string }
44   * @syscap SystemCapability.ArkUI.ArkUI.Lite
45   * @atomicservice
46   * @since 12
47   */
48  language: string;
49
50  /**
51   * Country or region. Example: CN.
52   *
53   * @type { string }
54   * @syscap SystemCapability.ArkUI.ArkUI.Lite
55   * @since 3
56   */
57  /**
58   * Country or region. Example: CN.
59   *
60   * @type { string }
61   * @syscap SystemCapability.ArkUI.ArkUI.Lite
62   * @atomicservice
63   * @since 12
64   */
65  countryOrRegion: string;
66
67  /**
68   * Text layout direction. Available values are as follows:
69   * ltr: The text direction is from left to right.
70   * rtl: The text direction is from right to left.
71   *
72   * @type { "ltr" | "rtl" }
73   * @syscap SystemCapability.ArkUI.ArkUI.Lite
74   * @since 3
75   */
76  /**
77   * Text layout direction. Available values are as follows:
78   * ltr: The text direction is from left to right.
79   * rtl: The text direction is from right to left.
80   *
81   * @type { "ltr" | "rtl" }
82   * @syscap SystemCapability.ArkUI.ArkUI.Lite
83   * @atomicservice
84   * @since 12
85   */
86  dir: "ltr" | "rtl";
87}
88
89/**
90 * @syscap SystemCapability.ArkUI.ArkUI.Lite
91 * @since 3
92 */
93/**
94 * @syscap SystemCapability.ArkUI.ArkUI.Lite
95 * @atomicservice
96 * @since 12
97 */
98export default class Configuration {
99  /**
100   * Obtains the current locale of the application, which is the same as the system locale.
101   *
102   * @returns { LocaleResponse }
103   * @syscap SystemCapability.ArkUI.ArkUI.Lite
104   * @since 3
105   */
106  /**
107   * Obtains the current locale of the application, which is the same as the system locale.
108   *
109   * @returns { LocaleResponse }
110   * @syscap SystemCapability.ArkUI.ArkUI.Lite
111   * @atomicservice
112   * @since 12
113   */
114  static getLocale(): LocaleResponse;
115}
116