Skip to content

Commit 469c9dd

Browse files
authored
Merge develop to master to deploy documentation and fix #1480 and #1481 (#1487)
* Fix registerLanguage() issue in the code examples (#1484) Make code examples check for registered languages before registering new ones * Fix mortgage calculator demo error `Cannot load native addon because loading addons is disabled` (#1486) Migrate mortgage-calculator demo in readme from Codestandbox to Stackblitz
1 parent a2a3e6f commit 469c9dd

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ hf.setCellContents({ sheet: sheetId, row: 0, col: 0 }, [['Monthly Payment', '=PM
9797
console.log(`${hf.getCellValue({ sheet: sheetId, row: 0, col: 0 })}: ${hf.getCellValue({ sheet: sheetId, row: 0, col: 1 })}`);
9898
```
9999

100-
[Run this code in CodeSandbox](https://codesandbox.io/p/sandbox/github/handsontable/hyperformula-demos/tree/3.0.x/mortgage-calculator)
100+
[Run this code in StackBlitz](https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.0.x/mortgage-calculator)
101101

102102
## Contributing
103103

docs/examples/i18n/example1.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ const config = {
6565
licenseKey: 'gpl-v3',
6666
};
6767

68-
HyperFormula.registerLanguage('enUS', enUS);
68+
if (!HyperFormula.getRegisteredLanguagesCodes().includes('enUS')) {
69+
HyperFormula.registerLanguage('enUS', enUS);
70+
}
6971

7072
// Create an empty HyperFormula instance.
7173
const hf = HyperFormula.buildEmpty(config);

docs/examples/i18n/example1.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ const config = {
6767
licenseKey: 'gpl-v3',
6868
};
6969

70-
HyperFormula.registerLanguage('enUS', enUS);
70+
if (!HyperFormula.getRegisteredLanguagesCodes().includes('enUS')) {
71+
HyperFormula.registerLanguage('enUS', enUS);
72+
}
7173

7274
// Create an empty HyperFormula instance.
7375
const hf = HyperFormula.buildEmpty(config);

docs/examples/localizing-functions/example1.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ const tableData = [
2828
];
2929

3030
// register language
31-
HyperFormula.registerLanguage('frFR', frFR);
31+
if (!HyperFormula.getRegisteredLanguagesCodes().includes('frFR')) {
32+
HyperFormula.registerLanguage('frFR', frFR);
33+
}
3234

3335
// Create an empty HyperFormula instance.
3436
const hf = HyperFormula.buildEmpty({

docs/examples/localizing-functions/example1.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const tableData = [
3030
];
3131

3232
// register language
33-
HyperFormula.registerLanguage('frFR', frFR);
33+
if (!HyperFormula.getRegisteredLanguagesCodes().includes('frFR')) {
34+
HyperFormula.registerLanguage('frFR', frFR);
35+
}
3436

3537
// Create an empty HyperFormula instance.
3638
const hf = HyperFormula.buildEmpty({

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ hf.setCellContents({ sheet: sheetId, row: 0, col: 0 }, [['Monthly Payment', '=PM
102102
console.log(`${hf.getCellValue({ sheet: sheetId, row: 0, col: 0 })}: ${hf.getCellValue({ sheet: sheetId, row: 0, col: 1 })}`);
103103
```
104104

105-
[Run this code in CodeSandbox](https://codesandbox.io/p/sandbox/github/handsontable/hyperformula-demos/tree/3.0.x/mortgage-calculator)
105+
[Run this code in StackBlitz](https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.0.x/mortgage-calculator)
106106

107107
## Contributing
108108

0 commit comments

Comments
 (0)