nuvra 0.3.0 → 0.4.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
@@ -97,6 +97,7 @@ const uploadImage: DocumentImageUploadHandler = async file => {
97
97
  | `defaultViewMode` | `'page' \| 'web'` | `'page'` | View shown first. |
98
98
  | `disabled` | `boolean` | `false` | Read-only document, disabled controls. |
99
99
  | `height` | `number \| string` | `760` | Height of the editor, or `'auto'` to grow between `minHeight`/`maxHeight`. |
100
+ | `locale` | `EditorLocale \| 'uz' \| 'en' \| 'ru'` | — | Interface language; defaults to the app-wide language (Uzbek). |
100
101
  | `minHeight` | `number \| string` | `240` | Smallest height of an auto-height editor. |
101
102
  | `maxHeight` | `number \| string` | `600` | Largest height of an auto-height editor. |
102
103
  | `maxImageSizeMb` | `number` | `10` | Largest accepted image file. |
@@ -136,34 +137,35 @@ redo · `Ctrl/⌘+F` — find · `Ctrl/⌘+H` — replace · `Ctrl/⌘+K` — li
136
137
  The full list, with Markdown-like input rules, is in the
137
138
  [keyboard shortcuts guide](https://nuvra-docs.vercel.app/docs/keyboard-shortcuts).
138
139
 
139
- ## Translations
140
+ ## Languages
140
141
 
141
- Built-in labels are in Uzbek. Every label has a key such as `editor.bold`; the full list with default texts is
142
- exported as `editorMessages`. Register a translator once, before the app mounts. Returning `undefined` keeps the
143
- built-in text for that key.
142
+ The interface ships in Uzbek (`uz`, the default), English (`en`) and Russian (`ru`). The translations are part of
143
+ the package and cannot be changed from outside; an app only picks the language.
144
144
 
145
- ```ts
146
- import { setEditorTranslator } from 'nuvra';
145
+ For one editor, pass the locale (or just its code) to the `locale` prop:
147
146
 
148
- const en: Record<string, string> = {
149
- 'editor.bold': 'Bold',
150
- 'editor.status.words': '{count} words'
151
- };
147
+ ```vue
148
+ <script setup lang="ts">
149
+ import { DocumentEditor, ru } from 'nuvra';
150
+ </script>
152
151
 
153
- setEditorTranslator((key, named) =>
154
- en[key]?.replace(/\{(\w+)\}/g, (_, name) => String(named?.[name] ?? ''))
155
- );
152
+ <template>
153
+ <DocumentEditor v-model="html" :locale="ru" />
154
+ </template>
156
155
  ```
157
156
 
158
- With `vue-i18n`, labels follow the active locale:
157
+ For the whole app, call `setEditorLocale` once, for example in `main.ts`. It is reactive, so calling it again from a
158
+ language switcher updates editors already on the page:
159
159
 
160
160
  ```ts
161
- import { setEditorTranslator } from 'nuvra';
162
- import { i18n } from './i18n';
161
+ import { en, setEditorLocale } from 'nuvra';
163
162
 
164
- setEditorTranslator((key, named) => (i18n.global.te(key) ? i18n.global.t(key, named ?? {}) : undefined));
163
+ setEditorLocale(en);
165
164
  ```
166
165
 
166
+ The `locale` prop wins over `setEditorLocale`; without either the editor is in Uzbek. `editorLocales` lists every
167
+ built-in locale with its name, for language pickers.
168
+
167
169
  ## Theming
168
170
 
169
171
  Colors come from CSS variables declared on `.document-editor` with zero specificity, so any rule that targets
@@ -1,4 +1,5 @@
1
1
  import { DocumentEngine } from '../core/engine/engine';
2
+ import { type EditorLocaleInput } from '../core/labels';
2
3
  import { type DocumentViewMode, type PageSettings } from '../core/page';
3
4
  import type { DocumentImageUploadHandler } from '../core/types';
4
5
  import '../styles/document-content.css';
@@ -16,6 +17,8 @@ interface Props {
16
17
  disabled?: boolean;
17
18
  /** Height of the whole editor, or `'auto'` to grow with the content between `minHeight` and `maxHeight`. */
18
19
  height?: CssSize;
20
+ /** Interface language: a built-in locale (`uz`, `en`, `ru`) or its code; defaults to the app-wide language. */
21
+ locale?: EditorLocaleInput;
19
22
  /** Largest height of an auto-height editor; longer documents scroll inside it. */
20
23
  maxHeight?: CssSize;
21
24
  /** Largest accepted image file, in megabytes. */
@@ -78,6 +81,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
78
81
  autofocus: boolean;
79
82
  canvasPadding: CssSize;
80
83
  defaultViewMode: DocumentViewMode;
84
+ locale: EditorLocaleInput;
81
85
  maxImageSizeMb: number;
82
86
  uploadImage: DocumentImageUploadHandler;
83
87
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,192 +1,38 @@
1
- /** Built-in Uzbek texts, used for every key the registered translator does not translate. */
2
- declare const MESSAGES: {
3
- readonly 'editor.align': "Tekislash";
4
- readonly 'editor.align.center': "Markazga";
5
- readonly 'editor.align.justify': "Ikki tomonga";
6
- readonly 'editor.align.left': "Chapga";
7
- readonly 'editor.align.right': "O‘ngga";
8
- readonly 'editor.apply': "Qo‘llash";
9
- readonly 'editor.bold': "Qalin";
10
- readonly 'editor.bulletList': "Belgili ro‘yxat";
11
- readonly 'editor.case.lower': "kichik harflar";
12
- readonly 'editor.case.sentence': "Gap boshi bosh harf";
13
- readonly 'editor.case.title': "Har So‘z Bosh Harf";
14
- readonly 'editor.case.toggle': "rEGISTRNI ALMASHTIRISH";
15
- readonly 'editor.case.upper': "BOSH HARFLAR";
16
- readonly 'editor.changeCase': "Harf registri";
17
- readonly 'editor.clearFormatting': "Formatni tozalash";
18
- readonly 'editor.close': "Yopish";
19
- readonly 'editor.codeBlock': "Kod bloki";
20
- readonly 'editor.colors.automatic': "Avtomatik";
21
- readonly 'editor.colors.custom': "Boshqa rang…";
22
- readonly 'editor.colors.none': "Rangsiz";
23
- readonly 'editor.copy': "Nusxalash";
24
- readonly 'editor.cut': "Kesish";
25
- readonly 'editor.defaultFont': "Standart shrift";
26
- readonly 'editor.defaultLineHeight': "Standart";
27
- readonly 'editor.decreaseFontSize': "Shriftni kichraytirish";
28
- readonly 'editor.defaultSize': "Standart o‘lcham";
29
- readonly 'editor.delete': "O‘chirish";
30
- readonly 'editor.direction.auto': "Avtomatik yo‘nalish";
31
- readonly 'editor.direction.ltr': "Chapdan o‘ngga";
32
- readonly 'editor.direction.rtl': "O‘ngdan chapga";
33
- readonly 'editor.document': "Hujjat";
34
- readonly 'editor.editLink': "Havolani tahrirlash";
35
- readonly 'editor.enterFullscreen': "To‘liq ekran";
36
- readonly 'editor.exitFullscreen': "To‘liq ekrandan chiqish";
37
- readonly 'editor.exportHtml': "HTML sifatida yuklab olish";
38
- readonly 'editor.exportWord': "Word (.doc) sifatida yuklab olish";
39
- readonly 'editor.fitWidth': "Kenglikka moslash";
40
- readonly 'editor.fontFamily': "Shrift";
41
- readonly 'editor.fontSize': "Shrift o‘lchami";
42
- readonly 'editor.footer': "Pastki kolontitul";
43
- readonly 'editor.formatPainter': "Format bo‘yoqchasi";
44
- readonly 'editor.formattingMarks': "Formatlash belgilari";
45
- readonly 'editor.header': "Yuqori kolontitul";
46
- readonly 'editor.headerFooter': "Kolontitullar";
47
- readonly 'editor.headerFooter.center': "Markaz";
48
- readonly 'editor.headerFooter.clear': "Tozalash";
49
- readonly 'editor.headerFooter.hint': "Matn har bir sahifada takrorlanadi.";
50
- readonly 'editor.headerFooter.left': "Chap";
51
- readonly 'editor.headerFooter.right': "O‘ng";
52
- readonly 'editor.headerFooter.token.date': "Sana";
53
- readonly 'editor.headerFooter.token.page': "Sahifa raqami";
54
- readonly 'editor.headerFooter.token.pages': "Sahifalar soni";
55
- readonly 'editor.headerFooter.token.title': "Hujjat nomi";
56
- readonly 'editor.headerFooter.tokens': "Qo‘shish:";
57
- readonly 'editor.heading': "Sarlavha {level}";
58
- readonly 'editor.highlight': "Belgilash rangi";
59
- readonly 'editor.horizontalRule': "Gorizontal chiziq";
60
- readonly 'editor.image': "Rasm";
61
- readonly 'editor.imageAlt': "Muqobil matn (alt)";
62
- readonly 'editor.imageReadError': "Rasmni o‘qib bo‘lmadi";
63
- readonly 'editor.imageSizeError': "Rasm hajmi {size} MB dan oshmasligi kerak";
64
- readonly 'editor.imageTypeError': "Faqat rasm fayllarini qo‘shish mumkin";
65
- readonly 'editor.imageUploadError': "Rasmni yuklab bo‘lmadi";
66
- readonly 'editor.increaseFontSize': "Shriftni kattalashtirish";
67
- readonly 'editor.indent': "Chekinishni oshirish";
68
- readonly 'editor.inlineCode': "Kod";
69
- readonly 'editor.insert': "Qo‘shish";
70
- readonly 'editor.insertDate': "Bugungi sana";
71
- readonly 'editor.insertMore': "Boshqa elementlar";
72
- readonly 'editor.italic': "Kursiv";
73
- readonly 'editor.lineHeight': "Qator oralig‘i";
74
- readonly 'editor.link': "Havola";
75
- readonly 'editor.linkNewTab': "Yangi oynada ochish";
76
- readonly 'editor.linkText': "Matn";
77
- readonly 'editor.linkUrl': "Manzil (URL)";
78
- readonly 'editor.more': "Yana";
79
- readonly 'editor.moreFormatting': "Boshqa formatlar";
80
- readonly 'editor.openLink': "Havolani ochish";
81
- readonly 'editor.or': "yoki havola orqali";
82
- readonly 'editor.orderedList': "Raqamli ro‘yxat";
83
- readonly 'editor.outdent': "Chekinishni kamaytirish";
84
- readonly 'editor.page.customMargins': "Aniq qiymatlar (mm)";
85
- readonly 'editor.page.landscape': "Albom";
86
- readonly 'editor.page.marginBottom': "Pastki";
87
- readonly 'editor.page.marginLeft': "Chap";
88
- readonly 'editor.page.marginRight': "O‘ng";
89
- readonly 'editor.page.marginTop': "Yuqori";
90
- readonly 'editor.page.margins': "Hoshiyalar";
91
- readonly 'editor.page.margins.moderate': "O‘rtacha";
92
- readonly 'editor.page.margins.narrow': "Tor";
93
- readonly 'editor.page.margins.normal': "Oddiy";
94
- readonly 'editor.page.margins.official': "Rasmiy hujjat";
95
- readonly 'editor.page.margins.wide': "Keng";
96
- readonly 'editor.page.orientation': "Yo‘nalish";
97
- readonly 'editor.page.portrait': "Kitob";
98
- readonly 'editor.page.setup': "Sahifa sozlamalari";
99
- readonly 'editor.page.watermark': "Suv belgisi";
100
- readonly 'editor.page.watermarkColor': "Rangi";
101
- readonly 'editor.page.watermarkDiagonal': "Qiya";
102
- readonly 'editor.page.watermarkText': "Matn, masalan NUSXA";
103
- readonly 'editor.page.size': "Qog‘oz o‘lchami";
104
- readonly 'editor.pageBreak': "Sahifa uzilishi";
105
- readonly 'editor.paragraph': "Oddiy matn";
106
- readonly 'editor.paste': "Joylashtirish";
107
- readonly 'editor.placeholder': "Hujjat matnini kiriting…";
108
- readonly 'editor.print': "Chop etish / PDF";
109
- readonly 'editor.quote': "Iqtibos";
110
- readonly 'editor.redo': "Qaytarish";
111
- readonly 'editor.replace.all': "Barchasini";
112
- readonly 'editor.replace.one': "Almashtirish";
113
- readonly 'editor.replace.placeholder': "Almashtirish";
114
- readonly 'editor.replace.toggle': "Almashtirishni ko‘rsatish";
115
- readonly 'editor.ruler': "Chizg‘ich";
116
- readonly 'editor.ruler.firstLine': "Birinchi qator chekinishi";
117
- readonly 'editor.ruler.indentLeft': "Chap chekinish";
118
- readonly 'editor.ruler.indentRight': "O‘ng chekinish";
119
- readonly 'editor.ruler.marginLeft': "Chap hoshiya";
120
- readonly 'editor.ruler.marginRight': "O‘ng hoshiya";
121
- readonly 'editor.search.caseSensitive': "Katta-kichik harfni farqlash";
122
- readonly 'editor.search.next': "Keyingisi";
123
- readonly 'editor.search.placeholder': "Qidirish";
124
- readonly 'editor.search.previous': "Oldingisi";
125
- readonly 'editor.search.title': "Qidirish va almashtirish";
126
- readonly 'editor.search.wholeWord': "Butun so‘z";
127
- readonly 'editor.selectAll': "Barchasini tanlash";
128
- readonly 'editor.source': "HTML kod";
129
- readonly 'editor.spacing.addAfter': "Keyin bo‘sh joy qo‘shish";
130
- readonly 'editor.spacing.addBefore': "Oldin bo‘sh joy qo‘shish";
131
- readonly 'editor.spacing.removeAfter': "Keyingi bo‘sh joyni olib tashlash";
132
- readonly 'editor.spacing.removeBefore': "Oldingi bo‘sh joyni olib tashlash";
133
- readonly 'editor.specialCharacters': "Maxsus belgilar";
134
- readonly 'editor.status.characters': "{count} belgi";
135
- readonly 'editor.status.page': "Sahifa {current} / {total}";
136
- readonly 'editor.status.words': "{count} so‘z";
137
- readonly 'editor.strike': "Ustidan chizilgan";
138
- readonly 'editor.subscript': "Pastki indeks";
139
- readonly 'editor.superscript': "Yuqori indeks";
140
- readonly 'editor.table.addColumnAfter': "O‘ngga ustun qo‘shish";
141
- readonly 'editor.table.addColumnBefore': "Chapga ustun qo‘shish";
142
- readonly 'editor.table.addRowAfter': "Pastga qator qo‘shish";
143
- readonly 'editor.table.addRowBefore': "Yuqoriga qator qo‘shish";
144
- readonly 'editor.table.delete': "Jadvalni o‘chirish";
145
- readonly 'editor.table.deleteColumn': "Ustunni o‘chirish";
146
- readonly 'editor.table.deleteRow': "Qatorni o‘chirish";
147
- readonly 'editor.table.headerRow': "Sarlavha qatori";
148
- readonly 'editor.table.insert': "Jadval qo‘shish";
149
- readonly 'editor.table.mergeCells': "Kataklarni birlashtirish";
150
- readonly 'editor.table.pickSize': "O‘lchamni tanlang";
151
- readonly 'editor.table.splitCell': "Katakni ajratish";
152
- readonly 'editor.table.title': "Jadval";
153
- readonly 'editor.taskList': "Vazifalar ro‘yxati";
154
- readonly 'editor.textColor': "Matn rangi";
155
- readonly 'editor.textDirection': "Matn yo‘nalishi";
156
- readonly 'editor.textStyle': "Matn uslubi";
157
- readonly 'editor.toolbar': "Muharrir asboblari";
158
- readonly 'editor.underline': "Tagiga chizilgan";
159
- readonly 'editor.undo': "Bekor qilish";
160
- readonly 'editor.unlink': "Havolani olib tashlash";
161
- readonly 'editor.uploadImage': "Kompyuterdan yuklash";
162
- readonly 'editor.uploading': "Rasm yuklanmoqda…";
163
- readonly 'editor.view.page': "Sahifa ko‘rinishi";
164
- readonly 'editor.view.web': "Veb ko‘rinish";
165
- readonly 'editor.zoom': "Masshtab";
166
- readonly 'editor.zoomIn': "Kattalashtirish";
167
- readonly 'editor.zoomOut': "Kichraytirish";
168
- readonly 'editor.zoomReset': "100% ga qaytarish";
169
- };
170
- /** Every label key the editor uses. */
171
- export type EditorLabelKey = keyof typeof MESSAGES;
172
- /** Built-in label texts by key; `{name}` marks a placeholder filled in at translation time. */
173
- export declare const editorMessages: Readonly<Record<EditorLabelKey, string>>;
1
+ import { type EditorLabelKey } from './locales/uz';
2
+ export type { EditorLabelKey };
3
+ /** Languages the editor interface is available in. */
4
+ export type EditorLocaleCode = 'uz' | 'en' | 'ru';
174
5
  /**
175
- * Translates an editor label into the app's language; returning `undefined` keeps the built-in text.
176
- *
177
- * @param named Values for `{name}` placeholders in the message.
6
+ * A built-in interface language. Locales only select one of the translations shipped with the editor; the texts
7
+ * themselves cannot be changed from outside.
178
8
  */
179
- export type EditorTranslator = (key: EditorLabelKey, named?: Record<string, unknown>) => string | undefined;
180
- /** Registers the translator used for every editor label; calling it without arguments restores the built-in texts. */
181
- export declare const setEditorTranslator: (next?: EditorTranslator) => void;
9
+ export interface EditorLocale {
10
+ /** Language code. */
11
+ readonly code: EditorLocaleCode;
12
+ /** Name of the language in that language, for language pickers. */
13
+ readonly name: string;
14
+ }
15
+ /** A locale object, or just its code. */
16
+ export type EditorLocaleInput = EditorLocale | EditorLocaleCode;
17
+ /** Uzbek (Latin) interface. */
18
+ export declare const uzLocale: EditorLocale;
19
+ /** English interface. */
20
+ export declare const enLocale: EditorLocale;
21
+ /** Russian interface. */
22
+ export declare const ruLocale: EditorLocale;
23
+ /** Every built-in locale, in the order they are offered. */
24
+ export declare const editorLocales: ReadonlyArray<EditorLocale>;
25
+ /** Sets the interface language of every editor that does not choose its own with the `locale` prop. */
26
+ export declare const setEditorLocale: (locale: EditorLocaleInput) => void;
27
+ /** Formats a shortcut written as `Mod+Shift+K` for the current platform (`Ctrl+Shift+K` or `⌘⇧K`). */
28
+ export declare const formatShortcut: (shortcut: string) => string;
182
29
  /**
183
- * Translates an editor label, falling back to the built-in Uzbek text while the key has no translation.
30
+ * Label helpers in the editor's language. The root editor passes its `locale` prop and shares the result with its
31
+ * children; child components call it without arguments. Must be called during component setup.
184
32
  *
185
- * @param named Values for `{name}` placeholders in the message.
33
+ * @param locale Getter for the language chosen by this component; `undefined` inherits it.
186
34
  */
187
- export declare const t: (key: EditorLabelKey, named?: Record<string, unknown>) => string;
188
- /** Formats a shortcut written as `Mod+Shift+K` for the current platform (`Ctrl+Shift+K` or `⌘⇧K`). */
189
- export declare const formatShortcut: (shortcut: string) => string;
190
- /** Label followed by its keyboard shortcut in parentheses, for button tooltips. */
191
- export declare const withShortcut: (key: EditorLabelKey, shortcut: string) => string;
192
- export {};
35
+ export declare const useEditorLabels: (locale?: () => EditorLocaleInput | undefined) => {
36
+ t: (key: EditorLabelKey, named?: Record<string, unknown>) => string;
37
+ withShortcut: (key: EditorLabelKey, shortcut: string) => string;
38
+ };
@@ -0,0 +1,3 @@
1
+ import type { EditorLabelKey } from './uz';
2
+ /** English texts of the editor interface. */
3
+ export declare const en: Readonly<Record<EditorLabelKey, string>>;
@@ -0,0 +1,3 @@
1
+ import type { EditorLabelKey } from './uz';
2
+ /** Russian texts of the editor interface. */
3
+ export declare const ru: Readonly<Record<EditorLabelKey, string>>;
@@ -0,0 +1,171 @@
1
+ /** Uzbek (Latin) texts of the editor interface; `{name}` marks a placeholder filled in at translation time. */
2
+ export declare const uz: {
3
+ readonly 'editor.align': "Tekislash";
4
+ readonly 'editor.align.center': "Markazga";
5
+ readonly 'editor.align.justify': "Ikki tomonga";
6
+ readonly 'editor.align.left': "Chapga";
7
+ readonly 'editor.align.right': "O‘ngga";
8
+ readonly 'editor.apply': "Qo‘llash";
9
+ readonly 'editor.bold': "Qalin";
10
+ readonly 'editor.bulletList': "Belgili ro‘yxat";
11
+ readonly 'editor.case.lower': "kichik harflar";
12
+ readonly 'editor.case.sentence': "Gap boshi bosh harf";
13
+ readonly 'editor.case.title': "Har So‘z Bosh Harf";
14
+ readonly 'editor.case.toggle': "rEGISTRNI ALMASHTIRISH";
15
+ readonly 'editor.case.upper': "BOSH HARFLAR";
16
+ readonly 'editor.changeCase': "Harf registri";
17
+ readonly 'editor.clearFormatting': "Formatni tozalash";
18
+ readonly 'editor.close': "Yopish";
19
+ readonly 'editor.codeBlock': "Kod bloki";
20
+ readonly 'editor.colors.automatic': "Avtomatik";
21
+ readonly 'editor.colors.custom': "Boshqa rang…";
22
+ readonly 'editor.colors.none': "Rangsiz";
23
+ readonly 'editor.copy': "Nusxalash";
24
+ readonly 'editor.cut': "Kesish";
25
+ readonly 'editor.defaultFont': "Standart shrift";
26
+ readonly 'editor.defaultLineHeight': "Standart";
27
+ readonly 'editor.decreaseFontSize': "Shriftni kichraytirish";
28
+ readonly 'editor.defaultSize': "Standart o‘lcham";
29
+ readonly 'editor.delete': "O‘chirish";
30
+ readonly 'editor.direction.auto': "Avtomatik yo‘nalish";
31
+ readonly 'editor.direction.ltr': "Chapdan o‘ngga";
32
+ readonly 'editor.direction.rtl': "O‘ngdan chapga";
33
+ readonly 'editor.document': "Hujjat";
34
+ readonly 'editor.editLink': "Havolani tahrirlash";
35
+ readonly 'editor.enterFullscreen': "To‘liq ekran";
36
+ readonly 'editor.exitFullscreen': "To‘liq ekrandan chiqish";
37
+ readonly 'editor.exportHtml': "HTML sifatida yuklab olish";
38
+ readonly 'editor.exportWord': "Word (.doc) sifatida yuklab olish";
39
+ readonly 'editor.fitWidth': "Kenglikka moslash";
40
+ readonly 'editor.fontFamily': "Shrift";
41
+ readonly 'editor.fontSize': "Shrift o‘lchami";
42
+ readonly 'editor.footer': "Pastki kolontitul";
43
+ readonly 'editor.formatPainter': "Format bo‘yoqchasi";
44
+ readonly 'editor.formattingMarks': "Formatlash belgilari";
45
+ readonly 'editor.header': "Yuqori kolontitul";
46
+ readonly 'editor.headerFooter': "Kolontitullar";
47
+ readonly 'editor.headerFooter.center': "Markaz";
48
+ readonly 'editor.headerFooter.clear': "Tozalash";
49
+ readonly 'editor.headerFooter.hint': "Matn har bir sahifada takrorlanadi.";
50
+ readonly 'editor.headerFooter.left': "Chap";
51
+ readonly 'editor.headerFooter.right': "O‘ng";
52
+ readonly 'editor.headerFooter.token.date': "Sana";
53
+ readonly 'editor.headerFooter.token.page': "Sahifa raqami";
54
+ readonly 'editor.headerFooter.token.pages': "Sahifalar soni";
55
+ readonly 'editor.headerFooter.token.title': "Hujjat nomi";
56
+ readonly 'editor.headerFooter.tokens': "Qo‘shish:";
57
+ readonly 'editor.heading': "Sarlavha {level}";
58
+ readonly 'editor.highlight': "Belgilash rangi";
59
+ readonly 'editor.horizontalRule': "Gorizontal chiziq";
60
+ readonly 'editor.image': "Rasm";
61
+ readonly 'editor.imageAlt': "Muqobil matn (alt)";
62
+ readonly 'editor.imageReadError': "Rasmni o‘qib bo‘lmadi";
63
+ readonly 'editor.imageSizeError': "Rasm hajmi {size} MB dan oshmasligi kerak";
64
+ readonly 'editor.imageTypeError': "Faqat rasm fayllarini qo‘shish mumkin";
65
+ readonly 'editor.imageUploadError': "Rasmni yuklab bo‘lmadi";
66
+ readonly 'editor.increaseFontSize': "Shriftni kattalashtirish";
67
+ readonly 'editor.indent': "Chekinishni oshirish";
68
+ readonly 'editor.inlineCode': "Kod";
69
+ readonly 'editor.insert': "Qo‘shish";
70
+ readonly 'editor.insertDate': "Bugungi sana";
71
+ readonly 'editor.insertMore': "Boshqa elementlar";
72
+ readonly 'editor.italic': "Kursiv";
73
+ readonly 'editor.lineHeight': "Qator oralig‘i";
74
+ readonly 'editor.link': "Havola";
75
+ readonly 'editor.linkNewTab': "Yangi oynada ochish";
76
+ readonly 'editor.linkText': "Matn";
77
+ readonly 'editor.linkUrl': "Manzil (URL)";
78
+ readonly 'editor.more': "Yana";
79
+ readonly 'editor.moreFormatting': "Boshqa formatlar";
80
+ readonly 'editor.openLink': "Havolani ochish";
81
+ readonly 'editor.or': "yoki havola orqali";
82
+ readonly 'editor.orderedList': "Raqamli ro‘yxat";
83
+ readonly 'editor.outdent': "Chekinishni kamaytirish";
84
+ readonly 'editor.page.customMargins': "Aniq qiymatlar (mm)";
85
+ readonly 'editor.page.landscape': "Albom";
86
+ readonly 'editor.page.marginBottom': "Pastki";
87
+ readonly 'editor.page.marginLeft': "Chap";
88
+ readonly 'editor.page.marginRight': "O‘ng";
89
+ readonly 'editor.page.marginTop': "Yuqori";
90
+ readonly 'editor.page.margins': "Hoshiyalar";
91
+ readonly 'editor.page.margins.moderate': "O‘rtacha";
92
+ readonly 'editor.page.margins.narrow': "Tor";
93
+ readonly 'editor.page.margins.normal': "Oddiy";
94
+ readonly 'editor.page.margins.official': "Rasmiy hujjat";
95
+ readonly 'editor.page.margins.wide': "Keng";
96
+ readonly 'editor.page.orientation': "Yo‘nalish";
97
+ readonly 'editor.page.portrait': "Kitob";
98
+ readonly 'editor.page.setup': "Sahifa sozlamalari";
99
+ readonly 'editor.page.watermark': "Suv belgisi";
100
+ readonly 'editor.page.watermarkColor': "Rangi";
101
+ readonly 'editor.page.watermarkDiagonal': "Qiya";
102
+ readonly 'editor.page.watermarkText': "Matn, masalan NUSXA";
103
+ readonly 'editor.page.size': "Qog‘oz o‘lchami";
104
+ readonly 'editor.pageBreak': "Sahifa uzilishi";
105
+ readonly 'editor.paragraph': "Oddiy matn";
106
+ readonly 'editor.paste': "Joylashtirish";
107
+ readonly 'editor.placeholder': "Hujjat matnini kiriting…";
108
+ readonly 'editor.print': "Chop etish / PDF";
109
+ readonly 'editor.quote': "Iqtibos";
110
+ readonly 'editor.redo': "Qaytarish";
111
+ readonly 'editor.replace.all': "Barchasini";
112
+ readonly 'editor.replace.one': "Almashtirish";
113
+ readonly 'editor.replace.placeholder': "Almashtirish";
114
+ readonly 'editor.replace.toggle': "Almashtirishni ko‘rsatish";
115
+ readonly 'editor.ruler': "Chizg‘ich";
116
+ readonly 'editor.ruler.firstLine': "Birinchi qator chekinishi";
117
+ readonly 'editor.ruler.indentLeft': "Chap chekinish";
118
+ readonly 'editor.ruler.indentRight': "O‘ng chekinish";
119
+ readonly 'editor.ruler.marginLeft': "Chap hoshiya";
120
+ readonly 'editor.ruler.marginRight': "O‘ng hoshiya";
121
+ readonly 'editor.search.caseSensitive': "Katta-kichik harfni farqlash";
122
+ readonly 'editor.search.next': "Keyingisi";
123
+ readonly 'editor.search.placeholder': "Qidirish";
124
+ readonly 'editor.search.previous': "Oldingisi";
125
+ readonly 'editor.search.title': "Qidirish va almashtirish";
126
+ readonly 'editor.search.wholeWord': "Butun so‘z";
127
+ readonly 'editor.selectAll': "Barchasini tanlash";
128
+ readonly 'editor.source': "HTML kod";
129
+ readonly 'editor.spacing.addAfter': "Keyin bo‘sh joy qo‘shish";
130
+ readonly 'editor.spacing.addBefore': "Oldin bo‘sh joy qo‘shish";
131
+ readonly 'editor.spacing.removeAfter': "Keyingi bo‘sh joyni olib tashlash";
132
+ readonly 'editor.spacing.removeBefore': "Oldingi bo‘sh joyni olib tashlash";
133
+ readonly 'editor.specialCharacters': "Maxsus belgilar";
134
+ readonly 'editor.status.characters': "{count} belgi";
135
+ readonly 'editor.status.page': "Sahifa {current} / {total}";
136
+ readonly 'editor.status.words': "{count} so‘z";
137
+ readonly 'editor.strike': "Ustidan chizilgan";
138
+ readonly 'editor.subscript': "Pastki indeks";
139
+ readonly 'editor.superscript': "Yuqori indeks";
140
+ readonly 'editor.table.addColumnAfter': "O‘ngga ustun qo‘shish";
141
+ readonly 'editor.table.addColumnBefore': "Chapga ustun qo‘shish";
142
+ readonly 'editor.table.addRowAfter': "Pastga qator qo‘shish";
143
+ readonly 'editor.table.addRowBefore': "Yuqoriga qator qo‘shish";
144
+ readonly 'editor.table.delete': "Jadvalni o‘chirish";
145
+ readonly 'editor.table.deleteColumn': "Ustunni o‘chirish";
146
+ readonly 'editor.table.deleteRow': "Qatorni o‘chirish";
147
+ readonly 'editor.table.headerRow': "Sarlavha qatori";
148
+ readonly 'editor.table.insert': "Jadval qo‘shish";
149
+ readonly 'editor.table.mergeCells': "Kataklarni birlashtirish";
150
+ readonly 'editor.table.pickSize': "O‘lchamni tanlang";
151
+ readonly 'editor.table.splitCell': "Katakni ajratish";
152
+ readonly 'editor.table.title': "Jadval";
153
+ readonly 'editor.taskList': "Vazifalar ro‘yxati";
154
+ readonly 'editor.textColor': "Matn rangi";
155
+ readonly 'editor.textDirection': "Matn yo‘nalishi";
156
+ readonly 'editor.textStyle': "Matn uslubi";
157
+ readonly 'editor.toolbar': "Muharrir asboblari";
158
+ readonly 'editor.underline': "Tagiga chizilgan";
159
+ readonly 'editor.undo': "Bekor qilish";
160
+ readonly 'editor.unlink': "Havolani olib tashlash";
161
+ readonly 'editor.uploadImage': "Kompyuterdan yuklash";
162
+ readonly 'editor.uploading': "Rasm yuklanmoqda…";
163
+ readonly 'editor.view.page': "Sahifa ko‘rinishi";
164
+ readonly 'editor.view.web': "Veb ko‘rinish";
165
+ readonly 'editor.zoom': "Masshtab";
166
+ readonly 'editor.zoomIn': "Kattalashtirish";
167
+ readonly 'editor.zoomOut': "Kichraytirish";
168
+ readonly 'editor.zoomReset': "100% ga qaytarish";
169
+ };
170
+ /** Every label key the editor uses; the Uzbek texts are the reference set. */
171
+ export type EditorLabelKey = keyof typeof uz;
@@ -1,3 +1,4 @@
1
+ import type { EditorLocaleInput } from './core/labels';
1
2
  import type { DocumentImageUploadHandler } from './core/types';
2
3
  interface Props {
3
4
  /** Places the caret at the end of the content once the editor is ready. */
@@ -6,6 +7,8 @@ interface Props {
6
7
  canvasPadding?: number | string;
7
8
  /** Makes the content read-only and disables the toolbar. */
8
9
  disabled?: boolean;
10
+ /** Interface language: a built-in locale (`uz`, `en`, `ru`) or its code; defaults to the app-wide language. */
11
+ locale?: EditorLocaleInput;
9
12
  /** Height at which the field stops growing and starts scrolling. */
10
13
  maxHeight?: number | string;
11
14
  /** Largest accepted image file, in megabytes. */
@@ -43,6 +46,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
43
46
  maxHeight: number | string;
44
47
  autofocus: boolean;
45
48
  canvasPadding: number | string;
49
+ locale: EditorLocaleInput;
46
50
  maxImageSizeMb: number;
47
51
  uploadImage: DocumentImageUploadHandler;
48
52
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Public API of the document editor: the editor itself, its form-field wrapper (`Editor`), page settings, the image
3
- * upload contract, and label translation.
3
+ * upload contract, and the built-in interface languages.
4
4
  */
5
5
  export { default as DocumentEditor } from './components/document-editor.vue';
6
- export type { EditorLabelKey, EditorTranslator } from './core/labels';
7
- export { editorMessages, setEditorTranslator } from './core/labels';
6
+ export type { EditorLocale, EditorLocaleCode, EditorLocaleInput } from './core/labels';
7
+ export { editorLocales, enLocale as en, ruLocale as ru, setEditorLocale, uzLocale as uz } from './core/labels';
8
8
  export type { DocumentViewMode, PageHeaderFooter, PageMargins, PageOrientation, PageSettings, PageSizeKey, PageWatermark } from './core/page';
9
9
  export { createHeaderFooter, createPageSettings, createWatermark } from './core/page';
10
10
  export type { DocumentImageUploadHandler } from './core/types';