@eigenpal/docx-editor-i18n 1.0.0 → 1.0.2

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
@@ -80,6 +80,20 @@ import { locales } from '@eigenpal/docx-editor-i18n';
80
80
 
81
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.
82
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
+
83
97
  ## Types
84
98
 
85
99
  ```ts
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 };