gt-tanstack-start 0.4.25 → 1.0.0-odysseus.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # gt-tanstack-start
2
2
 
3
+ ## 1.0.0-odysseus.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#1627](https://github.com/generaltranslation/gt/pull/1627) [`bd0d788`](https://github.com/generaltranslation/gt/commit/bd0d7883601a183a31b47b36ea4ea2dca69c62d0) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Prepare Odysseus major releases for core runtime packages.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#1508](https://github.com/generaltranslation/gt/pull/1508) [`cc1499d`](https://github.com/generaltranslation/gt/commit/cc1499d12789ffd7ee3c6ca20d2eec734a1c9575) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Trigger an odysseus prerelease patch for all publishable packages.
12
+
13
+ - Updated dependencies [[`33203b1`](https://github.com/generaltranslation/gt/commit/33203b1953727647f61a21136b4c9570efbc8620), [`af441bd`](https://github.com/generaltranslation/gt/commit/af441bdfb3a4cabe28985c59104ab7d60ee83d83), [`cc1499d`](https://github.com/generaltranslation/gt/commit/cc1499d12789ffd7ee3c6ca20d2eec734a1c9575), [`bd0d788`](https://github.com/generaltranslation/gt/commit/bd0d7883601a183a31b47b36ea4ea2dca69c62d0)]:
14
+ - @generaltranslation/react-core@2.0.0-odysseus.0
15
+ - gt-react@11.0.0-odysseus.0
16
+ - generaltranslation@9.0.0-odysseus.0
17
+ - gt-i18n@1.0.0-odysseus.0
18
+
3
19
  ## 0.4.25
4
20
 
5
21
  ### Patch Changes
@@ -0,0 +1,215 @@
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ let gt_react = require("gt-react");
4
+ //#region src/index.client.ts
5
+ function parseLocale() {
6
+ throw new Error("parseLocale() is only available from gt-tanstack-start on the server.");
7
+ }
8
+ //#endregion
9
+ Object.defineProperty(exports, "Branch", {
10
+ enumerable: true,
11
+ get: function() {
12
+ return gt_react.Branch;
13
+ }
14
+ });
15
+ Object.defineProperty(exports, "Currency", {
16
+ enumerable: true,
17
+ get: function() {
18
+ return gt_react.Currency;
19
+ }
20
+ });
21
+ Object.defineProperty(exports, "DateTime", {
22
+ enumerable: true,
23
+ get: function() {
24
+ return gt_react.DateTime;
25
+ }
26
+ });
27
+ Object.defineProperty(exports, "Derive", {
28
+ enumerable: true,
29
+ get: function() {
30
+ return gt_react.Derive;
31
+ }
32
+ });
33
+ Object.defineProperty(exports, "GTProvider", {
34
+ enumerable: true,
35
+ get: function() {
36
+ return gt_react.GTProvider;
37
+ }
38
+ });
39
+ Object.defineProperty(exports, "LocaleSelector", {
40
+ enumerable: true,
41
+ get: function() {
42
+ return gt_react.LocaleSelector;
43
+ }
44
+ });
45
+ Object.defineProperty(exports, "Num", {
46
+ enumerable: true,
47
+ get: function() {
48
+ return gt_react.Num;
49
+ }
50
+ });
51
+ Object.defineProperty(exports, "Plural", {
52
+ enumerable: true,
53
+ get: function() {
54
+ return gt_react.Plural;
55
+ }
56
+ });
57
+ Object.defineProperty(exports, "RelativeTime", {
58
+ enumerable: true,
59
+ get: function() {
60
+ return gt_react.RelativeTime;
61
+ }
62
+ });
63
+ Object.defineProperty(exports, "T", {
64
+ enumerable: true,
65
+ get: function() {
66
+ return gt_react.T;
67
+ }
68
+ });
69
+ Object.defineProperty(exports, "Var", {
70
+ enumerable: true,
71
+ get: function() {
72
+ return gt_react.Var;
73
+ }
74
+ });
75
+ Object.defineProperty(exports, "declareVar", {
76
+ enumerable: true,
77
+ get: function() {
78
+ return gt_react.declareVar;
79
+ }
80
+ });
81
+ Object.defineProperty(exports, "decodeMsg", {
82
+ enumerable: true,
83
+ get: function() {
84
+ return gt_react.decodeMsg;
85
+ }
86
+ });
87
+ Object.defineProperty(exports, "decodeOptions", {
88
+ enumerable: true,
89
+ get: function() {
90
+ return gt_react.decodeOptions;
91
+ }
92
+ });
93
+ Object.defineProperty(exports, "decodeVars", {
94
+ enumerable: true,
95
+ get: function() {
96
+ return gt_react.decodeVars;
97
+ }
98
+ });
99
+ Object.defineProperty(exports, "derive", {
100
+ enumerable: true,
101
+ get: function() {
102
+ return gt_react.derive;
103
+ }
104
+ });
105
+ Object.defineProperty(exports, "getTranslationsSnapshot", {
106
+ enumerable: true,
107
+ get: function() {
108
+ return gt_react.getTranslationsSnapshot;
109
+ }
110
+ });
111
+ Object.defineProperty(exports, "gtFallback", {
112
+ enumerable: true,
113
+ get: function() {
114
+ return gt_react.gtFallback;
115
+ }
116
+ });
117
+ Object.defineProperty(exports, "initializeGT", {
118
+ enumerable: true,
119
+ get: function() {
120
+ return gt_react.initializeGT;
121
+ }
122
+ });
123
+ Object.defineProperty(exports, "mFallback", {
124
+ enumerable: true,
125
+ get: function() {
126
+ return gt_react.mFallback;
127
+ }
128
+ });
129
+ Object.defineProperty(exports, "msg", {
130
+ enumerable: true,
131
+ get: function() {
132
+ return gt_react.msg;
133
+ }
134
+ });
135
+ exports.parseLocale = parseLocale;
136
+ Object.defineProperty(exports, "t", {
137
+ enumerable: true,
138
+ get: function() {
139
+ return gt_react.t;
140
+ }
141
+ });
142
+ Object.defineProperty(exports, "useCustomMapping", {
143
+ enumerable: true,
144
+ get: function() {
145
+ return gt_react.useCustomMapping;
146
+ }
147
+ });
148
+ Object.defineProperty(exports, "useDefaultLocale", {
149
+ enumerable: true,
150
+ get: function() {
151
+ return gt_react.useDefaultLocale;
152
+ }
153
+ });
154
+ Object.defineProperty(exports, "useEnableI18n", {
155
+ enumerable: true,
156
+ get: function() {
157
+ return gt_react.useEnableI18n;
158
+ }
159
+ });
160
+ Object.defineProperty(exports, "useFormatLocales", {
161
+ enumerable: true,
162
+ get: function() {
163
+ return gt_react.useFormatLocales;
164
+ }
165
+ });
166
+ Object.defineProperty(exports, "useGT", {
167
+ enumerable: true,
168
+ get: function() {
169
+ return gt_react.useGT;
170
+ }
171
+ });
172
+ Object.defineProperty(exports, "useLocale", {
173
+ enumerable: true,
174
+ get: function() {
175
+ return gt_react.useLocale;
176
+ }
177
+ });
178
+ Object.defineProperty(exports, "useLocaleSelector", {
179
+ enumerable: true,
180
+ get: function() {
181
+ return gt_react.useLocaleSelector;
182
+ }
183
+ });
184
+ Object.defineProperty(exports, "useLocales", {
185
+ enumerable: true,
186
+ get: function() {
187
+ return gt_react.useLocales;
188
+ }
189
+ });
190
+ Object.defineProperty(exports, "useMessages", {
191
+ enumerable: true,
192
+ get: function() {
193
+ return gt_react.useMessages;
194
+ }
195
+ });
196
+ Object.defineProperty(exports, "useSetEnableI18n", {
197
+ enumerable: true,
198
+ get: function() {
199
+ return gt_react.useSetEnableI18n;
200
+ }
201
+ });
202
+ Object.defineProperty(exports, "useSetLocale", {
203
+ enumerable: true,
204
+ get: function() {
205
+ return gt_react.useSetLocale;
206
+ }
207
+ });
208
+ Object.defineProperty(exports, "useTranslations", {
209
+ enumerable: true,
210
+ get: function() {
211
+ return gt_react.useTranslations;
212
+ }
213
+ });
214
+
215
+ //# sourceMappingURL=index.client.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.client.cjs","names":[],"sources":["../src/index.client.ts"],"sourcesContent":["'use client';\n\nexport function parseLocale() {\n throw new Error(\n 'parseLocale() is only available from gt-tanstack-start on the server.'\n );\n}\n\nexport {\n // ===== Components ===== //\n Branch,\n Plural,\n Derive,\n LocaleSelector,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n GTProvider,\n // ===== Hooks ===== //\n useLocale,\n useSetLocale,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useSetEnableI18n,\n useLocales,\n useLocaleSelector,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n // ===== Functions ===== //\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getTranslationsSnapshot,\n t,\n // ===== Setup ===== //\n initializeGT,\n} from 'gt-react';\n"],"mappings":";;;;AAEA,SAAgB,cAAc;AAC5B,OAAM,IAAI,MACR,wEACD"}
@@ -0,0 +1,7 @@
1
+ import { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations } from "gt-react";
2
+
3
+ //#region src/index.client.d.ts
4
+ declare function parseLocale(): void;
5
+ //#endregion
6
+ export { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, parseLocale, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations };
7
+ //# sourceMappingURL=index.client.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.client.d.cts","names":[],"sources":["../src/index.client.ts"],"mappings":";;;iBAEgB,WAAA,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations } from "gt-react";
2
+
3
+ //#region src/index.client.d.ts
4
+ declare function parseLocale(): void;
5
+ //#endregion
6
+ export { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, parseLocale, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations };
7
+ //# sourceMappingURL=index.client.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.client.d.mts","names":[],"sources":["../src/index.client.ts"],"mappings":";;;iBAEgB,WAAA,CAAA"}
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations } from "gt-react";
3
+ //#region src/index.client.ts
4
+ function parseLocale() {
5
+ throw new Error("parseLocale() is only available from gt-tanstack-start on the server.");
6
+ }
7
+ //#endregion
8
+ export { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, parseLocale, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations };
9
+
10
+ //# sourceMappingURL=index.client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.client.mjs","names":[],"sources":["../src/index.client.ts"],"sourcesContent":["'use client';\n\nexport function parseLocale() {\n throw new Error(\n 'parseLocale() is only available from gt-tanstack-start on the server.'\n );\n}\n\nexport {\n // ===== Components ===== //\n Branch,\n Plural,\n Derive,\n LocaleSelector,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n GTProvider,\n // ===== Hooks ===== //\n useLocale,\n useSetLocale,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useSetEnableI18n,\n useLocales,\n useLocaleSelector,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n // ===== Functions ===== //\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getTranslationsSnapshot,\n t,\n // ===== Setup ===== //\n initializeGT,\n} from 'gt-react';\n"],"mappings":";;;AAEA,SAAgB,cAAc;AAC5B,OAAM,IAAI,MACR,wEACD"}
@@ -0,0 +1,226 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _tanstack_react_start_server = require("@tanstack/react-start/server");
3
+ let gt_i18n_internal = require("gt-i18n/internal");
4
+ let gt_react = require("gt-react");
5
+ //#region src/functions/parseLocale.ts
6
+ /**
7
+ * Resolve the user's locale from the current TanStack Start server request.
8
+ */
9
+ function parseLocale() {
10
+ const candidates = [];
11
+ const cookie = (0, _tanstack_react_start_server.getCookie)(gt_react.defaultLocaleCookieName);
12
+ if (cookie) candidates.push(cookie);
13
+ const headers = (0, _tanstack_react_start_server.getRequestHeader)("accept-language")?.split(",").map((item) => item.split(";")?.[0].trim()) || [];
14
+ candidates.push(...headers);
15
+ if (candidates.length === 0) console.warn("gt-tanstack-start(server): no locales could be determined for this request");
16
+ const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
17
+ return i18nConfig.getGTClass().determineLocale(candidates, i18nConfig.getLocales()) || i18nConfig.getDefaultLocale();
18
+ }
19
+ //#endregion
20
+ Object.defineProperty(exports, "Branch", {
21
+ enumerable: true,
22
+ get: function() {
23
+ return gt_react.Branch;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, "Currency", {
27
+ enumerable: true,
28
+ get: function() {
29
+ return gt_react.Currency;
30
+ }
31
+ });
32
+ Object.defineProperty(exports, "DateTime", {
33
+ enumerable: true,
34
+ get: function() {
35
+ return gt_react.DateTime;
36
+ }
37
+ });
38
+ Object.defineProperty(exports, "Derive", {
39
+ enumerable: true,
40
+ get: function() {
41
+ return gt_react.Derive;
42
+ }
43
+ });
44
+ Object.defineProperty(exports, "GTProvider", {
45
+ enumerable: true,
46
+ get: function() {
47
+ return gt_react.GTProvider;
48
+ }
49
+ });
50
+ Object.defineProperty(exports, "LocaleSelector", {
51
+ enumerable: true,
52
+ get: function() {
53
+ return gt_react.LocaleSelector;
54
+ }
55
+ });
56
+ Object.defineProperty(exports, "Num", {
57
+ enumerable: true,
58
+ get: function() {
59
+ return gt_react.Num;
60
+ }
61
+ });
62
+ Object.defineProperty(exports, "Plural", {
63
+ enumerable: true,
64
+ get: function() {
65
+ return gt_react.Plural;
66
+ }
67
+ });
68
+ Object.defineProperty(exports, "RelativeTime", {
69
+ enumerable: true,
70
+ get: function() {
71
+ return gt_react.RelativeTime;
72
+ }
73
+ });
74
+ Object.defineProperty(exports, "T", {
75
+ enumerable: true,
76
+ get: function() {
77
+ return gt_react.T;
78
+ }
79
+ });
80
+ Object.defineProperty(exports, "Var", {
81
+ enumerable: true,
82
+ get: function() {
83
+ return gt_react.Var;
84
+ }
85
+ });
86
+ Object.defineProperty(exports, "declareVar", {
87
+ enumerable: true,
88
+ get: function() {
89
+ return gt_react.declareVar;
90
+ }
91
+ });
92
+ Object.defineProperty(exports, "decodeMsg", {
93
+ enumerable: true,
94
+ get: function() {
95
+ return gt_react.decodeMsg;
96
+ }
97
+ });
98
+ Object.defineProperty(exports, "decodeOptions", {
99
+ enumerable: true,
100
+ get: function() {
101
+ return gt_react.decodeOptions;
102
+ }
103
+ });
104
+ Object.defineProperty(exports, "decodeVars", {
105
+ enumerable: true,
106
+ get: function() {
107
+ return gt_react.decodeVars;
108
+ }
109
+ });
110
+ Object.defineProperty(exports, "derive", {
111
+ enumerable: true,
112
+ get: function() {
113
+ return gt_react.derive;
114
+ }
115
+ });
116
+ Object.defineProperty(exports, "getTranslationsSnapshot", {
117
+ enumerable: true,
118
+ get: function() {
119
+ return gt_react.getTranslationsSnapshot;
120
+ }
121
+ });
122
+ Object.defineProperty(exports, "gtFallback", {
123
+ enumerable: true,
124
+ get: function() {
125
+ return gt_react.gtFallback;
126
+ }
127
+ });
128
+ Object.defineProperty(exports, "initializeGT", {
129
+ enumerable: true,
130
+ get: function() {
131
+ return gt_react.initializeGT;
132
+ }
133
+ });
134
+ Object.defineProperty(exports, "mFallback", {
135
+ enumerable: true,
136
+ get: function() {
137
+ return gt_react.mFallback;
138
+ }
139
+ });
140
+ Object.defineProperty(exports, "msg", {
141
+ enumerable: true,
142
+ get: function() {
143
+ return gt_react.msg;
144
+ }
145
+ });
146
+ exports.parseLocale = parseLocale;
147
+ Object.defineProperty(exports, "t", {
148
+ enumerable: true,
149
+ get: function() {
150
+ return gt_react.t;
151
+ }
152
+ });
153
+ Object.defineProperty(exports, "useCustomMapping", {
154
+ enumerable: true,
155
+ get: function() {
156
+ return gt_react.useCustomMapping;
157
+ }
158
+ });
159
+ Object.defineProperty(exports, "useDefaultLocale", {
160
+ enumerable: true,
161
+ get: function() {
162
+ return gt_react.useDefaultLocale;
163
+ }
164
+ });
165
+ Object.defineProperty(exports, "useEnableI18n", {
166
+ enumerable: true,
167
+ get: function() {
168
+ return gt_react.useEnableI18n;
169
+ }
170
+ });
171
+ Object.defineProperty(exports, "useFormatLocales", {
172
+ enumerable: true,
173
+ get: function() {
174
+ return gt_react.useFormatLocales;
175
+ }
176
+ });
177
+ Object.defineProperty(exports, "useGT", {
178
+ enumerable: true,
179
+ get: function() {
180
+ return gt_react.useGT;
181
+ }
182
+ });
183
+ Object.defineProperty(exports, "useLocale", {
184
+ enumerable: true,
185
+ get: function() {
186
+ return gt_react.useLocale;
187
+ }
188
+ });
189
+ Object.defineProperty(exports, "useLocaleSelector", {
190
+ enumerable: true,
191
+ get: function() {
192
+ return gt_react.useLocaleSelector;
193
+ }
194
+ });
195
+ Object.defineProperty(exports, "useLocales", {
196
+ enumerable: true,
197
+ get: function() {
198
+ return gt_react.useLocales;
199
+ }
200
+ });
201
+ Object.defineProperty(exports, "useMessages", {
202
+ enumerable: true,
203
+ get: function() {
204
+ return gt_react.useMessages;
205
+ }
206
+ });
207
+ Object.defineProperty(exports, "useSetEnableI18n", {
208
+ enumerable: true,
209
+ get: function() {
210
+ return gt_react.useSetEnableI18n;
211
+ }
212
+ });
213
+ Object.defineProperty(exports, "useSetLocale", {
214
+ enumerable: true,
215
+ get: function() {
216
+ return gt_react.useSetLocale;
217
+ }
218
+ });
219
+ Object.defineProperty(exports, "useTranslations", {
220
+ enumerable: true,
221
+ get: function() {
222
+ return gt_react.useTranslations;
223
+ }
224
+ });
225
+
226
+ //# sourceMappingURL=index.server.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.cjs","names":["defaultLocaleCookieName"],"sources":["../src/functions/parseLocale.ts"],"sourcesContent":["import { getCookie, getRequestHeader } from '@tanstack/react-start/server';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { defaultLocaleCookieName } from 'gt-react';\n\n/**\n * Resolve the user's locale from the current TanStack Start server request.\n */\nexport function parseLocale(): string {\n const candidates: string[] = [];\n\n const cookie = getCookie(defaultLocaleCookieName);\n if (cookie) candidates.push(cookie);\n\n const headers =\n getRequestHeader('accept-language')\n ?.split(',')\n .map((item) => item.split(';')?.[0].trim()) || [];\n candidates.push(...headers);\n\n if (candidates.length === 0) {\n console.warn(\n 'gt-tanstack-start(server): no locales could be determined for this request'\n );\n }\n\n const i18nConfig = getI18nConfig();\n return (\n i18nConfig\n .getGTClass()\n .determineLocale(candidates, i18nConfig.getLocales()) ||\n i18nConfig.getDefaultLocale()\n );\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,cAAsB;CACpC,MAAM,aAAuB,EAAE;CAE/B,MAAM,UAAA,GAAA,6BAAA,WAAmBA,SAAAA,wBAAwB;AACjD,KAAI,OAAQ,YAAW,KAAK,OAAO;CAEnC,MAAM,WAAA,GAAA,6BAAA,kBACa,kBAAkB,EAC/B,MAAM,IAAI,CACX,KAAK,SAAS,KAAK,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE;AACrD,YAAW,KAAK,GAAG,QAAQ;AAE3B,KAAI,WAAW,WAAW,EACxB,SAAQ,KACN,6EACD;CAGH,MAAM,cAAA,GAAA,iBAAA,gBAA4B;AAClC,QACE,WACG,YAAY,CACZ,gBAAgB,YAAY,WAAW,YAAY,CAAC,IACvD,WAAW,kBAAkB"}
@@ -0,0 +1,10 @@
1
+ import { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations } from "gt-react";
2
+
3
+ //#region src/functions/parseLocale.d.ts
4
+ /**
5
+ * Resolve the user's locale from the current TanStack Start server request.
6
+ */
7
+ declare function parseLocale(): string;
8
+ //#endregion
9
+ export { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, parseLocale, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations };
10
+ //# sourceMappingURL=index.server.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.d.cts","names":[],"sources":["../src/functions/parseLocale.ts"],"mappings":";;;;;;iBAOgB,WAAA,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations } from "gt-react";
2
+
3
+ //#region src/functions/parseLocale.d.ts
4
+ /**
5
+ * Resolve the user's locale from the current TanStack Start server request.
6
+ */
7
+ declare function parseLocale(): string;
8
+ //#endregion
9
+ export { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, parseLocale, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations };
10
+ //# sourceMappingURL=index.server.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.d.mts","names":[],"sources":["../src/functions/parseLocale.ts"],"mappings":";;;;;;iBAOgB,WAAA,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { getCookie, getRequestHeader } from "@tanstack/react-start/server";
2
+ import { getI18nConfig } from "gt-i18n/internal";
3
+ import { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, defaultLocaleCookieName, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations } from "gt-react";
4
+ //#region src/functions/parseLocale.ts
5
+ /**
6
+ * Resolve the user's locale from the current TanStack Start server request.
7
+ */
8
+ function parseLocale() {
9
+ const candidates = [];
10
+ const cookie = getCookie(defaultLocaleCookieName);
11
+ if (cookie) candidates.push(cookie);
12
+ const headers = getRequestHeader("accept-language")?.split(",").map((item) => item.split(";")?.[0].trim()) || [];
13
+ candidates.push(...headers);
14
+ if (candidates.length === 0) console.warn("gt-tanstack-start(server): no locales could be determined for this request");
15
+ const i18nConfig = getI18nConfig();
16
+ return i18nConfig.getGTClass().determineLocale(candidates, i18nConfig.getLocales()) || i18nConfig.getDefaultLocale();
17
+ }
18
+ //#endregion
19
+ export { Branch, Currency, DateTime, Derive, GTProvider, LocaleSelector, Num, Plural, RelativeTime, T, Var, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, parseLocale, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleSelector, useLocales, useMessages, useSetEnableI18n, useSetLocale, useTranslations };
20
+
21
+ //# sourceMappingURL=index.server.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.mjs","names":[],"sources":["../src/functions/parseLocale.ts"],"sourcesContent":["import { getCookie, getRequestHeader } from '@tanstack/react-start/server';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport { defaultLocaleCookieName } from 'gt-react';\n\n/**\n * Resolve the user's locale from the current TanStack Start server request.\n */\nexport function parseLocale(): string {\n const candidates: string[] = [];\n\n const cookie = getCookie(defaultLocaleCookieName);\n if (cookie) candidates.push(cookie);\n\n const headers =\n getRequestHeader('accept-language')\n ?.split(',')\n .map((item) => item.split(';')?.[0].trim()) || [];\n candidates.push(...headers);\n\n if (candidates.length === 0) {\n console.warn(\n 'gt-tanstack-start(server): no locales could be determined for this request'\n );\n }\n\n const i18nConfig = getI18nConfig();\n return (\n i18nConfig\n .getGTClass()\n .determineLocale(candidates, i18nConfig.getLocales()) ||\n i18nConfig.getDefaultLocale()\n );\n}\n"],"mappings":";;;;;;;AAOA,SAAgB,cAAsB;CACpC,MAAM,aAAuB,EAAE;CAE/B,MAAM,SAAS,UAAU,wBAAwB;AACjD,KAAI,OAAQ,YAAW,KAAK,OAAO;CAEnC,MAAM,UACJ,iBAAiB,kBAAkB,EAC/B,MAAM,IAAI,CACX,KAAK,SAAS,KAAK,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE;AACrD,YAAW,KAAK,GAAG,QAAQ;AAE3B,KAAI,WAAW,WAAW,EACxB,SAAQ,KACN,6EACD;CAGH,MAAM,aAAa,eAAe;AAClC,QACE,WACG,YAAY,CACZ,gBAAgB,YAAY,WAAW,YAAY,CAAC,IACvD,WAAW,kBAAkB"}