@djangocfg/ext-knowbase 1.0.21 → 1.0.23

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/dist/i18n.cjs ADDED
@@ -0,0 +1,164 @@
1
+ "use client";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/i18n/index.ts
21
+ var i18n_exports = {};
22
+ __export(i18n_exports, {
23
+ en: () => en,
24
+ ko: () => ko,
25
+ ru: () => ru,
26
+ useKnowbaseT: () => useKnowbaseT
27
+ });
28
+ module.exports = __toCommonJS(i18n_exports);
29
+
30
+ // src/i18n/useKnowbaseT.ts
31
+ var import_next_intl = require("next-intl");
32
+ var import_react = require("react");
33
+
34
+ // src/i18n/locales/en.ts
35
+ var en = {
36
+ chat: {
37
+ title: "Knowledge Assistant",
38
+ titleShort: "Support",
39
+ placeholder: "Ask me anything...",
40
+ enterToSend: "Press Enter to send, Shift+Enter for new line",
41
+ thinking: "Thinking...",
42
+ source: "Source {index}",
43
+ startConversation: "Start a Conversation",
44
+ startConversationDescription: "Ask me anything about the documentation, features, or get help with your project.",
45
+ openChat: "Open Support Chat"
46
+ },
47
+ sessions: {
48
+ title: "Chat Sessions",
49
+ description: "View and manage your chat history",
50
+ noSessions: "No Sessions Yet",
51
+ noSessionsDescription: "Start a new conversation to create your first session.",
52
+ untitled: "Untitled Session",
53
+ active: "Active",
54
+ archive: "Archive",
55
+ delete: "Delete",
56
+ loadingMore: "Loading more...",
57
+ noMore: "No more sessions",
58
+ newChat: "New Chat"
59
+ },
60
+ actions: {
61
+ sessions: "Sessions",
62
+ collapse: "Collapse",
63
+ expand: "Expand",
64
+ close: "Close"
65
+ }
66
+ };
67
+
68
+ // src/i18n/locales/ru.ts
69
+ var ru = {
70
+ chat: {
71
+ title: "\u0411\u0430\u0437\u0430 \u0437\u043D\u0430\u043D\u0438\u0439",
72
+ titleShort: "\u041F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430",
73
+ placeholder: "\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u0432\u043E\u043F\u0440\u043E\u0441...",
74
+ enterToSend: "Enter \u0434\u043B\u044F \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0438, Shift+Enter \u0434\u043B\u044F \u043D\u043E\u0432\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0438",
75
+ thinking: "\u0414\u0443\u043C\u0430\u044E...",
76
+ source: "\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A {index}",
77
+ startConversation: "\u041D\u0430\u0447\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440",
78
+ startConversationDescription: "\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u043B\u044E\u0431\u043E\u0439 \u0432\u043E\u043F\u0440\u043E\u0441 \u043E \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0438, \u0444\u0443\u043D\u043A\u0446\u0438\u044F\u0445 \u0438\u043B\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u0435 \u043F\u043E\u043C\u043E\u0449\u044C \u0441 \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C.",
79
+ openChat: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0447\u0430\u0442 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0438"
80
+ },
81
+ sessions: {
82
+ title: "\u0421\u0435\u0441\u0441\u0438\u0438 \u0447\u0430\u0442\u0430",
83
+ description: "\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0438\u0441\u0442\u043E\u0440\u0438\u0435\u0439 \u0447\u0430\u0442\u0430",
84
+ noSessions: "\u041D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439",
85
+ noSessionsDescription: "\u041D\u0430\u0447\u043D\u0438\u0442\u0435 \u043D\u043E\u0432\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u0443\u044E \u0441\u0435\u0441\u0441\u0438\u044E.",
86
+ untitled: "\u0411\u0435\u0437 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F",
87
+ active: "\u0410\u043A\u0442\u0438\u0432\u043D\u0430\u044F",
88
+ archive: "\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
89
+ delete: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
90
+ loadingMore: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...",
91
+ noMore: "\u0411\u043E\u043B\u044C\u0448\u0435 \u043D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439",
92
+ newChat: "\u041D\u043E\u0432\u044B\u0439 \u0447\u0430\u0442"
93
+ },
94
+ actions: {
95
+ sessions: "\u0421\u0435\u0441\u0441\u0438\u0438",
96
+ collapse: "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",
97
+ expand: "\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C",
98
+ close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C"
99
+ }
100
+ };
101
+
102
+ // src/i18n/locales/ko.ts
103
+ var ko = {
104
+ chat: {
105
+ title: "\uC9C0\uC2DD \uB3C4\uC6B0\uBBF8",
106
+ titleShort: "\uC9C0\uC6D0",
107
+ placeholder: "\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...",
108
+ enterToSend: "Enter\uB85C \uC804\uC1A1, Shift+Enter\uB85C \uC904\uBC14\uAFC8",
109
+ thinking: "\uC0DD\uAC01 \uC911...",
110
+ source: "\uCD9C\uCC98 {index}",
111
+ startConversation: "\uB300\uD654 \uC2DC\uC791\uD558\uAE30",
112
+ startConversationDescription: "\uBB38\uC11C, \uAE30\uB2A5\uC5D0 \uB300\uD574 \uC9C8\uBB38\uD558\uAC70\uB098 \uD504\uB85C\uC81D\uD2B8 \uB3C4\uC6C0\uC744 \uBC1B\uC73C\uC138\uC694.",
113
+ openChat: "\uC9C0\uC6D0 \uCC44\uD305 \uC5F4\uAE30"
114
+ },
115
+ sessions: {
116
+ title: "\uCC44\uD305 \uC138\uC158",
117
+ description: "\uCC44\uD305 \uAE30\uB85D \uBCF4\uAE30 \uBC0F \uAD00\uB9AC",
118
+ noSessions: "\uC138\uC158 \uC5C6\uC74C",
119
+ noSessionsDescription: "\uC0C8 \uB300\uD654\uB97C \uC2DC\uC791\uD558\uC5EC \uCCAB \uBC88\uC9F8 \uC138\uC158\uC744 \uB9CC\uB4DC\uC138\uC694.",
120
+ untitled: "\uC81C\uBAA9 \uC5C6\uC74C",
121
+ active: "\uD65C\uC131",
122
+ archive: "\uBCF4\uAD00",
123
+ delete: "\uC0AD\uC81C",
124
+ loadingMore: "\uBD88\uB7EC\uC624\uB294 \uC911...",
125
+ noMore: "\uB354 \uC774\uC0C1 \uC138\uC158 \uC5C6\uC74C",
126
+ newChat: "\uC0C8 \uCC44\uD305"
127
+ },
128
+ actions: {
129
+ sessions: "\uC138\uC158",
130
+ collapse: "\uCD95\uC18C",
131
+ expand: "\uD655\uC7A5",
132
+ close: "\uB2EB\uAE30"
133
+ }
134
+ };
135
+
136
+ // src/i18n/useKnowbaseT.ts
137
+ var translations = { en, ru, ko };
138
+ function getNestedValue(obj, path) {
139
+ const keys = path.split(".");
140
+ let result = obj;
141
+ for (const key of keys) {
142
+ if (result && typeof result === "object" && key in result) {
143
+ result = result[key];
144
+ } else {
145
+ return path;
146
+ }
147
+ }
148
+ return typeof result === "string" ? result : path;
149
+ }
150
+ function useKnowbaseT() {
151
+ const locale = (0, import_next_intl.useLocale)();
152
+ const t = (0, import_react.useMemo)(() => translations[locale] || translations.en, [locale]);
153
+ return (0, import_react.useCallback)(
154
+ (key) => getNestedValue(t, key),
155
+ [t]
156
+ );
157
+ }
158
+ // Annotate the CommonJS export names for ESM import in node:
159
+ 0 && (module.exports = {
160
+ en,
161
+ ko,
162
+ ru,
163
+ useKnowbaseT
164
+ });
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Knowbase Extension I18n Types
3
+ */
4
+ /**
5
+ * Helper type to get dot-notation paths from nested object
6
+ */
7
+ type PathKeys<T, Prefix extends string = ''> = T extends object ? {
8
+ [K in keyof T]: K extends string ? T[K] extends object ? PathKeys<T[K], `${Prefix}${K}.`> : `${Prefix}${K}` : never;
9
+ }[keyof T] : never;
10
+ /**
11
+ * Keys for knowbase translations
12
+ */
13
+ type KnowbaseLocalKeys = PathKeys<KnowbaseTranslations>;
14
+ interface KnowbaseTranslations {
15
+ /** Chat widget */
16
+ chat: {
17
+ title: string;
18
+ titleShort: string;
19
+ placeholder: string;
20
+ enterToSend: string;
21
+ thinking: string;
22
+ source: string;
23
+ startConversation: string;
24
+ startConversationDescription: string;
25
+ openChat: string;
26
+ };
27
+ /** Sessions */
28
+ sessions: {
29
+ title: string;
30
+ description: string;
31
+ noSessions: string;
32
+ noSessionsDescription: string;
33
+ untitled: string;
34
+ active: string;
35
+ archive: string;
36
+ delete: string;
37
+ loadingMore: string;
38
+ noMore: string;
39
+ newChat: string;
40
+ };
41
+ /** Actions */
42
+ actions: {
43
+ sessions: string;
44
+ collapse: string;
45
+ expand: string;
46
+ close: string;
47
+ };
48
+ }
49
+
50
+ /**
51
+ * Self-contained translation hook for knowbase extension
52
+ *
53
+ * Uses built-in translations based on current locale from next-intl.
54
+ * No need to add translations to app's i18n config.
55
+ *
56
+ * @example
57
+ * ```tsx
58
+ * function ChatWidget() {
59
+ * const t = useKnowbaseT();
60
+ * return <h1>{t('chat.title')}</h1>;
61
+ * }
62
+ * ```
63
+ */
64
+ declare function useKnowbaseT(): (key: KnowbaseLocalKeys) => string;
65
+
66
+ declare const en: KnowbaseTranslations;
67
+
68
+ declare const ru: KnowbaseTranslations;
69
+
70
+ declare const ko: KnowbaseTranslations;
71
+
72
+ export { type KnowbaseLocalKeys, type KnowbaseTranslations, en, ko, ru, useKnowbaseT };
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Knowbase Extension I18n Types
3
+ */
4
+ /**
5
+ * Helper type to get dot-notation paths from nested object
6
+ */
7
+ type PathKeys<T, Prefix extends string = ''> = T extends object ? {
8
+ [K in keyof T]: K extends string ? T[K] extends object ? PathKeys<T[K], `${Prefix}${K}.`> : `${Prefix}${K}` : never;
9
+ }[keyof T] : never;
10
+ /**
11
+ * Keys for knowbase translations
12
+ */
13
+ type KnowbaseLocalKeys = PathKeys<KnowbaseTranslations>;
14
+ interface KnowbaseTranslations {
15
+ /** Chat widget */
16
+ chat: {
17
+ title: string;
18
+ titleShort: string;
19
+ placeholder: string;
20
+ enterToSend: string;
21
+ thinking: string;
22
+ source: string;
23
+ startConversation: string;
24
+ startConversationDescription: string;
25
+ openChat: string;
26
+ };
27
+ /** Sessions */
28
+ sessions: {
29
+ title: string;
30
+ description: string;
31
+ noSessions: string;
32
+ noSessionsDescription: string;
33
+ untitled: string;
34
+ active: string;
35
+ archive: string;
36
+ delete: string;
37
+ loadingMore: string;
38
+ noMore: string;
39
+ newChat: string;
40
+ };
41
+ /** Actions */
42
+ actions: {
43
+ sessions: string;
44
+ collapse: string;
45
+ expand: string;
46
+ close: string;
47
+ };
48
+ }
49
+
50
+ /**
51
+ * Self-contained translation hook for knowbase extension
52
+ *
53
+ * Uses built-in translations based on current locale from next-intl.
54
+ * No need to add translations to app's i18n config.
55
+ *
56
+ * @example
57
+ * ```tsx
58
+ * function ChatWidget() {
59
+ * const t = useKnowbaseT();
60
+ * return <h1>{t('chat.title')}</h1>;
61
+ * }
62
+ * ```
63
+ */
64
+ declare function useKnowbaseT(): (key: KnowbaseLocalKeys) => string;
65
+
66
+ declare const en: KnowbaseTranslations;
67
+
68
+ declare const ru: KnowbaseTranslations;
69
+
70
+ declare const ko: KnowbaseTranslations;
71
+
72
+ export { type KnowbaseLocalKeys, type KnowbaseTranslations, en, ko, ru, useKnowbaseT };
package/dist/i18n.js ADDED
@@ -0,0 +1,136 @@
1
+ "use client";
2
+
3
+ // src/i18n/useKnowbaseT.ts
4
+ import { useLocale } from "next-intl";
5
+ import { useMemo, useCallback } from "react";
6
+
7
+ // src/i18n/locales/en.ts
8
+ var en = {
9
+ chat: {
10
+ title: "Knowledge Assistant",
11
+ titleShort: "Support",
12
+ placeholder: "Ask me anything...",
13
+ enterToSend: "Press Enter to send, Shift+Enter for new line",
14
+ thinking: "Thinking...",
15
+ source: "Source {index}",
16
+ startConversation: "Start a Conversation",
17
+ startConversationDescription: "Ask me anything about the documentation, features, or get help with your project.",
18
+ openChat: "Open Support Chat"
19
+ },
20
+ sessions: {
21
+ title: "Chat Sessions",
22
+ description: "View and manage your chat history",
23
+ noSessions: "No Sessions Yet",
24
+ noSessionsDescription: "Start a new conversation to create your first session.",
25
+ untitled: "Untitled Session",
26
+ active: "Active",
27
+ archive: "Archive",
28
+ delete: "Delete",
29
+ loadingMore: "Loading more...",
30
+ noMore: "No more sessions",
31
+ newChat: "New Chat"
32
+ },
33
+ actions: {
34
+ sessions: "Sessions",
35
+ collapse: "Collapse",
36
+ expand: "Expand",
37
+ close: "Close"
38
+ }
39
+ };
40
+
41
+ // src/i18n/locales/ru.ts
42
+ var ru = {
43
+ chat: {
44
+ title: "\u0411\u0430\u0437\u0430 \u0437\u043D\u0430\u043D\u0438\u0439",
45
+ titleShort: "\u041F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430",
46
+ placeholder: "\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u0432\u043E\u043F\u0440\u043E\u0441...",
47
+ enterToSend: "Enter \u0434\u043B\u044F \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0438, Shift+Enter \u0434\u043B\u044F \u043D\u043E\u0432\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0438",
48
+ thinking: "\u0414\u0443\u043C\u0430\u044E...",
49
+ source: "\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A {index}",
50
+ startConversation: "\u041D\u0430\u0447\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440",
51
+ startConversationDescription: "\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u043B\u044E\u0431\u043E\u0439 \u0432\u043E\u043F\u0440\u043E\u0441 \u043E \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0438, \u0444\u0443\u043D\u043A\u0446\u0438\u044F\u0445 \u0438\u043B\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u0435 \u043F\u043E\u043C\u043E\u0449\u044C \u0441 \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C.",
52
+ openChat: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0447\u0430\u0442 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0438"
53
+ },
54
+ sessions: {
55
+ title: "\u0421\u0435\u0441\u0441\u0438\u0438 \u0447\u0430\u0442\u0430",
56
+ description: "\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0438\u0441\u0442\u043E\u0440\u0438\u0435\u0439 \u0447\u0430\u0442\u0430",
57
+ noSessions: "\u041D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439",
58
+ noSessionsDescription: "\u041D\u0430\u0447\u043D\u0438\u0442\u0435 \u043D\u043E\u0432\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u0443\u044E \u0441\u0435\u0441\u0441\u0438\u044E.",
59
+ untitled: "\u0411\u0435\u0437 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F",
60
+ active: "\u0410\u043A\u0442\u0438\u0432\u043D\u0430\u044F",
61
+ archive: "\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
62
+ delete: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
63
+ loadingMore: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...",
64
+ noMore: "\u0411\u043E\u043B\u044C\u0448\u0435 \u043D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439",
65
+ newChat: "\u041D\u043E\u0432\u044B\u0439 \u0447\u0430\u0442"
66
+ },
67
+ actions: {
68
+ sessions: "\u0421\u0435\u0441\u0441\u0438\u0438",
69
+ collapse: "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",
70
+ expand: "\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C",
71
+ close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C"
72
+ }
73
+ };
74
+
75
+ // src/i18n/locales/ko.ts
76
+ var ko = {
77
+ chat: {
78
+ title: "\uC9C0\uC2DD \uB3C4\uC6B0\uBBF8",
79
+ titleShort: "\uC9C0\uC6D0",
80
+ placeholder: "\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...",
81
+ enterToSend: "Enter\uB85C \uC804\uC1A1, Shift+Enter\uB85C \uC904\uBC14\uAFC8",
82
+ thinking: "\uC0DD\uAC01 \uC911...",
83
+ source: "\uCD9C\uCC98 {index}",
84
+ startConversation: "\uB300\uD654 \uC2DC\uC791\uD558\uAE30",
85
+ startConversationDescription: "\uBB38\uC11C, \uAE30\uB2A5\uC5D0 \uB300\uD574 \uC9C8\uBB38\uD558\uAC70\uB098 \uD504\uB85C\uC81D\uD2B8 \uB3C4\uC6C0\uC744 \uBC1B\uC73C\uC138\uC694.",
86
+ openChat: "\uC9C0\uC6D0 \uCC44\uD305 \uC5F4\uAE30"
87
+ },
88
+ sessions: {
89
+ title: "\uCC44\uD305 \uC138\uC158",
90
+ description: "\uCC44\uD305 \uAE30\uB85D \uBCF4\uAE30 \uBC0F \uAD00\uB9AC",
91
+ noSessions: "\uC138\uC158 \uC5C6\uC74C",
92
+ noSessionsDescription: "\uC0C8 \uB300\uD654\uB97C \uC2DC\uC791\uD558\uC5EC \uCCAB \uBC88\uC9F8 \uC138\uC158\uC744 \uB9CC\uB4DC\uC138\uC694.",
93
+ untitled: "\uC81C\uBAA9 \uC5C6\uC74C",
94
+ active: "\uD65C\uC131",
95
+ archive: "\uBCF4\uAD00",
96
+ delete: "\uC0AD\uC81C",
97
+ loadingMore: "\uBD88\uB7EC\uC624\uB294 \uC911...",
98
+ noMore: "\uB354 \uC774\uC0C1 \uC138\uC158 \uC5C6\uC74C",
99
+ newChat: "\uC0C8 \uCC44\uD305"
100
+ },
101
+ actions: {
102
+ sessions: "\uC138\uC158",
103
+ collapse: "\uCD95\uC18C",
104
+ expand: "\uD655\uC7A5",
105
+ close: "\uB2EB\uAE30"
106
+ }
107
+ };
108
+
109
+ // src/i18n/useKnowbaseT.ts
110
+ var translations = { en, ru, ko };
111
+ function getNestedValue(obj, path) {
112
+ const keys = path.split(".");
113
+ let result = obj;
114
+ for (const key of keys) {
115
+ if (result && typeof result === "object" && key in result) {
116
+ result = result[key];
117
+ } else {
118
+ return path;
119
+ }
120
+ }
121
+ return typeof result === "string" ? result : path;
122
+ }
123
+ function useKnowbaseT() {
124
+ const locale = useLocale();
125
+ const t = useMemo(() => translations[locale] || translations.en, [locale]);
126
+ return useCallback(
127
+ (key) => getNestedValue(t, key),
128
+ [t]
129
+ );
130
+ }
131
+ export {
132
+ en,
133
+ ko,
134
+ ru,
135
+ useKnowbaseT
136
+ };
package/dist/index.cjs CHANGED
@@ -4369,7 +4369,7 @@ var apiKnowbase = api.createExtensionAPI(API);
4369
4369
  // package.json
