• Home
Name Date Size #Lines LOC

..--

frameworks/12-May-2024-8,4987,110

interfaces/12-May-2024-5,2734,764

.gitattributesD12-May-2024631 1615

LICENSED12-May-20249.9 KiB177150

NOTICE.htmlD12-May-20242 KiB2212

README.mdD12-May-20242 KiB5032

README_zh.mdD12-May-20241.8 KiB5032

bundle.jsonD12-May-20243.4 KiB110109

README.md

1# i18n<a name="EN-US_TOPIC_0000001101364976"></a>
2
3-   [Introduction](#section11660541593)
4-   [Directory Structure](#section1464106163817)
5-   [Constraints](#section1718733212019)
6-   [Usage](#section894511013511)
7-   [Repositories Involved](#section15583142420413)
8
9## Introduction<a name="section11660541593"></a>
10
11The i18n module provides a wide array of internationalization \(i18n\) APIs for implementing functions such as date and time formatting.
12
13## Directory Structure<a name="section1464106163817"></a>
14
15The directory structure for the i18n module is as follows:
16
17```
18/base/global/
19├── i18n_standard           # Code repository for the i18n framework
20│   ├── frameworks          # Core code of the i18n framework
21│   ├── interfaces          # APIs
22│   │   ├── js              # JavaScript APIs
23│   │   └── native          # Native APIs
24```
25
26## Constraints<a name="section1718733212019"></a>
27
28**Development language**: JavaScript
29
30**Language, script, and country codes**: The supported language must be represented by a two- or three-letter code defined in the ISO 639 standard; the supported script must be represented by a four-letter code defined in the ISO 15924 standard; the supported country must be represented by a two-letter code defined in the ISO 3166 standard.
31
32## Usage<a name="section894511013511"></a>
33
34Change the date and time formats \(such as the sequence of year, month, and day, month and week names, and 12-hour or 24-hour system\) following the system settings to adapt to the cultural habits of users in different locales. For details, see the API reference. The sample code is as follows:
35
36```
37const date = new Date(2021, 11, 17, 3, 24, 0); // Create a Date object containing date and time information.
38fmt = new Intl.DateTimeFormat('en-US') // Create a DateTimeFormat instance.
39console.log(fmt.format(date)); // Format the date and time by using the DateTimeFormat instance.
40```
41
42## Repositories Involved<a name="section15583142420413"></a>
43
44Globalization subsystem
45
46**global\_i18n\_standard**
47
48global\_resmgr\_standard
49
50

README_zh.md

1# 国际化组件<a name="ZH-CN_TOPIC_0000001101364976"></a>
2
3-   [简介](#section11660541593)
4-   [目录](#section1464106163817)
5-   [约束](#section1718733212019)
6-   [说明](#section894511013511)
7-   [相关仓](#section15583142420413)
8
9## 简介<a name="section11660541593"></a>
10
11**国际化组件**提供时间日期格式化等国际化能力。
12
13## 目录<a name="section1464106163817"></a>
14
15国际化组件源代码目录结构如下所示:
16
17```
18/base/global/
19├── i18n_standard           # 国际化框架代码仓
20│   ├── frameworks          # 国际化框架核心代码
21│   ├── interfaces          # 国际化框架接口
22│   │   ├── js              # 国际化框架JavaScript接口
23│   │   └── native          # 国际化框架native接口
24```
25
26## 约束<a name="section1718733212019"></a>
27
28**语言限制**:JavaScript语言
29
30**支持范围限制**:支持的语言符合 ISO 639 标准 2 字母或 3 字母语言码,支持的文本符合 ISO 15924 标准 4 字母文本码,支持的国家符合 ISO 3166 标准 2 字母国家码。
31
32## 说明<a name="section894511013511"></a>
33
34提供时间日期格式化接口,使时间日期格式(如年月日顺序、月份和星期词汇、使用12或24小时制等)跟随系统设置满足不同区域用户的文化习惯。更详细的内容见API文档。示例如下:
35
36```
37const date = new Date(2021, 11, 17, 3, 24, 0);  // 创建包含日期和时间信息的Date对象
38fmt = new Intl.DateTimeFormat('en-US')  // 创建时间日期格式化实例
39console.log(fmt.format(date));  // 使用创建时间日期格式化对象实例进行格式化
40```
41
42## 相关仓<a name="section15583142420413"></a>
43
44全球化子系统
45
46**global\_i18n\_standard**
47
48global\_resmgr\_standard
49
50