@betteroffice/xlsx-i18n 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,58 +1,53 @@
1
1
  # @betteroffice/xlsx-i18n
2
2
 
3
- Shared locale strings, types, and runtime helpers for the [BetterOffice XLSX editor](https://betteroffice.dev) React adapter.
3
+ UI locale strings, types, and runtime helpers for the
4
+ [`@betteroffice/xlsx-react`](https://www.npmjs.com/package/@betteroffice/xlsx-react)
5
+ editor. `en` is the source of truth; community locales mirror its shape and fall
6
+ back to English for any untranslated key.
4
7
 
5
- ## Quick Start
8
+ > **Early (`0.0.x`).** The core surfaces — opening/saving documents, the editor
9
+ > components, collaboration — are settling and unlikely to change shape. Smaller
10
+ > APIs may still move between releases; breaking changes are always listed in
11
+ > the changelog.
6
12
 
7
13
  ```bash
8
- npm install @betteroffice/xlsx-i18n
14
+ bun add @betteroffice/xlsx-i18n
9
15
  ```
10
16
 
17
+ ## Usage
18
+
11
19
  Pass a typed locale to the editor's `i18n` prop:
12
20
 
13
21
  ```tsx
14
22
  import { de } from '@betteroffice/xlsx-i18n';
15
23
  import { XlsxEditor } from '@betteroffice/xlsx-react';
16
24
 
17
- <XlsxEditor file={file} i18n={de} />
25
+ <XlsxEditor file={file} i18n={de} />;
18
26
  ```
19
27
 
20
- Keys set to `null` fall back to English.
28
+ Keys set to `null` in any locale fall back to English.
21
29
 
22
- ## Available locales
30
+ ## Locales
23
31
 
24
- | Code | Export | Language |
25
- | --- | --- | --- |
26
- | `en` | `en` | English |
27
- | `de` | `de` | German |
28
- | `fr` | `fr` | French |
29
- | `he` | `he` | Hebrew |
30
- | `hi` | `hi` | Hindi |
31
- | `id` | `id` | Indonesian |
32
- | `pl` | `pl` | Polish |
33
- | `pt-BR` | `ptBR` | Portuguese (Brazil) |
34
- | `tr` | `tr` | Turkish |
35
- | `zh-CN` | `zhCN` | Simplified Chinese |
32
+ `en` (source), `de`, `fr`, `he`, `hi`, `id`, `pl`, `pt-BR`, `tr`, `zh-CN`.
33
+ BCP-47 tags use camelCase identifiers (`ptBR`, `zhCN`).
36
34
 
37
- For runtime lookup, import `locales`. To keep bundles smaller, import a single locale from a per-locale subpath:
38
-
39
- ```ts
40
- import pl from '@betteroffice/xlsx-i18n/pl';
41
- ```
35
+ Each locale also ships as its own subpath (`@betteroffice/xlsx-i18n/pl`) so an
36
+ app that picks the locale at runtime can code-split rather than bundle them all.
37
+ For lookup by tag, `import { locales } from '@betteroffice/xlsx-i18n'` (pulls
38
+ every locale into the bundle).
42
39
 
43
40
  ## Types and helpers
44
41
 
45
- The package exports `LocaleStrings`, `PartialLocaleStrings`, `Translations`, `TranslationKey`, `LocaleCode`, `TFunction`, `createT`, and `deepMerge`.
42
+ The package exports `LocaleStrings`, `PartialLocaleStrings`, `Translations`,
43
+ `TranslationKey`, `LocaleCode`, `TFunction`, `createT`, and `deepMerge`. For
44
+ non-React hosts, build a typed `t()` directly:
46
45
 
47
46
  ```ts
48
47
  import { createT, deepMerge, en, de, type LocaleStrings } from '@betteroffice/xlsx-i18n';
49
48
 
50
- const strings = deepMerge(en, de) as LocaleStrings;
51
- const t = createT(strings, 'de');
49
+ const t = createT(deepMerge(en, de) as LocaleStrings, 'de');
52
50
  t('toolbar.save');
53
51
  ```
54
52
 
55
- ## Commercial Support
56
-
57
- > [!TIP]
58
- > Questions or feature requests? Open an issue at **[github.com/openooxml/betteroffice](https://github.com/openooxml/betteroffice/issues)**.
53
+ Docs: https://betteroffice.dev · Apache-2.0.
package/dist/en.mjs CHANGED
@@ -5,6 +5,97 @@ var en_default = {
5
5
  actionsLabel: "Spreadsheet actions",
6
6
  fileActionsLabel: "File actions",
7
7
  historyLabel: "History",
8
+ searchMenus: "Search menus",
9
+ print: "Print",
10
+ paintFormat: "Paint format",
11
+ zoom: "Zoom",
12
+ zoomValue: "Zoom: {value}",
13
+ currency: "Format as currency",
14
+ currencySymbol: "$",
15
+ percent: "Format as percent",
16
+ decreaseDecimal: "Decrease decimal places",
17
+ increaseDecimal: "Increase decimal places",
18
+ moreNumberFormats: "More number formats",
19
+ fontFamily: "Font family",
20
+ fontSize: "Font size",
21
+ decreaseFontSize: "Decrease font size",
22
+ increaseFontSize: "Increase font size",
23
+ bold: "Bold",
24
+ italic: "Italic",
25
+ strikethrough: "Strikethrough",
26
+ textColor: "Text color",
27
+ fillColor: "Fill color",
28
+ borders: "Borders",
29
+ borderColor: "Border color",
30
+ mergeCells: "Merge cells",
31
+ horizontalAlignment: "Horizontal alignment",
32
+ verticalAlignment: "Vertical alignment",
33
+ textWrapping: "Text wrapping",
34
+ more: "More toolbar items",
35
+ groups: {
36
+ search: "Search",
37
+ history: "History",
38
+ print: "Print",
39
+ paintFormat: "Paint format",
40
+ zoom: "Zoom",
41
+ number: "Number formats",
42
+ font: "Font",
43
+ text: "Text formatting",
44
+ colors: "Colors",
45
+ borders: "Borders",
46
+ merge: "Merge cells",
47
+ alignment: "Alignment"
48
+ },
49
+ numberFormats: {
50
+ automatic: "Automatic",
51
+ plainText: "Plain text",
52
+ number: "Number",
53
+ percent: "Percent",
54
+ scientific: "Scientific",
55
+ currency: "Currency",
56
+ date: "Date",
57
+ time: "Time",
58
+ custom: "Custom number format…"
59
+ },
60
+ borderPresets: {
61
+ all: "All borders",
62
+ inner: "Inner borders",
63
+ horizontal: "Horizontal borders",
64
+ vertical: "Vertical borders",
65
+ outer: "Outer borders",
66
+ left: "Left border",
67
+ top: "Top border",
68
+ right: "Right border",
69
+ bottom: "Bottom border",
70
+ none: "Clear borders"
71
+ },
72
+ borderStyles: {
73
+ solid: "Solid border",
74
+ dashed: "Dashed border",
75
+ dotted: "Dotted border",
76
+ double: "Double border"
77
+ },
78
+ merge: {
79
+ all: "Merge all",
80
+ horizontal: "Merge horizontally",
81
+ vertical: "Merge vertically",
82
+ unmerge: "Unmerge"
83
+ },
84
+ horizontalAlign: {
85
+ left: "Left",
86
+ center: "Center",
87
+ right: "Right"
88
+ },
89
+ verticalAlign: {
90
+ top: "Top",
91
+ middle: "Middle",
92
+ bottom: "Bottom"
93
+ },
94
+ wrapping: {
95
+ overflow: "Overflow",
96
+ wrap: "Wrap",
97
+ clip: "Clip"
98
+ },
8
99
  formulaBarLabel: "Formula bar",
9
100
  nameBoxPlaceholder: "Name box",
10
101
  formulaPlaceholder: "Enter a value or formula",
package/dist/index.d.mts CHANGED
@@ -3,6 +3,97 @@ var toolbar = {
3
3
  actionsLabel: "Spreadsheet actions",
4
4
  fileActionsLabel: "File actions",
5
5
  historyLabel: "History",
6
+ searchMenus: "Search menus",
7
+ print: "Print",
8
+ paintFormat: "Paint format",
9
+ zoom: "Zoom",
10
+ zoomValue: "Zoom: {value}",
11
+ currency: "Format as currency",
12
+ currencySymbol: "$",
13
+ percent: "Format as percent",
14
+ decreaseDecimal: "Decrease decimal places",
15
+ increaseDecimal: "Increase decimal places",
16
+ moreNumberFormats: "More number formats",
17
+ fontFamily: "Font family",
18
+ fontSize: "Font size",
19
+ decreaseFontSize: "Decrease font size",
20
+ increaseFontSize: "Increase font size",
21
+ bold: "Bold",
22
+ italic: "Italic",
23
+ strikethrough: "Strikethrough",
24
+ textColor: "Text color",
25
+ fillColor: "Fill color",
26
+ borders: "Borders",
27
+ borderColor: "Border color",
28
+ mergeCells: "Merge cells",
29
+ horizontalAlignment: "Horizontal alignment",
30
+ verticalAlignment: "Vertical alignment",
31
+ textWrapping: "Text wrapping",
32
+ more: "More toolbar items",
33
+ groups: {
34
+ search: "Search",
35
+ history: "History",
36
+ print: "Print",
37
+ paintFormat: "Paint format",
38
+ zoom: "Zoom",
39
+ number: "Number formats",
40
+ font: "Font",
41
+ text: "Text formatting",
42
+ colors: "Colors",
43
+ borders: "Borders",
44
+ merge: "Merge cells",
45
+ alignment: "Alignment"
46
+ },
47
+ numberFormats: {
48
+ automatic: "Automatic",
49
+ plainText: "Plain text",
50
+ number: "Number",
51
+ percent: "Percent",
52
+ scientific: "Scientific",
53
+ currency: "Currency",
54
+ date: "Date",
55
+ time: "Time",
56
+ custom: "Custom number format…"
57
+ },
58
+ borderPresets: {
59
+ all: "All borders",
60
+ inner: "Inner borders",
61
+ horizontal: "Horizontal borders",
62
+ vertical: "Vertical borders",
63
+ outer: "Outer borders",
64
+ left: "Left border",
65
+ top: "Top border",
66
+ right: "Right border",
67
+ bottom: "Bottom border",
68
+ none: "Clear borders"
69
+ },
70
+ borderStyles: {
71
+ solid: "Solid border",
72
+ dashed: "Dashed border",
73
+ dotted: "Dotted border",
74
+ double: "Double border"
75
+ },
76
+ merge: {
77
+ all: "Merge all",
78
+ horizontal: "Merge horizontally",
79
+ vertical: "Merge vertically",
80
+ unmerge: "Unmerge"
81
+ },
82
+ horizontalAlign: {
83
+ left: "Left",
84
+ center: "Center",
85
+ right: "Right"
86
+ },
87
+ verticalAlign: {
88
+ top: "Top",
89
+ middle: "Middle",
90
+ bottom: "Bottom"
91
+ },
92
+ wrapping: {
93
+ overflow: "Overflow",
94
+ wrap: "Wrap",
95
+ clip: "Clip"
96
+ },
6
97
  formulaBarLabel: "Formula bar",
7
98
  nameBoxPlaceholder: "Name box",
8
99
  formulaPlaceholder: "Enter a value or formula",
package/dist/index.mjs CHANGED
@@ -5,6 +5,97 @@ var en_default = {
5
5
  actionsLabel: "Spreadsheet actions",
6
6
  fileActionsLabel: "File actions",
7
7
  historyLabel: "History",
8
+ searchMenus: "Search menus",
9
+ print: "Print",
10
+ paintFormat: "Paint format",
11
+ zoom: "Zoom",
12
+ zoomValue: "Zoom: {value}",
13
+ currency: "Format as currency",
14
+ currencySymbol: "$",
15
+ percent: "Format as percent",
16
+ decreaseDecimal: "Decrease decimal places",
17
+ increaseDecimal: "Increase decimal places",
18
+ moreNumberFormats: "More number formats",
19
+ fontFamily: "Font family",
20
+ fontSize: "Font size",
21
+ decreaseFontSize: "Decrease font size",
22
+ increaseFontSize: "Increase font size",
23
+ bold: "Bold",
24
+ italic: "Italic",
25
+ strikethrough: "Strikethrough",
26
+ textColor: "Text color",
27
+ fillColor: "Fill color",
28
+ borders: "Borders",
29
+ borderColor: "Border color",
30
+ mergeCells: "Merge cells",
31
+ horizontalAlignment: "Horizontal alignment",
32
+ verticalAlignment: "Vertical alignment",
33
+ textWrapping: "Text wrapping",
34
+ more: "More toolbar items",
35
+ groups: {
36
+ search: "Search",
37
+ history: "History",
38
+ print: "Print",
39
+ paintFormat: "Paint format",
40
+ zoom: "Zoom",
41
+ number: "Number formats",
42
+ font: "Font",
43
+ text: "Text formatting",
44
+ colors: "Colors",
45
+ borders: "Borders",
46
+ merge: "Merge cells",
47
+ alignment: "Alignment"
48
+ },
49
+ numberFormats: {
50
+ automatic: "Automatic",
51
+ plainText: "Plain text",
52
+ number: "Number",
53
+ percent: "Percent",
54
+ scientific: "Scientific",
55
+ currency: "Currency",
56
+ date: "Date",
57
+ time: "Time",
58
+ custom: "Custom number format…"
59
+ },
60
+ borderPresets: {
61
+ all: "All borders",
62
+ inner: "Inner borders",
63
+ horizontal: "Horizontal borders",
64
+ vertical: "Vertical borders",
65
+ outer: "Outer borders",
66
+ left: "Left border",
67
+ top: "Top border",
68
+ right: "Right border",
69
+ bottom: "Bottom border",
70
+ none: "Clear borders"
71
+ },
72
+ borderStyles: {
73
+ solid: "Solid border",
74
+ dashed: "Dashed border",
75
+ dotted: "Dotted border",
76
+ double: "Double border"
77
+ },
78
+ merge: {
79
+ all: "Merge all",
80
+ horizontal: "Merge horizontally",
81
+ vertical: "Merge vertically",
82
+ unmerge: "Unmerge"
83
+ },
84
+ horizontalAlign: {
85
+ left: "Left",
86
+ center: "Center",
87
+ right: "Right"
88
+ },
89
+ verticalAlign: {
90
+ top: "Top",
91
+ middle: "Middle",
92
+ bottom: "Bottom"
93
+ },
94
+ wrapping: {
95
+ overflow: "Overflow",
96
+ wrap: "Wrap",
97
+ clip: "Clip"
98
+ },
8
99
  formulaBarLabel: "Formula bar",
9
100
  nameBoxPlaceholder: "Name box",
10
101
  formulaPlaceholder: "Enter a value or formula",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betteroffice/xlsx-i18n",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Shared UI locale strings and types for the @betteroffice/xlsx React editor.",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.mjs",