@docx-editor.dev/i18n 2.22.0 → 2.23.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 CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  # @docx-editor.dev/i18n
16
16
 
17
- Translate [docx-editor.dev](https://docx-editor.dev) controls with locale strings, types, and runtime helpers. The package provides ten languages and falls back to English for missing translations.
17
+ Translate [docx-editor.dev](https://docx-editor.dev) controls with locale strings, types, and runtime helpers. The package provides eleven languages and falls back to English for missing translations.
18
18
 
19
19
  ## Quick start
20
20
 
@@ -28,11 +28,13 @@ Pass a locale to the editor. This example requires the React adapter and its eng
28
28
 
29
29
  ```tsx
30
30
  import { DocxEditor } from '@docx-editor.dev/react';
31
- import { de } from '@docx-editor.dev/i18n';
31
+ import { es } from '@docx-editor.dev/i18n';
32
32
 
33
- <DocxEditor document={bytes} i18n={de} />;
33
+ <DocxEditor document={bytes} i18n={es} locale="es-ES" />;
34
34
  ```
35
35
 
36
+ The `i18n` prop translates controls. Set `locale` separately for regional date input and generated document labels. It defaults to `en-US`.
37
+
36
38
  To share a locale across editors and custom controls, use `LocaleProvider`:
37
39
 
38
40
  ```tsx
@@ -44,7 +46,7 @@ import { de } from '@docx-editor.dev/i18n';
44
46
  </LocaleProvider>;
45
47
  ```
46
48
 
47
- Chrome you write yourself reads the same catalog through `useTranslation()`.
49
+ Custom controls read the same catalog through `useTranslation()`.
48
50
 
49
51
  Mix a community locale with custom overrides:
50
52
 
@@ -57,7 +59,7 @@ const myLocale = {
57
59
  };
58
60
  ```
59
61
 
60
- Keys set to `null` in any locale fall back to English.
62
+ Missing or `null` keys keep the inherited catalog value. Without an outer `LocaleProvider`, they fall back to English.
61
63
 
62
64
  ## Available locales
63
65
 
@@ -65,6 +67,7 @@ Keys set to `null` in any locale fall back to English.
65
67
  | ------- | ------ | ------------------- |
66
68
  | `en` | `en` | English (source) |
67
69
  | `de` | `de` | German |
70
+ | `es` | `es` | Spanish |
68
71
  | `fr` | `fr` | French |
69
72
  | `he` | `he` | Hebrew |
70
73
  | `hi` | `hi` | Hindi |
@@ -101,7 +104,7 @@ For on-demand loading, use a dynamic import instead:
101
104
  const pl = (await import('@docx-editor.dev/i18n/pl')).default;
102
105
  ```
103
106
 
104
- Subpaths ship for every locale: `/en`, `/de`, `/fr`, `/he`, `/hi`, `/id`, `/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.
107
+ Subpaths ship for every locale: `/en`, `/de`, `/es`, `/fr`, `/he`, `/hi`, `/id`, `/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.
105
108
 
106
109
  ## Types
107
110