@djangocfg/ext-support 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,266 @@
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
+ useSupportT: () => useSupportT
27
+ });
28
+ module.exports = __toCommonJS(i18n_exports);
29
+
30
+ // src/i18n/useSupportT.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
+ layout: {
37
+ title: "Support Center",
38
+ titleShort: "Support",
39
+ subtitle: "Get help from our support team",
40
+ newTicket: "New Ticket"
41
+ },
42
+ status: {
43
+ open: "Open",
44
+ waitingForUser: "Waiting for you",
45
+ waitingForAdmin: "Waiting for support",
46
+ resolved: "Resolved",
47
+ closed: "Closed"
48
+ },
49
+ ticketList: {
50
+ noTickets: "No tickets yet",
51
+ noTicketsDescription: "Create your first support ticket to get help",
52
+ loadingMore: "Loading more...",
53
+ loadMore: "Load more",
54
+ allLoaded: "All {count} tickets loaded"
55
+ },
56
+ createTicket: {
57
+ title: "New Support Ticket",
58
+ description: "Describe your issue and we will help you",
59
+ subjectLabel: "Subject",
60
+ subjectPlaceholder: "Brief description of your issue",
61
+ messageLabel: "Message",
62
+ messagePlaceholder: "Describe your issue in detail...",
63
+ cancel: "Cancel",
64
+ creating: "Creating...",
65
+ create: "Create Ticket"
66
+ },
67
+ validation: {
68
+ subjectRequired: "Subject is required",
69
+ subjectTooLong: "Subject is too long (max 200 characters)",
70
+ messageRequired: "Message is required",
71
+ messageTooLong: "Message is too long (max 5000 characters)"
72
+ },
73
+ messages: {
74
+ ticketCreated: "Ticket created successfully",
75
+ ticketCreateFailed: "Failed to create ticket",
76
+ messageSent: "Message sent",
77
+ messageSendFailed: "Failed to send message"
78
+ },
79
+ messageInput: {
80
+ placeholder: "Type your message...",
81
+ ticketClosed: "Ticket closed",
82
+ ticketClosedDescription: "This ticket has been closed. Create a new ticket if you need further assistance."
83
+ },
84
+ messageList: {
85
+ noTicketSelected: "No ticket selected",
86
+ noTicketSelectedDescription: "Select a ticket from the list to view messages",
87
+ noMessages: "No messages yet",
88
+ noMessagesDescription: "Start the conversation by sending a message",
89
+ loadingOlder: "Loading older messages...",
90
+ loadOlder: "Load older messages",
91
+ supportTeam: "Support Team",
92
+ staff: "Staff"
93
+ },
94
+ time: {
95
+ justNow: "Just now",
96
+ minutesAgo: "{count} min ago",
97
+ hoursAgo: "{count}h ago",
98
+ daysAgo: "{count}d ago"
99
+ }
100
+ };
101
+
102
+ // src/i18n/locales/ru.ts
103
+ var ru = {
104
+ layout: {
105
+ title: "\u0426\u0435\u043D\u0442\u0440 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0438",
106
+ titleShort: "\u041F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430",
107
+ subtitle: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u0435 \u043F\u043E\u043C\u043E\u0449\u044C \u043E\u0442 \u043D\u0430\u0448\u0435\u0439 \u043A\u043E\u043C\u0430\u043D\u0434\u044B \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0438",
108
+ newTicket: "\u041D\u043E\u0432\u043E\u0435 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435"
109
+ },
110
+ status: {
111
+ open: "\u041E\u0442\u043A\u0440\u044B\u0442",
112
+ waitingForUser: "\u041E\u0436\u0438\u0434\u0430\u0435\u0442 \u0432\u0430\u0441",
113
+ waitingForAdmin: "\u041E\u0436\u0438\u0434\u0430\u0435\u0442 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0443",
114
+ resolved: "\u0420\u0435\u0448\u0451\u043D",
115
+ closed: "\u0417\u0430\u043A\u0440\u044B\u0442"
116
+ },
117
+ ticketList: {
118
+ noTickets: "\u041D\u0435\u0442 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0439",
119
+ noTicketsDescription: "\u0421\u043E\u0437\u0434\u0430\u0439\u0442\u0435 \u043F\u0435\u0440\u0432\u043E\u0435 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043F\u043E\u043C\u043E\u0449\u044C",
120
+ loadingMore: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...",
121
+ loadMore: "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0435\u0449\u0451",
122
+ allLoaded: "\u0412\u0441\u0435 {count} \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043E"
123
+ },
124
+ createTicket: {
125
+ title: "\u041D\u043E\u0432\u043E\u0435 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435",
126
+ description: "\u041E\u043F\u0438\u0448\u0438\u0442\u0435 \u0432\u0430\u0448\u0443 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443, \u0438 \u043C\u044B \u043F\u043E\u043C\u043E\u0436\u0435\u043C \u0432\u0430\u043C",
127
+ subjectLabel: "\u0422\u0435\u043C\u0430",
128
+ subjectPlaceholder: "\u041A\u0440\u0430\u0442\u043A\u043E\u0435 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B",
129
+ messageLabel: "\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435",
130
+ messagePlaceholder: "\u041E\u043F\u0438\u0448\u0438\u0442\u0435 \u0432\u0430\u0448\u0443 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E...",
131
+ cancel: "\u041E\u0442\u043C\u0435\u043D\u0430",
132
+ creating: "\u0421\u043E\u0437\u0434\u0430\u043D\u0438\u0435...",
133
+ create: "\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435"
134
+ },
135
+ validation: {
136
+ subjectRequired: "\u0422\u0435\u043C\u0430 \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u0430",
137
+ subjectTooLong: "\u0422\u0435\u043C\u0430 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0434\u043B\u0438\u043D\u043D\u0430\u044F (\u043C\u0430\u043A\u0441. 200 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432)",
138
+ messageRequired: "\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E",
139
+ messageTooLong: "\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0434\u043B\u0438\u043D\u043D\u043E\u0435 (\u043C\u0430\u043A\u0441. 5000 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432)"
140
+ },
141
+ messages: {
142
+ ticketCreated: "\u041E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0441\u043E\u0437\u0434\u0430\u043D\u043E",
143
+ ticketCreateFailed: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435",
144
+ messageSent: "\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E",
145
+ messageSendFailed: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435"
146
+ },
147
+ messageInput: {
148
+ placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435...",
149
+ ticketClosed: "\u041E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0437\u0430\u043A\u0440\u044B\u0442\u043E",
150
+ ticketClosedDescription: "\u042D\u0442\u043E \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0437\u0430\u043A\u0440\u044B\u0442\u043E. \u0421\u043E\u0437\u0434\u0430\u0439\u0442\u0435 \u043D\u043E\u0432\u043E\u0435, \u0435\u0441\u043B\u0438 \u0432\u0430\u043C \u043D\u0443\u0436\u043D\u0430 \u043F\u043E\u043C\u043E\u0449\u044C."
151
+ },
152
+ messageList: {
153
+ noTicketSelected: "\u041E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E",
154
+ noTicketSelectedDescription: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0434\u043B\u044F \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439",
155
+ noMessages: "\u041D\u0435\u0442 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439",
156
+ noMessagesDescription: "\u041D\u0430\u0447\u043D\u0438\u0442\u0435 \u0434\u0438\u0430\u043B\u043E\u0433, \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0432 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435",
157
+ loadingOlder: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0441\u0442\u0430\u0440\u044B\u0445 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439...",
158
+ loadOlder: "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0441\u0442\u0430\u0440\u044B\u0435",
159
+ supportTeam: "\u0421\u043B\u0443\u0436\u0431\u0430 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0438",
160
+ staff: "\u0421\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A"
161
+ },
162
+ time: {
163
+ justNow: "\u0422\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u043E",
164
+ minutesAgo: "{count} \u043C\u0438\u043D \u043D\u0430\u0437\u0430\u0434",
165
+ hoursAgo: "{count}\u0447 \u043D\u0430\u0437\u0430\u0434",
166
+ daysAgo: "{count}\u0434 \u043D\u0430\u0437\u0430\u0434"
167
+ }
168
+ };
169
+
170
+ // src/i18n/locales/ko.ts
171
+ var ko = {
172
+ layout: {
173
+ title: "\uACE0\uAC1D\uC9C0\uC6D0 \uC13C\uD130",
174
+ titleShort: "\uACE0\uAC1D\uC9C0\uC6D0",
175
+ subtitle: "\uACE0\uAC1D\uC9C0\uC6D0\uD300\uC758 \uB3C4\uC6C0\uC744 \uBC1B\uC73C\uC138\uC694",
176
+ newTicket: "\uC0C8 \uBB38\uC758"
177
+ },
178
+ status: {
179
+ open: "\uC5F4\uB9BC",
180
+ waitingForUser: "\uD68C\uC2E0 \uB300\uAE30",
181
+ waitingForAdmin: "\uC9C0\uC6D0\uD300 \uB300\uAE30",
182
+ resolved: "\uD574\uACB0\uB428",
183
+ closed: "\uC885\uB8CC"
184
+ },
185
+ ticketList: {
186
+ noTickets: "\uBB38\uC758 \uB0B4\uC5ED \uC5C6\uC74C",
187
+ noTicketsDescription: "\uCCAB \uBC88\uC9F8 \uBB38\uC758\uB97C \uB4F1\uB85D\uD558\uC5EC \uB3C4\uC6C0\uC744 \uBC1B\uC73C\uC138\uC694",
188
+ loadingMore: "\uBD88\uB7EC\uC624\uB294 \uC911...",
189
+ loadMore: "\uB354 \uBCF4\uAE30",
190
+ allLoaded: "\uCD1D {count}\uAC1C\uC758 \uBB38\uC758\uAC00 \uB85C\uB4DC\uB428"
191
+ },
192
+ createTicket: {
193
+ title: "\uC0C8 \uBB38\uC758",
194
+ description: "\uBB38\uC81C\uB97C \uC124\uBA85\uD574 \uC8FC\uC2DC\uBA74 \uB3C4\uC6C0\uC744 \uB4DC\uB9AC\uACA0\uC2B5\uB2C8\uB2E4",
195
+ subjectLabel: "\uC81C\uBAA9",
196
+ subjectPlaceholder: "\uBB38\uC81C\uC5D0 \uB300\uD55C \uAC04\uB7B5\uD55C \uC124\uBA85",
197
+ messageLabel: "\uB0B4\uC6A9",
198
+ messagePlaceholder: "\uBB38\uC81C\uB97C \uC790\uC138\uD788 \uC124\uBA85\uD574 \uC8FC\uC138\uC694...",
199
+ cancel: "\uCDE8\uC18C",
200
+ creating: "\uC0DD\uC131 \uC911...",
201
+ create: "\uBB38\uC758 \uB4F1\uB85D"
202
+ },
203
+ validation: {
204
+ subjectRequired: "\uC81C\uBAA9\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694",
205
+ subjectTooLong: "\uC81C\uBAA9\uC774 \uB108\uBB34 \uAE41\uB2C8\uB2E4 (\uCD5C\uB300 200\uC790)",
206
+ messageRequired: "\uB0B4\uC6A9\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694",
207
+ messageTooLong: "\uB0B4\uC6A9\uC774 \uB108\uBB34 \uAE41\uB2C8\uB2E4 (\uCD5C\uB300 5000\uC790)"
208
+ },
209
+ messages: {
210
+ ticketCreated: "\uBB38\uC758\uAC00 \uB4F1\uB85D\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
211
+ ticketCreateFailed: "\uBB38\uC758 \uB4F1\uB85D\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4",
212
+ messageSent: "\uBA54\uC2DC\uC9C0\uAC00 \uC804\uC1A1\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
213
+ messageSendFailed: "\uBA54\uC2DC\uC9C0 \uC804\uC1A1\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4"
214
+ },
215
+ messageInput: {
216
+ placeholder: "\uBA54\uC2DC\uC9C0\uB97C \uC785\uB825\uD558\uC138\uC694...",
217
+ ticketClosed: "\uBB38\uC758 \uC885\uB8CC\uB428",
218
+ ticketClosedDescription: "\uC774 \uBB38\uC758\uB294 \uC885\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uCD94\uAC00 \uB3C4\uC6C0\uC774 \uD544\uC694\uD558\uC2DC\uBA74 \uC0C8 \uBB38\uC758\uB97C \uB4F1\uB85D\uD574 \uC8FC\uC138\uC694."
219
+ },
220
+ messageList: {
221
+ noTicketSelected: "\uBB38\uC758\uAC00 \uC120\uD0DD\uB418\uC9C0 \uC54A\uC74C",
222
+ noTicketSelectedDescription: "\uBA54\uC2DC\uC9C0\uB97C \uBCF4\uB824\uBA74 \uBAA9\uB85D\uC5D0\uC11C \uBB38\uC758\uB97C \uC120\uD0DD\uD558\uC138\uC694",
223
+ noMessages: "\uBA54\uC2DC\uC9C0 \uC5C6\uC74C",
224
+ noMessagesDescription: "\uBA54\uC2DC\uC9C0\uB97C \uBCF4\uB0B4 \uB300\uD654\uB97C \uC2DC\uC791\uD558\uC138\uC694",
225
+ loadingOlder: "\uC774\uC804 \uBA54\uC2DC\uC9C0 \uBD88\uB7EC\uC624\uB294 \uC911...",
226
+ loadOlder: "\uC774\uC804 \uBA54\uC2DC\uC9C0 \uBCF4\uAE30",
227
+ supportTeam: "\uACE0\uAC1D\uC9C0\uC6D0\uD300",
228
+ staff: "\uB2F4\uB2F9\uC790"
229
+ },
230
+ time: {
231
+ justNow: "\uBC29\uAE08 \uC804",
232
+ minutesAgo: "{count}\uBD84 \uC804",
233
+ hoursAgo: "{count}\uC2DC\uAC04 \uC804",
234
+ daysAgo: "{count}\uC77C \uC804"
235
+ }
236
+ };
237
+
238
+ // src/i18n/useSupportT.ts
239
+ var translations = { en, ru, ko };
240
+ function getNestedValue(obj, path) {
241
+ const keys = path.split(".");
242
+ let result = obj;
243
+ for (const key of keys) {
244
+ if (result && typeof result === "object" && key in result) {
245
+ result = result[key];
246
+ } else {
247
+ return path;
248
+ }
249
+ }
250
+ return typeof result === "string" ? result : path;
251
+ }
252
+ function useSupportT() {
253
+ const locale = (0, import_next_intl.useLocale)();
254
+ const t = (0, import_react.useMemo)(() => translations[locale] || translations.en, [locale]);
255
+ return (0, import_react.useCallback)(
256
+ (key) => getNestedValue(t, key),
257
+ [t]
258
+ );
259
+ }
260
+ // Annotate the CommonJS export names for ESM import in node:
261
+ 0 && (module.exports = {
262
+ en,
263
+ ko,
264
+ ru,
265
+ useSupportT
266
+ });
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Support 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 support translations
12
+ */
13
+ type SupportLocalKeys = PathKeys<SupportTranslations>;
14
+ interface SupportTranslations {
15
+ /** Layout */
16
+ layout: {
17
+ title: string;
18
+ titleShort: string;
19
+ subtitle: string;
20
+ newTicket: string;
21
+ };
22
+ /** Ticket statuses */
23
+ status: {
24
+ open: string;
25
+ waitingForUser: string;
26
+ waitingForAdmin: string;
27
+ resolved: string;
28
+ closed: string;
29
+ };
30
+ /** Ticket list */
31
+ ticketList: {
32
+ noTickets: string;
33
+ noTicketsDescription: string;
34
+ loadingMore: string;
35
+ loadMore: string;
36
+ allLoaded: string;
37
+ };
38
+ /** Create ticket dialog */
39
+ createTicket: {
40
+ title: string;
41
+ description: string;
42
+ subjectLabel: string;
43
+ subjectPlaceholder: string;
44
+ messageLabel: string;
45
+ messagePlaceholder: string;
46
+ cancel: string;
47
+ creating: string;
48
+ create: string;
49
+ };
50
+ /** Validation */
51
+ validation: {
52
+ subjectRequired: string;
53
+ subjectTooLong: string;
54
+ messageRequired: string;
55
+ messageTooLong: string;
56
+ };
57
+ /** Messages */
58
+ messages: {
59
+ ticketCreated: string;
60
+ ticketCreateFailed: string;
61
+ messageSent: string;
62
+ messageSendFailed: string;
63
+ };
64
+ /** Message input */
65
+ messageInput: {
66
+ placeholder: string;
67
+ ticketClosed: string;
68
+ ticketClosedDescription: string;
69
+ };
70
+ /** Message list */
71
+ messageList: {
72
+ noTicketSelected: string;
73
+ noTicketSelectedDescription: string;
74
+ noMessages: string;
75
+ noMessagesDescription: string;
76
+ loadingOlder: string;
77
+ loadOlder: string;
78
+ supportTeam: string;
79
+ staff: string;
80
+ };
81
+ /** Time labels */
82
+ time: {
83
+ justNow: string;
84
+ minutesAgo: string;
85
+ hoursAgo: string;
86
+ daysAgo: string;
87
+ };
88
+ }
89
+
90
+ /**
91
+ * Self-contained translation hook for support extension
92
+ *
93
+ * Uses built-in translations based on current locale from next-intl.
94
+ * No need to add translations to app's i18n config.
95
+ *
96
+ * @example
97
+ * ```tsx
98
+ * function TicketList() {
99
+ * const t = useSupportT();
100
+ * return <h1>{t('layout.title')}</h1>;
101
+ * }
102
+ * ```
103
+ */
104
+ declare function useSupportT(): (key: SupportLocalKeys) => string;
105
+
106
+ declare const en: SupportTranslations;
107
+
108
+ declare const ru: SupportTranslations;
109
+
110
+ declare const ko: SupportTranslations;
111
+
112
+ export { type SupportLocalKeys, type SupportTranslations, en, ko, ru, useSupportT };
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Support 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 support translations
12
+ */
13
+ type SupportLocalKeys = PathKeys<SupportTranslations>;
14
+ interface SupportTranslations {
15
+ /** Layout */
16
+ layout: {
17
+ title: string;
18
+ titleShort: string;
19
+ subtitle: string;
20
+ newTicket: string;
21
+ };
22
+ /** Ticket statuses */
23
+ status: {
24
+ open: string;
25
+ waitingForUser: string;
26
+ waitingForAdmin: string;
27
+ resolved: string;
28
+ closed: string;
29
+ };
30
+ /** Ticket list */
31
+ ticketList: {
32
+ noTickets: string;
33
+ noTicketsDescription: string;
34
+ loadingMore: string;
35
+ loadMore: string;
36
+ allLoaded: string;
37
+ };
38
+ /** Create ticket dialog */
39
+ createTicket: {
40
+ title: string;
41
+ description: string;
42
+ subjectLabel: string;
43
+ subjectPlaceholder: string;
44
+ messageLabel: string;
45
+ messagePlaceholder: string;
46
+ cancel: string;
47
+ creating: string;
48
+ create: string;
49
+ };
50
+ /** Validation */
51
+ validation: {
52
+ subjectRequired: string;
53
+ subjectTooLong: string;
54
+ messageRequired: string;
55
+ messageTooLong: string;
56
+ };
57
+ /** Messages */
58
+ messages: {
59
+ ticketCreated: string;
60
+ ticketCreateFailed: string;
61
+ messageSent: string;
62
+ messageSendFailed: string;
63
+ };
64
+ /** Message input */
65
+ messageInput: {
66
+ placeholder: string;
67
+ ticketClosed: string;
68
+ ticketClosedDescription: string;
69
+ };
70
+ /** Message list */
71
+ messageList: {
72
+ noTicketSelected: string;
73
+ noTicketSelectedDescription: string;
74
+ noMessages: string;
75
+ noMessagesDescription: string;
76
+ loadingOlder: string;
77
+ loadOlder: string;
78
+ supportTeam: string;
79
+ staff: string;
80
+ };
81
+ /** Time labels */
82
+ time: {
83
+ justNow: string;
84
+ minutesAgo: string;
85
+ hoursAgo: string;
86
+ daysAgo: string;
87
+ };
88
+ }
89
+
90
+ /**
91
+ * Self-contained translation hook for support extension
92
+ *
93
+ * Uses built-in translations based on current locale from next-intl.
94
+ * No need to add translations to app's i18n config.
95
+ *
96
+ * @example
97
+ * ```tsx
98
+ * function TicketList() {
99
+ * const t = useSupportT();
100
+ * return <h1>{t('layout.title')}</h1>;
101
+ * }
102
+ * ```
103
+ */
104
+ declare function useSupportT(): (key: SupportLocalKeys) => string;
105
+
106
+ declare const en: SupportTranslations;
107
+
108
+ declare const ru: SupportTranslations;
109
+
110
+ declare const ko: SupportTranslations;
111
+
112
+ export { type SupportLocalKeys, type SupportTranslations, en, ko, ru, useSupportT };