Skip to content

Commit 788347c

Browse files
Jakub Wiśniewskisequba
andauthored
Docs: Edit 2.2.0 docs (#1099)
* Edit changelog and release notes * Edit the Internationalization overview guide * Edit the File import guide * Rename i18n-overview to i18n-features * Rename importing-files -> file-import guide Co-authored-by: Kuba Sekowski <jakub.sekowski@handsontable.com>
1 parent 96fd74d commit 788347c

File tree

12 files changed

+157
-160
lines changed

12 files changed

+157
-160
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
## [2.2.0] - 2022-11-17
1010

1111
### Added
12-
- Added American English (`enUS`) language pack. This is a convenience alias, since the function names provided by it are identical to the ones in the existing British English (`enGB`) language pack. [#1025](https://github.com/handsontable/hyperformula/issues/1025)
12+
- Added an American English (`enUS`) language pack. It's a convenience alias: it contains the same translations as the existing British English (`enGB`) language pack. [#1025](https://github.com/handsontable/hyperformula/issues/1025)
1313

1414
### Fixed
15-
- Fixed functions VLOOKUP and HLOOKUP to handle duplicates according to the specification. [#1072](https://github.com/handsontable/hyperformula/issues/1072)
16-
- Fixed function MATCH to handle ranges ordered descending according to the specification. [#1063](https://github.com/handsontable/hyperformula/issues/1063)
15+
- Fixed functions VLOOKUP and HLOOKUP to handle duplicates in the way specified by the [OpenDocument](https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html#HLOOKUP) standard. [#1072](https://github.com/handsontable/hyperformula/issues/1072)
16+
- Fixed the MATCH function to handle descending ranges in the way specified by the [OpenDocument](https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html#MATCH) standard. [#1063](https://github.com/handsontable/hyperformula/issues/1063)
1717

1818
## [2.1.0] - 2022-09-08
1919

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
HyperFormula is a headless spreadsheet built on top of TypeScript. It is a parser and evaluator of Excel formulas for web applications. You can use it in a browser or as a service, with Node.js as your back-end technology.
2727
- High-speed Excel formula parsing and evaluating
28-
- A library of [380+ built-in functions](https://hyperformula.handsontable.com/guide/built-in-functions.html)
29-
- Support for [internationalization](https://hyperformula.handsontable.com/guide/i18n-overview.html) with 17 built-in languages
28+
- A library of nearly [400 built-in functions](https://hyperformula.handsontable.com/guide/built-in-functions.html)
29+
- Support for [internationalization](https://hyperformula.handsontable.com/guide/i18n-features.html) with 17 built-in languages
3030
- Support for [custom functions](https://hyperformula.handsontable.com/guide/custom-functions.html)
3131
- Function syntax compatible with [Microsoft Excel](https://hyperformula.handsontable.com/guide/compatibility-with-microsoft-excel.html) and [Google Sheets](https://hyperformula.handsontable.com/guide/compatibility-with-google-sheets.html)
3232
- [Support for Node.js](https://hyperformula.handsontable.com/guide/server-side-installation.html#install-with-npm-or-yarn)

docs/.vuepress/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ module.exports = {
203203
title: 'Internationalization',
204204
collapsable: false,
205205
children: [
206-
['/guide/i18n-overview', 'Internationalization overview'],
206+
['/guide/i18n-features', 'Internationalization features'],
207207
['/guide/localizing-functions', 'Localizing functions'],
208208
['/guide/date-and-time-handling', 'Date and time handling'],
209209
]
@@ -227,7 +227,7 @@ module.exports = {
227227
['/guide/custom-functions', 'Custom functions'],
228228
['/guide/performance', 'Performance'],
229229
['/guide/known-limitations', 'Known limitations'],
230-
['/guide/importing-files', 'Importing XLSX/CSV files'],
230+
['/guide/file-import', 'File import'],
231231
]
232232
},
233233
{

docs/guide/built-in-functions.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,11 @@ The latest version of HyperFormula has an extensive collection of **{{ $page.fun
2828
_Some categories such as compatibility, cube, and database
2929
are yet to be supported._
3030

31-
## Language packs
31+
## Internationalization
3232

33-
HyperFormula provides translation packs for 16 languages thus making
34-
it easier to create localized applications. The supported languages
35-
are: English (default), Czech, Danish, Dutch, Finnish, French,
36-
German, Hungarian, Italian, Norwegian, Polish, Portuguese, Russian,
37-
Spanish, Swedish, and Turkish.
33+
Each of HyperFormula's built-in function names (and [errors](types-of-errors.md)) is available in [17 language versions](localizing-functions.md#list-of-supported-languages).
3834

39-
The package includes localization of function names and error values
40-
(such as #REF! or #NAME!). To support more languages or properties
41-
create your own [custom language pack](localizing-functions).
35+
To support more languages or properties, create a [custom language pack](localizing-functions).
4236

4337
## Custom functions
4438

docs/guide/compatibility-with-google-sheets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Related options:
6666

6767
### Date and time formats
6868

69-
In Google Sheets, date and time formats depend on the spreadsheet's configured locale and are [shared across all users](https://support.google.com/docs/answer/58515), whereas in HyperFormula you can [set them up freely](date-and-time-handling.md).
69+
In Google Sheets, date and time formats depend on the spreadsheet's locale and are [shared across all users](https://support.google.com/docs/answer/58515), whereas in HyperFormula you can [set them up freely](date-and-time-handling.md).
7070

7171
Options related to date and time formats:
7272
- [`dateFormats`](../api/interfaces/configparams.md#dateformats)

docs/guide/date-and-time-handling.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,21 @@ The formats for the default date and time parsing functions can be set using con
77

88
## Example
99

10-
By default, HyperFormula uses European date and time format configuration:
10+
By default, HyperFormula uses the European date and time formats.
1111

1212
```javascript
13-
const options = {
14-
dateFormats: ['DD/MM/YYYY', 'DD/MM/YY'], // set by default
15-
timeFormats: ['hh:mm', 'hh:mm:ss.sss'], // set by default
16-
};
13+
dateFormats: ['DD/MM/YYYY', 'DD/MM/YY'], // set by default
14+
timeFormats: ['hh:mm', 'hh:mm:ss.sss'], // set by default
1715
```
1816

19-
To use the formats popular in the USA, set:
17+
To use the US date and time formats, set:
2018

2119
```javascript
22-
const options = {
23-
dateFormats: ['MM/DD/YYYY', 'MM/DD/YY', 'YYYY/MM/DD'], // date formats used in the USA
24-
timeFormats: ['hh:mm', 'hh:mm:ss.sss'], // set by default
25-
};
20+
dateFormats: ['MM/DD/YYYY', 'MM/DD/YY', 'YYYY/MM/DD'], // US date formats
21+
timeFormats: ['hh:mm', 'hh:mm:ss.sss'], // set by default
2622
```
2723

28-
## Custom functions for handling date and time
24+
## Custom date and time handling
2925

3026
HyperFormula offers the possibility to extend the number of supported
3127
date/time formats as well as the behavior of this functionality by exposing
@@ -45,8 +41,8 @@ library like [Moment.js](https://momentjs.com/), or by writing your
4541
own custom function that returns a [`DateTime`](../api/globals.md#datetime) object.
4642

4743
The configuration of date formats and stringify options may impact some built-in functions.
48-
For instance, `VALUE` function transforms strings
49-
into numbers, which means it uses [`parseDateTime`](../api/interfaces/configparams.md#parsedatetime). `TEXT` function
44+
For instance, the `VALUE` function transforms strings
45+
into numbers, which means it uses [`parseDateTime`](../api/interfaces/configparams.md#parsedatetime). The `TEXT` function
5046
works the other way round - it accepts a number and returns a string,
5147
so it uses `stringifyDateTime`. Any change here might give you
5248
different results. Criteria-based functions (`SUMIF`, `AVERAGEIF`, etc.) perform comparisons, so they also need to
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
# Importing XLSX/CSV files into HyperFormula
1+
# File import
22

3-
Use HyperFormula to calculate the formulas exported from other spreadsheets.
3+
Import XLSX and CSV files into HyperFormula.
44

55
## Overview
66

7-
HyperFormula itself has no file import functionality. Rather, the [factory methods](../api/classes/hyperformula.md#factories) use standard JavaScript data types for easy integration with any data importing solution.
7+
HyperFormula has no built-in file import functionality. But its [factory methods](../api/classes/hyperformula.md#factories) use standard JavaScript data types, for easy integration with any way of importing data.
88

9-
If you want to work with XLSX or CSV files, you can decide to use one of the [file parsing libraries](https://www.npmjs.com/search?q=xlsx) and then pass the result to HyperFormula as a JavaScript array.
10-
Popular choices include [ExcelJS](https://www.npmjs.com/package/exceljs) or [xlsx](https://www.npmjs.com/package/xlsx) packages for the XLSX file format, and [PapaParse](https://www.npmjs.com/package/papaparse) or [csv-parse](https://www.npmjs.com/package/csv-parse) for the CSV file format.
9+
## Import CSV files
1110

12-
## Example: Importing XLSX files into HyperFormula in Node
11+
To import CSV files, use a third-party [CSV parser](https://www.npmjs.com/search?q=csv) (e.g., [PapaParse](https://www.npmjs.com/package/papaparse) or [csv-parse](https://www.npmjs.com/package/csv-parse)). Then pass the result to HyperFormula as a JavaScript array.
1312

14-
This example uses [ExcelJS](https://www.npmjs.com/package/exceljs), but the same feature can be implemented with any other XLSX parsing library.
13+
## Import XLSX files
1514

16-
::: tip
17-
The full source code for this example is available on [GitHub](https://github.com/handsontable/hyperformula-demos/tree/2.2.x/read-excel-file)
18-
:::
15+
To import XLSX files, use a third-party [XLSX parser](https://www.npmjs.com/search?q=xlsx) (e.g., [ExcelJS](https://www.npmjs.com/package/exceljs) or [xlsx](https://www.npmjs.com/package/xlsx)). Then pass the result to HyperFormula as a JavaScript array.
16+
17+
### Example: Import XLSX files in Node
18+
19+
This example uses [ExcelJS](https://www.npmjs.com/package/exceljs) to import XLSX files into HyperFormula.
20+
21+
See full example on [GitHub](https://github.com/handsontable/hyperformula-demos/tree/2.2.x/read-excel-file).
1922

2023
```js
2124
const ExcelJS = require('exceljs');

docs/guide/i18n-features.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Internationalization features
2+
3+
Configure HyperFormula to match the languages and regions of your users.
4+
5+
**Contents:**
6+
[[toc]]
7+
8+
## Function names and errors
9+
10+
Each of HyperFormula's [built-in functions](built-in-functions.md) and [errors](types-of-errors.md) is available in [17 languages](localizing-functions.md#list-of-supported-languages).
11+
12+
You can easily [switch between languages](localizing-functions.md) ([`language`](../api/interfaces/configparams.md#language)).
13+
14+
When adding a [custom function](custom-functions.md), you can define the function's [name](custom-functions.md#_3-add-your-function-s-names) in every language that you support.
15+
16+
To support more languages, add a [custom language pack](localizing-functions.md).
17+
18+
## Date and time formats
19+
20+
To match a region's calendar conventions, you can set multiple date formats ([`dateFormats`](../api/interfaces/configparams.md#dateformats)) and time formats ([`timeFormats`](../api/interfaces/configparams.md#timeformats)).
21+
22+
By default, HyperFormula uses the European date and time formats. [You can easily change them](date-and-time-handling.md#example).
23+
24+
You can also add custom ways of [handling dates and times](date-and-time-handling.md#custom-date-and-time-handling).
25+
26+
## Number format
27+
28+
To match a region's number format, configure HyperFormula's decimal separator ([`decimalSeparator`](../api/interfaces/configparams.md#decimalseparator)) and thousands separator ([`thousandSeparator`](../api/interfaces/configparams.md#thousandseparator)).
29+
30+
By default, HyperFormula uses the European number format (`1000000.00`):
31+
32+
```js
33+
decimalSeparator: '.', // set by default
34+
thousandSeparator: '', // set by default
35+
```
36+
37+
To use the US number format (`1,000,000.00`), set:
38+
39+
```js
40+
decimalSeparator: '.', // set by default
41+
thousandSeparator: ',',
42+
```
43+
44+
::: tip
45+
In HyperFormula, both [`decimalSeparator`](../api/interfaces/configparams.md#decimalseparator) and [`thousandSeparator`](../api/interfaces/configparams.md#thousandseparator) must be different from [`functionArgSeparator`](../api/interfaces/configparams.md#functionargseparator).
46+
In some cases it might cause compatibility issues with other spreadsheets, e.g., [Microsoft Excel](compatibility-with-microsoft-excel.md#separators) or [Google Sheets](compatibility-with-google-sheets.md#separators).
47+
:::
48+
49+
## Currency symbol
50+
51+
To match your users' currency, you can configure multiple currency symbols ([`currencySymbol`](../api/interfaces/configparams.md#currencysymbol)).
52+
53+
The default currency symbol is `$`. To add `USD` as an alternative, set:
54+
55+
```js
56+
currencySymbol: ['$', 'USD'],
57+
```
58+
59+
## String comparison rules
60+
61+
To make sure that language-sensitive strings are compared in line with your users' language (e.g., `Préservation` vs. `Preservation`), set HyperFormula's [string comparison rules](types-of-operators.md#comparing-strings) ([`localeLang`](../api/interfaces/configparams.md#localelang)).
62+
63+
The value of [`localeLang`](../api/interfaces/configparams.md#localelang) is processed by [`Intl.Collator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), a JavaScript standard object.
64+
65+
The default setting is:
66+
67+
```js
68+
localeLang: 'en', // set by default
69+
```
70+
71+
To set the `en-US` string comparison rules, set:
72+
73+
```js
74+
localeLang: 'en-US',
75+
```
76+
77+
To further customize string comparison rules, use these options:
78+
- [`caseSensitive`](../api/interfaces/configparams.md#casesensitive)
79+
- [`accentSensitive`](../api/interfaces/configparams.md#accentsensitive)
80+
- [`caseFirst`](../api/interfaces/configparams.md#casefirst)
81+
- [`ignorePunctuation`](../api/interfaces/configparams.md#ignorepunctuation)
82+
83+
## Compatibility with other spreadsheet software
84+
85+
For information on compatibility with locale-dependent syntax in other spreadsheet software, see:
86+
- [Compatibility with Microsoft Excel](compatibility-with-microsoft-excel.md)
87+
- [Compatibility with Google Sheets](compatibility-with-google-sheets.md)
88+
89+
## `en-US` configuration
90+
91+
This configuration aligns HyperFormula with the `en-US` locale. Due to the configuration of [separators](#number-format), it might not be fully compatible with formulas coming from other spreadsheet software.
92+
93+
```js
94+
language: 'enUS',
95+
dateFormats: ['MM/DD/YYYY', 'MM/DD/YY', 'YYYY/MM/DD'],
96+
timeFormats: ['hh:mm', 'hh:mm:ss.sss'], // set by default
97+
decimalSeparator: '.', // set by default
98+
thousandSeparator: ',',
99+
functionArgSeparator: ';', // might cause incompatibility with other spreadsheets
100+
currencySymbol: ['$', 'USD'],
101+
localeLang: 'en-US',
102+
```
103+
104+
## `en-US` demo
105+
106+
This demo shows HyperFormula configured for the `en-US` locale.
107+
108+
<iframe
109+
src="https://codesandbox.io/embed/github/handsontable/hyperformula-demos/tree/2.2.x/i18n?autoresize=1&fontsize=11&hidenavigation=1&theme=light&view=preview"
110+
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
111+
title="handsontable/hyperformula-demos: basic-operations"
112+
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
113+
sandbox="allow-autoplay allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts">
114+
</iframe>

docs/guide/i18n-overview.md

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)