@docx-editor.dev/i18n 2.32.0 → 2.33.0
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 +11 -3
- package/dist/ar.d.mts +33 -0
- package/dist/ar.d.ts +33 -0
- package/dist/ar.js +1187 -0
- package/dist/ar.mjs +1160 -0
- package/dist/de.js +37 -8
- package/dist/de.mjs +37 -8
- package/dist/en.js +35 -6
- package/dist/en.mjs +35 -6
- package/dist/es.js +36 -7
- package/dist/es.mjs +36 -7
- package/dist/fr.js +37 -8
- package/dist/fr.mjs +37 -8
- package/dist/he.js +38 -8
- package/dist/he.mjs +38 -8
- package/dist/hi.js +37 -8
- package/dist/hi.mjs +37 -8
- package/dist/id.js +37 -8
- package/dist/id.mjs +37 -8
- package/dist/index.d.mts +86 -3
- package/dist/index.d.ts +86 -3
- package/dist/index.js +1683 -101
- package/dist/index.mjs +1679 -101
- package/dist/ja.js +36 -7
- package/dist/ja.mjs +36 -7
- package/dist/pl.js +37 -8
- package/dist/pl.mjs +37 -8
- package/dist/pt-BR.js +37 -8
- package/dist/pt-BR.mjs +37 -8
- package/dist/ru.js +37 -8
- package/dist/ru.mjs +37 -8
- package/dist/tr.js +37 -8
- package/dist/tr.mjs +37 -8
- package/dist/zh-CN.js +37 -8
- package/dist/zh-CN.mjs +37 -8
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
# @docx-editor.dev/i18n
|
|
20
20
|
|
|
21
|
-
Translate [docx-editor.dev](https://docx-editor.dev) controls with locale strings, types, and runtime helpers. The package provides
|
|
21
|
+
Translate [docx-editor.dev](https://docx-editor.dev) controls with locale strings, types, and runtime helpers. The package provides 14 languages and falls back to English for missing translations.
|
|
22
22
|
|
|
23
23
|
## Quick start
|
|
24
24
|
|
|
@@ -65,11 +65,18 @@ const myLocale = {
|
|
|
65
65
|
|
|
66
66
|
Missing or `null` keys keep the inherited catalog value. Without an outer `LocaleProvider`, they fall back to English.
|
|
67
67
|
|
|
68
|
+
## Right-to-left interfaces
|
|
69
|
+
|
|
70
|
+
The Arabic (`ar`) and Hebrew (`he`) catalogs declare `_dir: 'rtl'`. Passing either catalog through `i18n` mirrors editor controls in React and Vue. Interface direction does not change the document's paragraph direction.
|
|
71
|
+
|
|
72
|
+
For custom translations, set `_dir: 'rtl'` in your catalog or pass `dir="rtl"` to `LocaleProvider`. For setup and limits, see [Right-to-left support](https://www.docx-editor.dev/docs/2.x/guides/right-to-left).
|
|
73
|
+
|
|
68
74
|
## Available locales
|
|
69
75
|
|
|
70
76
|
| Code | Export | Language |
|
|
71
77
|
| ------- | ------ | ------------------- |
|
|
72
78
|
| `en` | `en` | English (source) |
|
|
79
|
+
| `ar` | `ar` | Arabic |
|
|
73
80
|
| `de` | `de` | German |
|
|
74
81
|
| `es` | `es` | Spanish |
|
|
75
82
|
| `fr` | `fr` | French |
|
|
@@ -79,6 +86,7 @@ Missing or `null` keys keep the inherited catalog value. Without an outer `Local
|
|
|
79
86
|
| `ja` | `ja` | Japanese |
|
|
80
87
|
| `pl` | `pl` | Polish |
|
|
81
88
|
| `pt-BR` | `ptBR` | Portuguese (Brazil) |
|
|
89
|
+
| `ru` | `ru` | Russian |
|
|
82
90
|
| `tr` | `tr` | Turkish |
|
|
83
91
|
| `zh-CN` | `zhCN` | Simplified Chinese |
|
|
84
92
|
|
|
@@ -109,7 +117,7 @@ For on-demand loading, use a dynamic import instead:
|
|
|
109
117
|
const pl = (await import('@docx-editor.dev/i18n/pl')).default;
|
|
110
118
|
```
|
|
111
119
|
|
|
112
|
-
Subpaths ship for every locale: `/en`, `/de`, `/es`, `/fr`, `/he`, `/hi`, `/id`, `/ja`, `/pl`, `/pt-BR`, `/tr`, `/zh-CN`. Each also exports its locale as a named binding (`import { pl } from '@docx-editor.dev/i18n/pl'`) for callers that prefer non-default imports.
|
|
120
|
+
Subpaths ship for every locale: `/en`, `/ar`, `/de`, `/es`, `/fr`, `/he`, `/hi`, `/id`, `/ja`, `/pl`, `/pt-BR`, `/tr`, `/zh-CN`. Each also exports its locale as a named binding (`import { pl } from '@docx-editor.dev/i18n/pl'`) for callers that prefer non-default imports.
|
|
113
121
|
|
|
114
122
|
## Types
|
|
115
123
|
|
|
@@ -126,7 +134,7 @@ import type {
|
|
|
126
134
|
} from '@docx-editor.dev/i18n';
|
|
127
135
|
```
|
|
128
136
|
|
|
129
|
-
## Outside the
|
|
137
|
+
## Outside the editor adapters
|
|
130
138
|
|
|
131
139
|
Build a typed `t()` outside the adapter packages:
|
|
132
140
|
|
package/dist/ar.d.mts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @docx-editor.dev/i18n/ar
|
|
3
|
+
*
|
|
4
|
+
* Arabic (`ar`) — direct locale subpath for per-locale code-splitting.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* // Static — bundler ships only this locale's strings
|
|
8
|
+
* import ar from '@docx-editor.dev/i18n/ar';
|
|
9
|
+
*
|
|
10
|
+
* // Dynamic — splits into its own chunk, loaded on demand
|
|
11
|
+
* const ar = (await import('@docx-editor.dev/i18n/ar')).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
|
+
* Arabic (`ar`) locale strings. Community-maintained; null leaves fall back to English.
|
|
25
|
+
*
|
|
26
|
+
* Identical content to the named `ar` export from the package root;
|
|
27
|
+
* this subpath just lets bundlers code-split it.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
declare const ar: PartialLocaleStrings;
|
|
32
|
+
|
|
33
|
+
export { ar, ar as default };
|
package/dist/ar.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @docx-editor.dev/i18n/ar
|
|
3
|
+
*
|
|
4
|
+
* Arabic (`ar`) — direct locale subpath for per-locale code-splitting.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* // Static — bundler ships only this locale's strings
|
|
8
|
+
* import ar from '@docx-editor.dev/i18n/ar';
|
|
9
|
+
*
|
|
10
|
+
* // Dynamic — splits into its own chunk, loaded on demand
|
|
11
|
+
* const ar = (await import('@docx-editor.dev/i18n/ar')).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
|
+
* Arabic (`ar`) locale strings. Community-maintained; null leaves fall back to English.
|
|
25
|
+
*
|
|
26
|
+
* Identical content to the named `ar` export from the package root;
|
|
27
|
+
* this subpath just lets bundlers code-split it.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
declare const ar: PartialLocaleStrings;
|
|
32
|
+
|
|
33
|
+
export { ar, ar as default };
|