4370
4370
  var package_default = {
4371
4371
  name: "@djangocfg/ext-knowbase",
4372
- version: "1.0.21",
4372
+ version: "1.0.23",
4373
4373
  description: "Knowledge base and chat extension for DjangoCFG",
4374
4374
  keywords: [
4375
4375
  "django",
@@ -4415,6 +4415,11 @@ var package_default = {
4415
4415
  types: "./dist/config.d.ts",
4416
4416
  import: "./dist/config.js",
4417
4417
  require: "./dist/config.cjs"
4418
+ },
4419
+ "./i18n": {
4420
+ types: "./dist/i18n.d.ts",
4421
+ import: "./dist/i18n.js",
4422
+ require: "./dist/i18n.cjs"
4418
4423
  }
4419
4424
  },
4420
4425
  files: [
@@ -4430,27 +4435,31 @@ var package_default = {
4430
4435
  peerDependencies: {
4431
4436
  "@djangocfg/api": "workspace:*",
4432
4437
  "@djangocfg/ext-base": "workspace:*",
4438
+ "@djangocfg/i18n": "workspace:*",
4433
4439
  "@djangocfg/ui-core": "workspace:*",
4434
4440
  "@djangocfg/ui-nextjs": "workspace:*",
4435
4441
  consola: "^3.4.2",
4436
4442
  "lucide-react": "^0.545.0",
4443
+ moment: "^2.30.1",
4437
4444
  next: "^16",
4445
+ "next-intl": "^4",
4438
4446
  "p-retry": "^7.0.0",
4439
4447
  react: "^19",
4440
4448
  "react-dom": "^19",
4441
4449
  "react-markdown": "^9.0.0 || ^10.0.0",
4442
4450
  swr: "^2.3.7",
4443
- zod: "^4.3.4",
4444
- moment: "^2.30.1"
4451
+ zod: "^4.3.4"
4445
4452
  },
4446
4453
  devDependencies: {
4447
4454
  "@djangocfg/api": "workspace:*",
4448
4455
  "@djangocfg/ext-base": "workspace:*",
4456
+ "@djangocfg/i18n": "workspace:*",
4449
4457
  "@djangocfg/ui-core": "workspace:*",
4450
4458
  "@djangocfg/typescript-config": "workspace:*",
4451
4459
  "@types/node": "^24.7.2",
4452
4460
  "@types/react": "^19.0.0",
4453
4461
  consola: "^3.4.2",
4462
+ "next-intl": "^4.1.0",
4454
4463
  "p-retry": "^7.0.0",
4455
4464
  swr: "^2.3.7",
4456
4465
  tsup: "^8.5.0",
package/dist/index.js CHANGED
@@ -4363,7 +4363,7 @@ var apiKnowbase = createExtensionAPI(API);
4363
4363
  // package.json
4364
4364
  var package_default = {
4365
4365
  name: "@djangocfg/ext-knowbase",
4366
- version: "1.0.21",
4366
+ version: "1.0.23",
4367
4367
  description: "Knowledge base and chat extension for DjangoCFG",
4368
4368
  keywords: [
4369
4369
  "django",
@@ -4409,6 +4409,11 @@ var package_default = {
4409
4409
  types: "./dist/config.d.ts",
4410
4410
  import: "./dist/config.js",
4411
4411
  require: "./dist/config.cjs"
4412
+ },
4413
+ "./i18n": {
4414
+ types: "./dist/i18n.d.ts",
4415
+ import: "./dist/i18n.js",
4416
+ require: "./dist/i18n.cjs"
4412
4417
  }
4413
4418
  },
4414
4419
  files: [
@@ -4424,27 +4429,31 @@ var package_default = {
4424
4429
  peerDependencies: {
4425
4430
  "@djangocfg/api": "workspace:*",
4426
4431
  "@djangocfg/ext-base": "workspace:*",
4432
+ "@djangocfg/i18n": "workspace:*",
4427
4433
  "@djangocfg/ui-core": "workspace:*",
4428
4434
  "@djangocfg/ui-nextjs": "workspace:*",
4429
4435
  consola: "^3.4.2",
4430
4436
  "lucide-react": "^0.545.0",
4437
+ moment: "^2.30.1",
4431
4438
  next: "^16",
4439
+ "next-intl": "^4",
4432
4440
  "p-retry": "^7.0.0",
4433
4441
  react: "^19",
4434
4442
  "react-dom": "^19",
4435
4443
  "react-markdown": "^9.0.0 || ^10.0.0",
4436
4444
  swr: "^2.3.7",
4437
- zod: "^4.3.4",
4438
- moment: "^2.30.1"
4445
+ zod: "^4.3.4"
4439
4446
  },
4440
4447
  devDependencies: {
4441
4448
  "@djangocfg/api": "workspace:*",
4442
4449
  "@djangocfg/ext-base": "workspace:*",
4450
+ "@djangocfg/i18n": "workspace:*",
4443
4451
  "@djangocfg/ui-core": "workspace:*",
4444
4452
  "@djangocfg/typescript-config": "workspace:*",
4445
4453
  "@types/node": "^24.7.2",
4446
4454
  "@types/react": "^19.0.0",
4447
4455
  consola: "^3.4.2",
4456
+ "next-intl": "^4.1.0",
4448
4457
  "p-retry": "^7.0.0",
4449
4458
  swr: "^2.3.7",
4450
4459
  tsup: "^8.5.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/ext-knowbase",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Knowledge base and chat extension for DjangoCFG",
5
5
  "keywords": [
6
6
  "django",
@@ -46,6 +46,11 @@
46
46
  "types": "./dist/config.d.ts",
47
47
  "import": "./dist/config.js",
48
48
  "require": "./dist/config.cjs"
49
+ },
50
+ "./i18n": {
51
+ "types": "./dist/i18n.d.ts",
52
+ "import": "./dist/i18n.js",
53
+ "require": "./dist/i18n.cjs"
49
54
  }
50
55
  },
51
56
  "files": [
@@ -59,29 +64,33 @@
59
64
  "check": "tsc --noEmit"
60
65
  },
61
66
  "peerDependencies": {
62
- "@djangocfg/api": "^2.1.109",
63
- "@djangocfg/ext-base": "^1.0.16",
64
- "@djangocfg/ui-core": "^2.1.109",
65
- "@djangocfg/ui-nextjs": "^2.1.109",
67
+ "@djangocfg/api": "^2.1.124",
68
+ "@djangocfg/ext-base": "^1.0.18",
69
+ "@djangocfg/i18n": "^2.1.124",
70
+ "@djangocfg/ui-core": "^2.1.124",
71
+ "@djangocfg/ui-nextjs": "^2.1.124",
66
72
  "consola": "^3.4.2",
67
73
  "lucide-react": "^0.545.0",
74
+ "moment": "^2.30.1",
68
75
  "next": "^16",
76
+ "next-intl": "^4",
69
77
  "p-retry": "^7.0.0",
70
78
  "react": "^19",
71
79
  "react-dom": "^19",
72
80
  "react-markdown": "^9.0.0 || ^10.0.0",
73
81
  "swr": "^2.3.7",
74
- "zod": "^4.3.4",
75
- "moment": "^2.30.1"
82
+ "zod": "^4.3.4"
76
83
  },
77
84
  "devDependencies": {
78
- "@djangocfg/api": "^2.1.109",
79
- "@djangocfg/ext-base": "^1.0.16",
80
- "@djangocfg/ui-core": "^2.1.109",
81
- "@djangocfg/typescript-config": "^2.1.109",
85
+ "@djangocfg/api": "^2.1.124",
86
+ "@djangocfg/ext-base": "^1.0.18",
87
+ "@djangocfg/i18n": "^2.1.124",
88
+ "@djangocfg/ui-core": "^2.1.124",
89
+ "@djangocfg/typescript-config": "^2.1.124",
82
90
  "@types/node": "^24.7.2",
83
91
  "@types/react": "^19.0.0",
84
92
  "consola": "^3.4.2",
93
+ "next-intl": "^4.1.0",
85
94
  "p-retry": "^7.0.0",
86
95
  "swr": "^2.3.7",
87
96
  "tsup": "^8.5.0",