@betteroffice/pptx-i18n 0.0.2 → 0.0.3

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/pptx-i18n
2
2
 
3
- Shared locale strings, types, and runtime helpers for the [BetterOffice PPTX editor](https://betteroffice.dev) React adapter.
3
+ UI locale strings, types, and runtime helpers for the
4
+ [`@betteroffice/pptx-react`](https://www.npmjs.com/package/@betteroffice/pptx-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/pptx-i18n
14
+ bun add @betteroffice/pptx-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/pptx-i18n';
15
23
  import { PptxEditor } from '@betteroffice/pptx-react';
16
24
 
17
- <PptxEditor file={file} fonts={fonts} i18n={de} />
25
+ <PptxEditor file={file} fonts={fonts} 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/pptx-i18n/pl';
41
- ```
35
+ Each locale also ships as its own subpath (`@betteroffice/pptx-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/pptx-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/pptx-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.addSlide');
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/de.mjs CHANGED
@@ -15,7 +15,62 @@ var de_default = {
15
15
  addSlide: null,
16
16
  deleteSlide: null,
17
17
  objectsLabel: null,
18
- addTextBox: null
18
+ addTextBox: null,
19
+ groups: {
20
+ slides: null,
21
+ history: null,
22
+ zoom: null,
23
+ tools: null,
24
+ font: null,
25
+ text: null,
26
+ shape: null
27
+ },
28
+ newSlide: null,
29
+ newSlideWithLayout: null,
30
+ layoutOption: null,
31
+ undoShortcut: null,
32
+ redoShortcut: null,
33
+ fit: null,
34
+ zoomValue: null,
35
+ selectToolShortcut: null,
36
+ textBoxTool: null,
37
+ shapeTool: null,
38
+ fontFamily: null,
39
+ mixed: null,
40
+ decreaseFontSize: null,
41
+ increaseFontSize: null,
42
+ boldShortcut: null,
43
+ italicShortcut: null,
44
+ underline: null,
45
+ underlineShortcut: null,
46
+ more: null,
47
+ fillColor: null,
48
+ noFill: null,
49
+ borderColor: null,
50
+ borderWidth: null,
51
+ borderWidthValue: null,
52
+ noBorder: null,
53
+ cornerRadius: null,
54
+ shapeAdjustment: "Formanpassung",
55
+ shapes: {
56
+ rect: null,
57
+ roundRect: null,
58
+ ellipse: null,
59
+ triangle: null,
60
+ rtTriangle: null,
61
+ diamond: null,
62
+ parallelogram: null,
63
+ trapezoid: null,
64
+ pentagon: null,
65
+ hexagon: null,
66
+ octagon: null,
67
+ star5: null,
68
+ rightArrow: null,
69
+ leftArrow: null,
70
+ upArrow: null,
71
+ downArrow: null,
72
+ chevron: null
73
+ }
19
74
  },
20
75
  slides: {
21
76
  panelLabel: null,
package/dist/en.mjs CHANGED
@@ -15,7 +15,62 @@ var en_default = {
15
15
  addSlide: "Add slide",
16
16
  deleteSlide: "Delete slide",
17
17
  objectsLabel: "Objects",
18
- addTextBox: "Add text box"
18
+ addTextBox: "Add text box",
19
+ groups: {
20
+ slides: "Slides",
21
+ history: "History",
22
+ zoom: "Zoom",
23
+ tools: "Tools",
24
+ font: "Font",
25
+ text: "Text formatting",
26
+ shape: "Shape formatting"
27
+ },
28
+ newSlide: "New slide",
29
+ newSlideWithLayout: "New slide with layout",
30
+ layoutOption: "Layout {number}",
31
+ undoShortcut: "Undo (⌘Z)",
32
+ redoShortcut: "Redo (⇧⌘Z)",
33
+ fit: "Fit",
34
+ zoomValue: "Zoom: {value}",
35
+ selectToolShortcut: "Select (Esc)",
36
+ textBoxTool: "Text box",
37
+ shapeTool: "Shape",
38
+ fontFamily: "Font family",
39
+ mixed: "Mixed",
40
+ decreaseFontSize: "Decrease font size",
41
+ increaseFontSize: "Increase font size",
42
+ boldShortcut: "Bold (⌘B)",
43
+ italicShortcut: "Italic (⌘I)",
44
+ underline: "Underline",
45
+ underlineShortcut: "Underline (⌘U)",
46
+ more: "More",
47
+ fillColor: "Fill color",
48
+ noFill: "No fill",
49
+ borderColor: "Border color",
50
+ borderWidth: "Border width",
51
+ borderWidthValue: "{width} pt",
52
+ noBorder: "No border",
53
+ cornerRadius: "Corner radius",
54
+ shapeAdjustment: "Shape adjustment",
55
+ shapes: {
56
+ rect: "Rectangle",
57
+ roundRect: "Rounded rectangle",
58
+ ellipse: "Ellipse",
59
+ triangle: "Triangle",
60
+ rtTriangle: "Right triangle",
61
+ diamond: "Diamond",
62
+ parallelogram: "Parallelogram",
63
+ trapezoid: "Trapezoid",
64
+ pentagon: "Pentagon",
65
+ hexagon: "Hexagon",
66
+ octagon: "Octagon",
67
+ star5: "5-point star",
68
+ rightArrow: "Right arrow",
69
+ leftArrow: "Left arrow",
70
+ upArrow: "Up arrow",
71
+ downArrow: "Down arrow",
72
+ chevron: "Chevron"
73
+ }
19
74
  },
20
75
  slides: {
21
76
  panelLabel: "Slides",
package/dist/fr.mjs CHANGED
@@ -15,7 +15,62 @@ var fr_default = {
15
15
  addSlide: null,
16
16
  deleteSlide: null,
17
17
  objectsLabel: null,
18
- addTextBox: null
18
+ addTextBox: null,
19
+ groups: {
20
+ slides: null,
21
+ history: null,
22
+ zoom: null,
23
+ tools: null,
24
+ font: null,
25
+ text: null,
26
+ shape: null
27
+ },
28
+ newSlide: null,
29
+ newSlideWithLayout: null,
30
+ layoutOption: null,
31
+ undoShortcut: null,
32
+ redoShortcut: null,
33
+ fit: null,
34
+ zoomValue: null,
35
+ selectToolShortcut: null,
36
+ textBoxTool: null,
37
+ shapeTool: null,
38
+ fontFamily: null,
39
+ mixed: null,
40
+ decreaseFontSize: null,
41
+ increaseFontSize: null,
42
+ boldShortcut: null,
43
+ italicShortcut: null,
44
+ underline: null,
45
+ underlineShortcut: null,
46
+ more: null,
47
+ fillColor: null,
48
+ noFill: null,
49
+ borderColor: null,
50
+ borderWidth: null,
51
+ borderWidthValue: null,
52
+ noBorder: null,
53
+ cornerRadius: null,
54
+ shapeAdjustment: "Ajustement de forme",
55
+ shapes: {
56
+ rect: null,
57
+ roundRect: null,
58
+ ellipse: null,
59
+ triangle: null,
60
+ rtTriangle: null,
61
+ diamond: null,
62
+ parallelogram: null,
63
+ trapezoid: null,
64
+ pentagon: null,
65
+ hexagon: null,
66
+ octagon: null,
67
+ star5: null,
68
+ rightArrow: null,
69
+ leftArrow: null,
70
+ upArrow: null,
71
+ downArrow: null,
72
+ chevron: null
73
+ }
19
74
  },
20
75
  slides: {
21
76
  panelLabel: null,
package/dist/he.mjs CHANGED
@@ -15,7 +15,62 @@ var he_default = {
15
15
  addSlide: null,
16
16
  deleteSlide: null,
17
17
  objectsLabel: null,
18
- addTextBox: null
18
+ addTextBox: null,
19
+ groups: {
20
+ slides: null,
21
+ history: null,
22
+ zoom: null,
23
+ tools: null,
24
+ font: null,
25
+ text: null,
26
+ shape: null
27
+ },
28
+ newSlide: null,
29
+ newSlideWithLayout: null,
30
+ layoutOption: null,
31
+ undoShortcut: null,
32
+ redoShortcut: null,
33
+ fit: null,
34
+ zoomValue: null,
35
+ selectToolShortcut: null,
36
+ textBoxTool: null,
37
+ shapeTool: null,
38
+ fontFamily: null,
39
+ mixed: null,
40
+ decreaseFontSize: null,
41
+ increaseFontSize: null,
42
+ boldShortcut: null,
43
+ italicShortcut: null,
44
+ underline: null,
45
+ underlineShortcut: null,
46
+ more: null,
47
+ fillColor: null,
48
+ noFill: null,
49
+ borderColor: null,
50
+ borderWidth: null,
51
+ borderWidthValue: null,
52
+ noBorder: null,
53
+ cornerRadius: null,
54
+ shapeAdjustment: "התאמת צורה",
55
+ shapes: {
56
+ rect: null,
57
+ roundRect: null,
58
+ ellipse: null,
59
+ triangle: null,
60
+ rtTriangle: null,
61
+ diamond: null,
62
+ parallelogram: null,
63
+ trapezoid: null,
64
+ pentagon: null,
65
+ hexagon: null,
66
+ octagon: null,
67
+ star5: null,
68
+ rightArrow: null,
69
+ leftArrow: null,
70
+ upArrow: null,
71
+ downArrow: null,
72
+ chevron: null
73
+ }
19
74
  },
20
75
  slides: {
21
76
  panelLabel: null,
package/dist/hi.mjs CHANGED
@@ -15,7 +15,62 @@ var hi_default = {
15
15
  addSlide: null,
16
16
  deleteSlide: null,
17
17
  objectsLabel: null,
18
- addTextBox: null
18
+ addTextBox: null,
19
+ groups: {
20
+ slides: null,
21
+ history: null,
22
+ zoom: null,
23
+ tools: null,
24
+ font: null,
25
+ text: null,
26
+ shape: null
27
+ },
28
+ newSlide: null,
29
+ newSlideWithLayout: null,
30
+ layoutOption: null,
31
+ undoShortcut: null,
32
+ redoShortcut: null,
33
+ fit: null,
34
+ zoomValue: null,
35
+ selectToolShortcut: null,
36
+ textBoxTool: null,
37
+ shapeTool: null,
38
+ fontFamily: null,
39
+ mixed: null,
40
+ decreaseFontSize: null,
41
+ increaseFontSize: null,
42
+ boldShortcut: null,
43
+ italicShortcut: null,
44
+ underline: null,
45
+ underlineShortcut: null,
46
+ more: null,
47
+ fillColor: null,
48
+ noFill: null,
49
+ borderColor: null,
50
+ borderWidth: null,
51
+ borderWidthValue: null,
52
+ noBorder: null,
53
+ cornerRadius: null,
54
+ shapeAdjustment: "आकृति समायोजन",
55
+ shapes: {
56
+ rect: null,
57
+ roundRect: null,
58
+ ellipse: null,
59
+ triangle: null,
60
+ rtTriangle: null,
61
+ diamond: null,
62
+ parallelogram: null,
63
+ trapezoid: null,
64
+ pentagon: null,
65
+ hexagon: null,
66
+ octagon: null,
67
+ star5: null,
68
+ rightArrow: null,
69
+ leftArrow: null,
70
+ upArrow: null,
71
+ downArrow: null,
72
+ chevron: null
73
+ }
19
74
  },
20
75
  slides: {
21
76
  panelLabel: null,
package/dist/id.mjs CHANGED
@@ -15,7 +15,62 @@ var id_default = {
15
15
  addSlide: null,
16
16
  deleteSlide: null,
17
17
  objectsLabel: null,
18
- addTextBox: null
18
+ addTextBox: null,
19
+ groups: {
20
+ slides: null,
21
+ history: null,
22
+ zoom: null,
23
+ tools: null,
24
+ font: null,
25
+ text: null,
26
+ shape: null
27
+ },
28
+ newSlide: null,
29
+ newSlideWithLayout: null,
30
+ layoutOption: null,
31
+ undoShortcut: null,
32
+ redoShortcut: null,
33
+ fit: null,
34
+ zoomValue: null,
35
+ selectToolShortcut: null,
36
+ textBoxTool: null,
37
+ shapeTool: null,
38
+ fontFamily: null,
39
+ mixed: null,
40
+ decreaseFontSize: null,
41
+ increaseFontSize: null,
42
+ boldShortcut: null,
43
+ italicShortcut: null,
44
+ underline: null,
45
+ underlineShortcut: null,
46
+ more: null,
47
+ fillColor: null,
48
+ noFill: null,
49
+ borderColor: null,
50
+ borderWidth: null,
51
+ borderWidthValue: null,
52
+ noBorder: null,
53
+ cornerRadius: null,
54
+ shapeAdjustment: "Penyesuaian bentuk",
55
+ shapes: {
56
+ rect: null,
57
+ roundRect: null,
58
+ ellipse: null,
59
+ triangle: null,
60
+ rtTriangle: null,
61
+ diamond: null,
62
+ parallelogram: null,
63
+ trapezoid: null,
64
+ pentagon: null,
65
+ hexagon: null,
66
+ octagon: null,
67
+ star5: null,
68
+ rightArrow: null,
69
+ leftArrow: null,
70
+ upArrow: null,
71
+ downArrow: null,
72
+ chevron: null
73
+ }
19
74
  },
20
75
  slides: {
21
76
  panelLabel: null,
package/dist/index.d.mts CHANGED
@@ -13,7 +13,62 @@ var toolbar = {
13
13
  addSlide: "Add slide",
14
14
  deleteSlide: "Delete slide",
15
15
  objectsLabel: "Objects",
16
- addTextBox: "Add text box"
16
+ addTextBox: "Add text box",
17
+ groups: {
18
+ slides: "Slides",
19
+ history: "History",
20
+ zoom: "Zoom",
21
+ tools: "Tools",
22
+ font: "Font",
23
+ text: "Text formatting",
24
+ shape: "Shape formatting"
25
+ },
26
+ newSlide: "New slide",
27
+ newSlideWithLayout: "New slide with layout",
28
+ layoutOption: "Layout {number}",
29
+ undoShortcut: "Undo (⌘Z)",
30
+ redoShortcut: "Redo (⇧⌘Z)",
31
+ fit: "Fit",
32
+ zoomValue: "Zoom: {value}",
33
+ selectToolShortcut: "Select (Esc)",
34
+ textBoxTool: "Text box",
35
+ shapeTool: "Shape",
36
+ fontFamily: "Font family",
37
+ mixed: "Mixed",
38
+ decreaseFontSize: "Decrease font size",
39
+ increaseFontSize: "Increase font size",
40
+ boldShortcut: "Bold (⌘B)",
41
+ italicShortcut: "Italic (⌘I)",
42
+ underline: "Underline",
43
+ underlineShortcut: "Underline (⌘U)",
44
+ more: "More",
45
+ fillColor: "Fill color",
46
+ noFill: "No fill",
47
+ borderColor: "Border color",
48
+ borderWidth: "Border width",
49
+ borderWidthValue: "{width} pt",
50
+ noBorder: "No border",
51
+ cornerRadius: "Corner radius",
52
+ shapeAdjustment: "Shape adjustment",
53
+ shapes: {
54
+ rect: "Rectangle",
55
+ roundRect: "Rounded rectangle",
56
+ ellipse: "Ellipse",
57
+ triangle: "Triangle",
58
+ rtTriangle: "Right triangle",
59
+ diamond: "Diamond",
60
+ parallelogram: "Parallelogram",
61
+ trapezoid: "Trapezoid",
62
+ pentagon: "Pentagon",
63
+ hexagon: "Hexagon",
64
+ octagon: "Octagon",
65
+ star5: "5-point star",
66
+ rightArrow: "Right arrow",
67
+ leftArrow: "Left arrow",
68
+ upArrow: "Up arrow",
69
+ downArrow: "Down arrow",
70
+ chevron: "Chevron"
71
+ }
17
72
  };
18
73
  var slides = {
19
74
  panelLabel: "Slides",