Skip to content

Commit d4f11a6

Browse files
author
dmihaylo
committed
docs: add intial draft review
1 parent e5e3189 commit d4f11a6

File tree

6 files changed

+85
-84
lines changed

6 files changed

+85
-84
lines changed

README.md

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,30 @@
77

88
This repository contains the source code and documentation of the Kendo UI Internationalization package.
99

10-
It includes methods for parsing and formatting dates and numbers using [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) data, which are split into the following modules:
10+
It includes methods for parsing and formatting dates and numbers by using [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) data. These methods are split into the following modules:
1111

12-
* CLDR
13-
* Date Parsing
14-
* Date Formatting
15-
* Number Parsing
16-
* Number Formatting
12+
* [CLDR](#cldr-data)
13+
* [Date Parsing](#date-parsing)
14+
* [Date Formatting](#date-formatting)
15+
* [Number Parsing](#number-parsing)
16+
* [Number Formatting](#number-formatting)
17+
* [General Formatting](#general-formatting)
1718

1819
## Basic Usage
1920

2021
### CLDR Data
2122

22-
The [cldr-data module](https://www.npmjs.com/package/cldr-data) is required in order to download the full CDLR database.
23+
To download the full CDLR database, you need to install the [cldr-data module](https://www.npmjs.com/package/cldr-data) by running the following command.
24+
2325
```sh
2426
npm install --save cldr-data
2527
```
2628

27-
To use the methods for different locales, use the [`load`](https://github.com/telerik/kendo-intl/blob/master/docs/cldr/api.md#load) method to load the `likelySubtags` and locale data. Additionally, the library requires the loading of the supplemental `currencyData` for the default currency formatting and the `weekData` for the day of week formatting.
29+
To apply the methods for different locales, load the `likelySubtags` and the locale data by using the [`load`](https://github.com/telerik/kendo-intl/blob/master/docs/cldr/api.md#load) method.
30+
31+
Additionally, the library requires you to load:
32+
* The supplemental `currencyData` for the default currency formatting.
33+
* The `weekData` for the day of week formatting.
2834

2935
```javascript
3036
import { load } from '@telerik/kendo-intl';
@@ -42,7 +48,7 @@ For more examples and available configuration options, refer to the article on [
4248

4349
### Date Parsing
4450

45-
Date parsing converts a string to a `Date` object using the locale specific settings.
51+
Date parsing converts a string to a `Date` object by using the specific settings of the locale.
4652

4753
```js
4854
import { parseDate } from '@telerik/kendo-intl';
@@ -56,7 +62,7 @@ For more examples and available configuration options, refer to the article on [
5662

5763
### Date Formatting
5864

59-
Date parsing converts a `Date` object to a human-readable string using the locale specific settings.
65+
Date formatting converts a `Date` object to a human-readable string by using the specific settings of the locale.
6066

6167
```js
6268
import { formatDate } from '@telerik/kendo-intl';
@@ -70,7 +76,7 @@ For more examples and available configuration options, refer to the article on [
7076

7177
### Number Parsing
7278

73-
Number parsing converts a string to a `Number` object using the specific settings of the locale.
79+
Number parsing converts a string to a `Number` object by using the specific settings of the locale.
7480

7581
```js
7682
import { parseNumber } from '@telerik/kendo-intl';
@@ -85,7 +91,7 @@ For more examples and available configuration options, refer to the article on [
8591

8692
### Number Formatting
8793

88-
Number formatting converts a `Number` object to a human-readable string using the locale specific settings.
94+
Number formatting converts a `Number` object to a human-readable string using the specific settings of the locale.
8995

9096
```js
9197
import { formatNumber } from '@telerik/kendo-intl';
@@ -107,7 +113,7 @@ For more examples and available configuration options, refer to the article on [
107113

108114
### General Formatting
109115

110-
Provides methods for placeholder and type independent formatting using the locale specific settings.
116+
General formatting provides methods for independent placeholder and type formatting by using the specific settings of the locale.
111117

112118
```js
113119
import { format, toString } from '@telerik/kendo-intl';
@@ -123,27 +129,25 @@ For more examples and available configuration options, refer to the article on [
123129

124130
## Installation
125131

126-
The Internationalization library is published as a [scoped NPM package](https://docs.npmjs.com/misc/scope) in the [NPMJS Telerik account](https://www.npmjs.com/~telerik).
132+
1. The Internationalization library is published as a [scoped NPM package](https://docs.npmjs.com/misc/scope) in the [NPMJS Telerik account](https://www.npmjs.com/~telerik).
127133

128-
Install it using NPM.
129-
130-
```bash
131-
npm install --save '@telerik/kendo-intl';
132-
```
134+
2. Download and install the module:
133135

134-
Once installed, import the module.
136+
```bash
137+
npm install --save '@telerik/kendo-intl';
138+
```
135139

136-
```javascript
137-
// ES2015 module syntax
138-
import { formatDate, parseDate } from '@telerik/kendo-intl';
139-
//or
140-
import { formatNumber, parseNumber } from '@telerik/kendo-intl';
141-
```
142-
```javascript
143-
// CommonJS format
144-
var numbers = require('@telerik/kendo-intl/number').numbers;
145-
//or
146-
var dates = require('@telerik/kendo-intl/dates').dates;
147-
```
140+
3. Once installed, import the Internationalization in your application root module:
148141

149-
> To install the npm package, you use Node.js 5.0.0 or later versions.
142+
```javascript
143+
// ES2015 module syntax
144+
import { formatDate, parseDate } from '@telerik/kendo-intl';
145+
//or
146+
import { formatNumber, parseNumber } from '@telerik/kendo-intl';
147+
```
148+
```javascript
149+
// CommonJS format
150+
var numbers = require('@telerik/kendo-intl/number').numbers;
151+
//or
152+
var dates = require('@telerik/kendo-intl/dates').dates;
153+
```

docs/cldr/api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Loads CLDR data.
2020

2121
##### data `Object`
2222

23-
The CLDR data to be loaded. Multiple parameters are accepted.
23+
The CLDR data to be loaded. Accepts multiple parameters.
2424

2525
### firstDay
2626

@@ -84,7 +84,7 @@ Indicates whether the standalone names should be returned.
8484

8585
The names.
8686

87-
An object will be returned if the type is `"dayPeriods"` or `"eras"`. For the other types, the result is `Array`.
87+
If the type is `"dayPeriods"` or `"eras"`, an object is returned. For the other types, the result is `Array`.
8888

8989
### numberSymbols
9090

@@ -100,4 +100,4 @@ The locale id.
100100

101101
##### Returns `Object`
102102

103-
An object holding the number symbols from the specified locale.
103+
Holds the number symbols from the specified locale.

docs/cldr/index.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,32 @@ position: 1
88

99
# CLDR Data
1010

11-
The Kendo UI Internationalization library uses the [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) as a source for the locale information. To function properly, it requires the data for the corresponding locale to load.
11+
The Kendo UI Internationalization library uses the [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) as a source for the locale information.
1212

13-
The `numbers`, `currencies`, `gregorian calendar`(`"ca-gregorian"`) and `timeZoneNames` for the `en` locale are loaded by default.
14-
Additionally, a subset of the supplemental `currencyData`, `likelySubtags` and `weekData` is loaded in order to support `en` dates and numbers parsing and formatting without loading any data.
13+
In order for it to function properly, load the data for the corresponding locale. By default, the `numbers`, `currencies`, `gregorian calendar`(`"ca-gregorian"`), and `timeZoneNames` for the `en` locale are loaded. To support `en` dates and numbers parsing and formatting without loading any data, a subset of the supplemental `currencyData`, `likelySubtags`, and `weekData` is also loaded.
1514

1615
## Prerequisites
1716

18-
No data is required to be loaded if working with the `en` locale. The only case in which additional data for the `en` locale is required is currency formatting with non-default currency in which case the `cldr-data/main/en/currencies.json` data must be loaded.
19-
The table below lists the data which is required for number and date formatting and parsing when using non-default locale.
17+
If you work with the `en` locale, you do not have to load any data. The only exception refers to the currency formatting with non-default currency. In this case, load the `cldr-data/main/en/currencies.json` data.
2018

21-
| FORMATS | REQUIRED DATA |
22-
|:--- |:--- |
23-
| Any | `cldr/supplemental/likelySubtags.json` |
24-
| Basic numbers | `cldr/main/locale/numbers.json` |
25-
| Currency | `cldr/main/locale/currencies.json` and `cldr/supplemental/currencyData.json` |
26-
| Basic dates | `cldr/main/locale/ca-gregorian.json` |
27-
| Localized timezone | `cldr/main/locale/timeZoneNames.json` |
28-
| Numeric week day formatting | `cldr/supplemental/weekData.json` |
19+
The following table provides the data formats that are required for number and date formatting and parsing when you use a non-default locale.
2920

30-
## Getting CLDR Data
21+
| FORMATS | REQUIRED DATA |
22+
|:--- |:--- |
23+
| Any | `cldr/supplemental/likelySubtags.json` |
24+
| Basic numbers | `cldr/main/locale/numbers.json` |
25+
| Currency | `cldr/main/locale/currencies.json` and `cldr/supplemental/currencyData.json` |
26+
| Basic dates | `cldr/main/locale/ca-gregorian.json` |
27+
| Localized timezone | `cldr/main/locale/timeZoneNames.json` |
28+
| Numeric week day formatting | `cldr/supplemental/weekData.json` |
3129

32-
Unicode CLDR is available as JSON at [https://github.com/unicode-cldr/](https://github.com/unicode-cldr/). For more information on the package organization, refer to [https://github.com/unicode-cldr/cldr-json](https://github.com/unicode-cldr/cldr-json) .
30+
## Getting CLDR Data
3331

34-
It is also available as a single [cldr-data](https://www.npmjs.com/package/cldr-data) package.
32+
Unicode CLDR is available as JSON at [https://github.com/unicode-cldr/](https://github.com/unicode-cldr/). For more information on the package organization, refer to [https://github.com/unicode-cldr/cldr-json](https://github.com/unicode-cldr/cldr-json). It is also available as a single [cldr-data](https://www.npmjs.com/package/cldr-data) package.
3533

3634
## Loading CLDR Data
3735

38-
Load the CLDR data using the [`load`]({% cldrapi_internalization %}#load) method.
36+
To load the CLDR data, use the [`load`]({% cldrapi_internalization %}#load) method.
3937

4038
```
4139
import { cldr, load } from '@telerik/kendo-intl';

docs/date-formatting/index.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ Date formatting converts a `Date` object to a human-readable string using the lo
1414

1515
### Predefined
1616

17-
**The `d` specifier**
17+
* **The `d` specifier**—Renders a short date pattern—`"M/d/y"` for en.
1818

19-
The `"d"` specifier renders a short date pattern—`"M/d/y"` for en.
19+
import { formatDate } from '@telerik/kendo-intl';
2020

21-
import { formatDate } from '@telerik/kendo-intl';
22-
23-
formatDate(new Date(2000, 10, 6), "d"); // 10/6/2000
21+
formatDate(new Date(2000, 10, 6), "d"); // 10/6/2000
2422

2523
**The `D` specifier**
2624

docs/errors.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
---
2-
title: Errors
3-
page_title: Errors | Kendo UI Internationalization Package
4-
description: "List of possible exceptions that the package could throw."
2+
title: List of Errors
3+
page_title: List of Errors | Kendo UI Internationalization
4+
description: "List of possible exceptions that the Internationalization package might throw."
55
slug: errors_internalization_kendoui
6-
position: 7
6+
position: 2
77
---
88

9-
# Errors list
9+
# List of Errors
1010

11-
Below is the list of all controlled errors that could be thrown:
11+
The following table provides the full list of controlled errors that might possibly be thrown by the Internationalization package.
1212

13-
| Type | Message
13+
| TYPE | MESSAGE
1414
|:--- |:---
15-
|`NoLocaleError` | Missing locale info for {locale}.
16-
|`NoCurrencyError` | Cannot determine currency information. Please load the locale currencies data.
17-
|`NoSupplementalCurrencyError` | Cannot determine currency. Please load the supplemental currencyData.
18-
|`NoCurrencyRegionError` | No currency data for region ${territory}.
19-
|`NoCurrencyDisplay` | Cannot determine currency display information. Please load the locale currencies data. The default culture does not include the all currencies data.
20-
|`NoGMTInfoError` | Cannot determine locale GMT format. Please load the locale timeZoneNames data.
21-
|`NoWeekDataError` | Cannot determine locale first day of week. Please load the supplemental weekData.
22-
|`NoFirstDayError` | Cannot determine locale first day of week. The default culture data includes only en-US first day info. Please load the supplemental weekData.
15+
|`NoLocaleError` | Missing locale information for {locale}.
16+
|`NoCurrencyError` | Cannot determine the currency information. Load the currency data of the locale.
17+
|`NoSupplementalCurrencyError` | Cannot determine the currency. Load the supplemental `currencyData`.
18+
|`NoCurrencyRegionError` | Missing currency information for the region ${territory}.
19+
|`NoCurrencyDisplay` | Cannot determine the display information for the currency. Load the currency data of the locale. The default culture does not include all currency data.
20+
|`NoGMTInfoError` | Cannot determine the GMT format of the locale. Load the `timeZoneNames` data of the locale.
21+
|`NoWeekDataError` | Cannot determine the first week day of the locale. Load the supplemental `weekData`.
22+
|`NoFirstDayError` | Cannot determine the first week day of the locale. The default culture data includes only the en-US first day information. Load the supplemental `weekData`.
2323

2424
## Suggested Links
2525

@@ -28,3 +28,4 @@ Below is the list of all controlled errors that could be thrown:
2828
* [Get Started with Date Formatting]({% slug dateformatting_internalization %})
2929
* [Get Started with Number Parsing]({% slug numberparsing_internalization %})
3030
* [Get Started with Number Formatting]({% slug numbeformatting_internalization %})
31+
* [Get Started with General Formatting]({% slug generalformatting_internalization %})

docs/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
---
2-
title: Overview
3-
page_title: Overview | Kendo UI Internationalization Package
4-
description: "Learn the Kendo UI Internationalization methods for parsing and formatting dates and numbers."
2+
title: Internationalization Overview
3+
page_title: Internationalization Overview | Kendo UI Internationalization Package
4+
description: "Learn about the Kendo UI Internationalization methods for parsing and formatting dates and numbers."
55
slug: overview_internalization_kendoui
66
position: 1
77
---
88

99
# Internationalization Package Overview
1010

11-
Internationalization supports the design and development of applications that work in multiple cultures. The culture defines specific information for the number, date and time formats as well as the week and month names.
11+
Internationalization supports the design and development of applications that work in multiple cultures. The culture defines specific information for the number, date, and time formats as well as the week and month names.
1212

13-
The Internationalization package provides methods for parsing and formatting dates and numbers using the [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) data.
13+
The Internationalization provides methods for parsing and formatting dates and numbers using the [Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/) data.
1414

15-
The CLDR module provides locale information for the `dates` and `numbers` modules.
15+
The package includes:
1616

17-
The Date Parsing and Date Formatting modules provide methods for parsing and formatting dates.
18-
19-
The Number Parsing and Number Formatting modules provide methods for parsing and formatting of numbers.
20-
21-
The General Formatting module provides methods for placeholder and type independent formatting.
17+
* **CLDR**—Provides locale information for the `dates` and `numbers` modules.
18+
* **Date Parsing** and **Date Formatting**—Provide methods for parsing and formatting dates.
19+
* **Number Parsing** and **Number Formatting**—Provide methods for parsing and formatting of numbers.
20+
* **General Formatting**—Provides methods for placeholder and type independent formatting.
2221

2322
## Suggested Links
2423

@@ -27,3 +26,4 @@ The General Formatting module provides methods for placeholder and type independ
2726
* [Get Started with Date Formatting]({% slug dateformatting_internalization %})
2827
* [Get Started with Number Parsing]({% slug numberparsing_internalization %})
2928
* [Get Started with Number Formatting]({% slug numbeformatting_internalization %})
29+
* [Get Started with General Formatting]({% slug generalformatting_internalization %})

0 commit comments

Comments
 (0)