@eigenpal/docx-editor-i18n 0.0.0 → 1.0.1
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 +48 -1
- package/dist/de.d.mts +33 -0
- package/dist/de.d.ts +33 -0
- package/dist/de.js +858 -0
- package/dist/de.mjs +831 -0
- package/dist/en.d.mts +33 -0
- package/dist/en.d.ts +33 -0
- package/dist/en.js +858 -0
- package/dist/en.mjs +831 -0
- package/dist/he.d.mts +33 -0
- package/dist/he.d.ts +33 -0
- package/dist/he.js +858 -0
- package/dist/he.mjs +831 -0
- package/dist/index.js +3 -3
- package/dist/pl.d.mts +33 -0
- package/dist/pl.d.ts +33 -0
- package/dist/pl.js +858 -0
- package/dist/pl.mjs +831 -0
- package/dist/pt-BR.d.mts +33 -0
- package/dist/pt-BR.d.ts +33 -0
- package/dist/pt-BR.js +858 -0
- package/dist/pt-BR.mjs +831 -0
- package/dist/tr.d.mts +33 -0
- package/dist/tr.d.ts +33 -0
- package/dist/tr.js +858 -0
- package/dist/tr.mjs +831 -0
- package/dist/zh-CN.d.mts +33 -0
- package/dist/zh-CN.d.ts +33 -0
- package/dist/zh-CN.js +858 -0
- package/dist/zh-CN.mjs +831 -0
- package/package.json +36 -1
package/README.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://www.docx-editor.dev/">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/eigenpal/docx-editor/main/assets/header.png" alt="DOCX Editor — .docx in, .docx out. Open source, agent ready, client-side." width="500" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@eigenpal/docx-editor-i18n"><img src="https://img.shields.io/npm/v/@eigenpal/docx-editor-i18n.svg?style=flat-square&color=3B5BDB" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/@eigenpal/docx-editor-i18n"><img src="https://img.shields.io/npm/dm/@eigenpal/docx-editor-i18n.svg?style=flat-square&color=3B5BDB" alt="npm downloads" /></a>
|
|
10
|
+
<a href="https://github.com/eigenpal/docx-editor/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache_2.0-blue.svg?style=flat-square&color=3B5BDB" alt="license" /></a>
|
|
11
|
+
<a href="https://docx-editor.dev/editor"><img src="https://img.shields.io/badge/Live_Demo-3B5BDB?style=flat-square&logo=vercel&logoColor=white" alt="Demo" /></a>
|
|
12
|
+
<a href="https://www.docx-editor.dev/docs"><img src="https://img.shields.io/badge/Docs-3B5BDB?style=flat-square&logo=readthedocs&logoColor=white" alt="Documentation" /></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
1
15
|
# @eigenpal/docx-editor-i18n
|
|
2
16
|
|
|
3
17
|
Shared locale strings, types, and runtime helpers for the [docx-editor](https://docx-editor.dev) adapters. One source of truth for translations consumed by `@eigenpal/docx-editor-react` and `@eigenpal/docx-editor-vue`.
|
|
@@ -33,6 +47,18 @@ const myLocale = {
|
|
|
33
47
|
|
|
34
48
|
Keys set to `null` in any locale fall back to English.
|
|
35
49
|
|
|
50
|
+
## Packages
|
|
51
|
+
|
|
52
|
+
| Package | Description |
|
|
53
|
+
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
54
|
+
| [`@eigenpal/docx-editor-react`](https://www.npmjs.com/package/@eigenpal/docx-editor-react) | <img src="https://cdn.simpleicons.org/react/61DAFB" width="20" align="middle" /> React adapter. Toolbar, paged editor, plugins. |
|
|
55
|
+
| [`@eigenpal/docx-editor-vue`](https://www.npmjs.com/package/@eigenpal/docx-editor-vue) | <img src="https://cdn.simpleicons.org/vuedotjs/4FC08D" width="20" align="middle" /> Vue 3 adapter. Toolbar, paged editor, plugins. |
|
|
56
|
+
| [`@eigenpal/docx-editor-core`](https://www.npmjs.com/package/@eigenpal/docx-editor-core) | Framework-agnostic core: OOXML parser, serializer, layout engine, ProseMirror schema. Depend on this if you fork the React or Vue adapter. |
|
|
57
|
+
| [`@eigenpal/docx-editor-i18n`](https://www.npmjs.com/package/@eigenpal/docx-editor-i18n) | Shared locale strings and types consumed by both adapters. |
|
|
58
|
+
| [`@eigenpal/docx-editor-agents`](https://www.npmjs.com/package/@eigenpal/docx-editor-agents) | Agent SDK and chat UI: framework-agnostic bridge, MCP server, AI SDK adapters, plus React UI. |
|
|
59
|
+
|
|
60
|
+
> **Forking the adapter?** Keep your fork thin. Depend on `@eigenpal/docx-editor-core` directly so parser, serializer, and rendering fixes land in your build automatically, without backporting each upstream change by hand.
|
|
61
|
+
|
|
36
62
|
## Available locales
|
|
37
63
|
|
|
38
64
|
| Code | Export | Language |
|
|
@@ -54,6 +80,20 @@ import { locales } from '@eigenpal/docx-editor-i18n';
|
|
|
54
80
|
|
|
55
81
|
> Importing `locales` pulls every locale into your bundle. For a smaller bundle, import only the ones you need by name; `sideEffects: false` lets the rest tree-shake.
|
|
56
82
|
|
|
83
|
+
## Per-locale subpaths
|
|
84
|
+
|
|
85
|
+
For apps that pick the locale at runtime, the named exports above don't tree-shake — the bundler can't know which locale wins, so it ships them all. Use the per-locale subpaths instead. Each one bundles a single locale (~30KB) and code-splits cleanly:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
// Static — bundler ships only this locale's strings
|
|
89
|
+
import pl from '@eigenpal/docx-editor-i18n/pl';
|
|
90
|
+
|
|
91
|
+
// Dynamic — splits into its own chunk, loaded on demand
|
|
92
|
+
const pl = (await import('@eigenpal/docx-editor-i18n/pl')).default;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Subpaths ship for every locale: `/en`, `/de`, `/he`, `/pl`, `/pt-BR`, `/tr`, `/zh-CN`. Each also exports its locale as a named binding (`import { pl } from '@eigenpal/docx-editor-i18n/pl'`) for callers that prefer non-default imports.
|
|
96
|
+
|
|
57
97
|
## Types
|
|
58
98
|
|
|
59
99
|
```ts
|
|
@@ -80,6 +120,13 @@ t('toolbar.bold'); // 'Fett'
|
|
|
80
120
|
t('dialogs.findReplace.matchCount', { current: 3, total: 15 }); // ICU plurals
|
|
81
121
|
```
|
|
82
122
|
|
|
123
|
+
`en.json` is the source of truth. Add keys there, then run `bun run i18n:fix` from the repo root to sync community locales (new keys land as `null`). Full guide: [docs/i18n.md](https://github.com/eigenpal/docx-editor/blob/main/docs/i18n.md).
|
|
124
|
+
|
|
83
125
|
## Contributing
|
|
84
126
|
|
|
85
|
-
|
|
127
|
+
Contributions welcome. See [CONTRIBUTING.md](https://github.com/eigenpal/docx-editor/blob/main/CONTRIBUTING.md) for setup, tests, and the one-time CLA signature.
|
|
128
|
+
|
|
129
|
+
## Commercial Support
|
|
130
|
+
|
|
131
|
+
> [!TIP]
|
|
132
|
+
> Questions or custom features? Email **[docx-editor@eigenpal.com](mailto:docx-editor@eigenpal.com)**.
|
package/dist/de.d.mts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @eigenpal/docx-editor-i18n/de
|
|
3
|
+
*
|
|
4
|
+
* German (`de`) — direct locale subpath for per-locale code-splitting.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* // Static — bundler ships only this locale's strings
|
|
8
|
+
* import de from '@eigenpal/docx-editor-i18n/de';
|
|
9
|
+
*
|
|
10
|
+
* // Dynamic — splits into its own chunk, loaded on demand
|
|
11
|
+
* const de = (await import('@eigenpal/docx-editor-i18n/de')).default;
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* For multi-locale apps, prefer the per-locale subpaths over importing
|
|
15
|
+
* `locales` from the package root — `locales` pulls every locale into
|
|
16
|
+
* the bundle.
|
|
17
|
+
*
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
import { PartialLocaleStrings } from './index.mjs';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* German (`de`) locale strings. Community-maintained; null leaves fall back to English.
|
|
25
|
+
*
|
|
26
|
+
* Identical content to the named `de` export from the package root;
|
|
27
|
+
* this subpath just lets bundlers code-split it.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
declare const de: PartialLocaleStrings;
|
|
32
|
+
|
|
33
|
+
export { de, de as default };
|
package/dist/de.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @eigenpal/docx-editor-i18n/de
|
|
3
|
+
*
|
|
4
|
+
* German (`de`) — direct locale subpath for per-locale code-splitting.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* // Static — bundler ships only this locale's strings
|
|
8
|
+
* import de from '@eigenpal/docx-editor-i18n/de';
|
|
9
|
+
*
|
|
10
|
+
* // Dynamic — splits into its own chunk, loaded on demand
|
|
11
|
+
* const de = (await import('@eigenpal/docx-editor-i18n/de')).default;
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* For multi-locale apps, prefer the per-locale subpaths over importing
|
|
15
|
+
* `locales` from the package root — `locales` pulls every locale into
|
|
16
|
+
* the bundle.
|
|
17
|
+
*
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
import { PartialLocaleStrings } from './index.js';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* German (`de`) locale strings. Community-maintained; null leaves fall back to English.
|
|
25
|
+
*
|
|
26
|
+
* Identical content to the named `de` export from the package root;
|
|
27
|
+
* this subpath just lets bundlers code-split it.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
declare const de: PartialLocaleStrings;
|
|
32
|
+
|
|
33
|
+
export { de, de as default };
|