gt-next 4.3.0 → 4.3.2-beta
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/config/I18NConfiguration.d.ts +27 -20
- package/dist/config/I18NConfiguration.d.ts.map +1 -1
- package/dist/config/I18NConfiguration.js +54 -38
- package/dist/config/I18NConfiguration.js.map +1 -1
- package/dist/config/RemoteTranslationsManager.d.ts +6 -5
- package/dist/config/RemoteTranslationsManager.d.ts.map +1 -1
- package/dist/config/RemoteTranslationsManager.js +22 -11
- package/dist/config/RemoteTranslationsManager.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -7
- package/dist/config.js.map +1 -1
- package/dist/dictionary/getDictionary.d.ts +3 -2
- package/dist/dictionary/getDictionary.d.ts.map +1 -1
- package/dist/dictionary/getDictionary.js +3 -1
- package/dist/dictionary/getDictionary.js.map +1 -1
- package/dist/errors/createErrors.d.ts +2 -0
- package/dist/errors/createErrors.d.ts.map +1 -1
- package/dist/errors/createErrors.js +5 -1
- package/dist/errors/createErrors.js.map +1 -1
- package/dist/middleware/createNextMiddleware.d.ts.map +1 -1
- package/dist/middleware/createNextMiddleware.js +0 -1
- package/dist/middleware/createNextMiddleware.js.map +1 -1
- package/dist/provider/ClientProvider.d.ts +11 -7
- package/dist/provider/ClientProvider.d.ts.map +1 -1
- package/dist/provider/ClientProvider.js +105 -83
- package/dist/provider/ClientProvider.js.map +1 -1
- package/dist/provider/GTProvider.d.ts.map +1 -1
- package/dist/provider/GTProvider.js +89 -63
- package/dist/provider/GTProvider.js.map +1 -1
- package/dist/server/getGT.d.ts.map +1 -1
- package/dist/server/getGT.js +39 -40
- package/dist/server/getGT.js.map +1 -1
- package/dist/server/inline/T.d.ts +1 -2
- package/dist/server/inline/T.d.ts.map +1 -1
- package/dist/server/inline/T.js +66 -70
- package/dist/server/inline/T.js.map +1 -1
- package/dist/server/strings/tx.d.ts.map +1 -1
- package/dist/server/strings/tx.js +27 -28
- package/dist/server/strings/tx.js.map +1 -1
- package/dist/types/types.d.ts +7 -9
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +1 -0
- package/dist/types/types.js.map +1 -1
- package/dist/utils/extractTaggedEntryMetadata.d.ts +7 -0
- package/dist/utils/extractTaggedEntryMetadata.d.ts.map +1 -0
- package/dist/utils/extractTaggedEntryMetadata.js +15 -0
- package/dist/utils/extractTaggedEntryMetadata.js.map +1 -0
- package/dist/utils/serializeJsx.d.ts +9 -0
- package/dist/utils/serializeJsx.d.ts.map +1 -0
- package/dist/utils/serializeJsx.js +156 -0
- package/dist/utils/serializeJsx.js.map +1 -0
- package/package.json +2 -3
|
@@ -103,15 +103,13 @@ var createErrors_1 = require("../errors/createErrors");
|
|
|
103
103
|
*/
|
|
104
104
|
function GTProvider(_a) {
|
|
105
105
|
return __awaiter(this, arguments, void 0, function (_b) {
|
|
106
|
-
var getId, I18NConfig, locale, additionalMetadata, defaultLocale,
|
|
106
|
+
var getId, I18NConfig, locale, additionalMetadata, defaultLocale, translationRequired, dialectTranslationRequired, translationsPromise, dictionarySubset, flattenedDictionarySubset, translations, _c, dictionary, promises;
|
|
107
107
|
var _this = this;
|
|
108
108
|
var children = _b.children, id = _b.id;
|
|
109
109
|
return __generator(this, function (_d) {
|
|
110
110
|
switch (_d.label) {
|
|
111
111
|
case 0:
|
|
112
|
-
getId = function (suffix) {
|
|
113
|
-
return id ? "".concat(id, ".").concat(suffix) : suffix;
|
|
114
|
-
};
|
|
112
|
+
getId = function (suffix) { return id ? "".concat(id, ".").concat(suffix) : suffix; };
|
|
115
113
|
I18NConfig = (0, getI18NConfig_1.default)();
|
|
116
114
|
return [4 /*yield*/, (0, getLocale_1.default)()];
|
|
117
115
|
case 1:
|
|
@@ -120,17 +118,13 @@ function GTProvider(_a) {
|
|
|
120
118
|
case 2:
|
|
121
119
|
additionalMetadata = _d.sent();
|
|
122
120
|
defaultLocale = I18NConfig.getDefaultLocale();
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (translationRequired)
|
|
127
|
-
translationsPromise = I18NConfig.getTranslations(locale);
|
|
121
|
+
translationRequired = I18NConfig.requiresTranslation(locale);
|
|
122
|
+
dialectTranslationRequired = translationRequired && (0, generaltranslation_1.isSameLanguage)(locale, defaultLocale);
|
|
123
|
+
translationsPromise = translationRequired && I18NConfig.getCachedTranslations(locale);
|
|
128
124
|
dictionarySubset = (id ? (0, getDictionary_1.getDictionaryEntry)(id) : (0, getDictionary_1.default)()) || {};
|
|
129
|
-
if (typeof dictionarySubset !== 'object' || Array.isArray(dictionarySubset))
|
|
125
|
+
if (typeof dictionarySubset !== 'object' || Array.isArray(dictionarySubset)) // cannot be a DictionaryEntry, must be a Dictionary
|
|
130
126
|
throw new Error((0, createErrors_1.createDictionarySubsetError)(id !== null && id !== void 0 ? id : '', "<GTProvider>"));
|
|
131
|
-
|
|
132
|
-
dictionary = {};
|
|
133
|
-
translations = {};
|
|
127
|
+
flattenedDictionarySubset = (0, internal_1.flattenDictionary)(dictionarySubset);
|
|
134
128
|
if (!(translationsPromise)) return [3 /*break*/, 4];
|
|
135
129
|
return [4 /*yield*/, translationsPromise];
|
|
136
130
|
case 3:
|
|
@@ -140,62 +134,94 @@ function GTProvider(_a) {
|
|
|
140
134
|
_c = {};
|
|
141
135
|
_d.label = 5;
|
|
142
136
|
case 5:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
137
|
+
translations = _c;
|
|
138
|
+
dictionary = {};
|
|
139
|
+
promises = {};
|
|
140
|
+
// ---- TRANSLATE DICTIONARY STRINGS ---- //
|
|
141
|
+
/**
|
|
142
|
+
* Strings Entries: hang until translation resolves
|
|
143
|
+
* JSX Entries: pass directly to client (translation will be performed on demand)
|
|
144
|
+
*
|
|
145
|
+
* We will also be populating the dictionary
|
|
146
|
+
*/
|
|
147
|
+
return [4 /*yield*/, Promise.all(Object.entries(flattenedDictionarySubset !== null && flattenedDictionarySubset !== void 0 ? flattenedDictionarySubset : {}).map(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
148
|
+
var entryId, _c, entry, metadata, taggedChildren, _d, childrenAsObjects, hash_1, translationEntry_1, translationPromise, contentArray, hash, translationEntry, translation, error_1;
|
|
149
|
+
var _e, _f;
|
|
150
|
+
var _g, _h;
|
|
148
151
|
var suffix = _b[0], dictionaryEntry = _b[1];
|
|
149
|
-
return __generator(this, function (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
152
|
+
return __generator(this, function (_j) {
|
|
153
|
+
switch (_j.label) {
|
|
154
|
+
case 0:
|
|
155
|
+
// If no translation is required, return
|
|
156
|
+
if (!translationRequired)
|
|
157
|
+
return [2 /*return*/];
|
|
158
|
+
// Get the entry from the dictionary
|
|
159
|
+
if (!dictionaryEntry)
|
|
160
|
+
return [2 /*return*/]; // dictionary entries cannot be falsey
|
|
161
|
+
entryId = getId(suffix);
|
|
162
|
+
_c = (0, internal_1.extractEntryMetadata)(dictionaryEntry), entry = _c.entry, metadata = _c.metadata;
|
|
163
|
+
if (!entry)
|
|
164
|
+
return [2 /*return*/]; // dictionary entries cannot be falsey
|
|
165
|
+
// Only translate strings
|
|
166
|
+
if (typeof entry !== 'string') {
|
|
167
|
+
taggedChildren = I18NConfig.addGTIdentifier(entry);
|
|
168
|
+
_d = I18NConfig.serializeAndHashChildren(entry, metadata === null || metadata === void 0 ? void 0 : metadata.context), childrenAsObjects = _d[0], hash_1 = _d[1];
|
|
169
|
+
dictionary[entryId] = [taggedChildren, __assign(__assign({}, metadata), { hash: hash_1 })];
|
|
170
|
+
translationEntry_1 = (_g = translations === null || translations === void 0 ? void 0 : translations[entryId]) === null || _g === void 0 ? void 0 : _g[hash_1];
|
|
171
|
+
// If the translation already exists, then do not translate on demand
|
|
172
|
+
// or runtime translation disabled
|
|
173
|
+
if (translationEntry_1)
|
|
174
|
+
return [2 /*return*/];
|
|
175
|
+
translationPromise = I18NConfig.translateChildren({
|
|
176
|
+
source: childrenAsObjects,
|
|
177
|
+
targetLocale: locale,
|
|
178
|
+
metadata: __assign(__assign({}, metadata), { id: entryId, hash: hash_1 }),
|
|
179
|
+
});
|
|
180
|
+
// record translations as loading and record the promises to use on client-side
|
|
181
|
+
translations[entryId] = (_e = {}, _e[hash_1] = { state: 'loading' }, _e);
|
|
182
|
+
promises[entryId] = translationPromise;
|
|
183
|
+
return [2 /*return*/];
|
|
184
|
+
}
|
|
185
|
+
;
|
|
186
|
+
contentArray = (0, generaltranslation_1.splitStringToContent)(entry);
|
|
187
|
+
hash = (metadata === null || metadata === void 0 ? void 0 : metadata.hash) || I18NConfig.hashContent(contentArray, metadata === null || metadata === void 0 ? void 0 : metadata.context);
|
|
188
|
+
// Add to client dictionary
|
|
189
|
+
dictionary[entryId] = [entry, __assign(__assign({}, metadata), { hash: hash })];
|
|
190
|
+
translationEntry = (_h = translations === null || translations === void 0 ? void 0 : translations[entryId]) === null || _h === void 0 ? void 0 : _h[hash];
|
|
191
|
+
// If the translation already exists, then do not translate on demand
|
|
192
|
+
if (translationEntry)
|
|
193
|
+
return [2 /*return*/];
|
|
194
|
+
_j.label = 1;
|
|
195
|
+
case 1:
|
|
196
|
+
_j.trys.push([1, 3, , 4]);
|
|
197
|
+
return [4 /*yield*/, I18NConfig.translateContent({
|
|
198
|
+
source: contentArray,
|
|
199
|
+
targetLocale: locale,
|
|
200
|
+
options: __assign(__assign({ id: entryId, hash: hash }, additionalMetadata), { context: metadata === null || metadata === void 0 ? void 0 : metadata.context }),
|
|
201
|
+
})];
|
|
202
|
+
case 2:
|
|
203
|
+
translation = _j.sent();
|
|
204
|
+
// overwriting any old translations, this is most recent on demand, so should be most accurate
|
|
205
|
+
translations[entryId] = (_f = {}, _f[hash] = { state: 'success', target: translation }, _f);
|
|
206
|
+
return [3 /*break*/, 4];
|
|
207
|
+
case 3:
|
|
208
|
+
error_1 = _j.sent();
|
|
209
|
+
console.error(error_1);
|
|
210
|
+
return [3 /*break*/, 4];
|
|
211
|
+
case 4: return [2 /*return*/];
|
|
177
212
|
}
|
|
178
|
-
_e = I18NConfig.serializeAndHash(taggedEntry, metadata === null || metadata === void 0 ? void 0 : metadata.context, entryId), entryAsObjects = _e[0], hash = _e[1];
|
|
179
|
-
dictionary[entryId] = [taggedEntry, __assign(__assign({}, metadata), { hash: hash })];
|
|
180
|
-
translation = existingTranslations === null || existingTranslations === void 0 ? void 0 : existingTranslations[entryId];
|
|
181
|
-
if (translation === null || translation === void 0 ? void 0 : translation[hash])
|
|
182
|
-
return [2 /*return*/, (translations[entryId] = (_g = {}, _g[hash] = translation[hash], _g))];
|
|
183
|
-
translationPromise = I18NConfig.translateChildren({
|
|
184
|
-
source: entryAsObjects,
|
|
185
|
-
targetLocale: locale,
|
|
186
|
-
metadata: __assign(__assign(__assign({ id: entryId, hash: hash }, ((metadata === null || metadata === void 0 ? void 0 : metadata.context) && { context: metadata.context })), additionalMetadata), (renderSettings.timeout && { timeout: renderSettings.timeout })),
|
|
187
|
-
});
|
|
188
|
-
return [2 /*return*/, (translations[entryId] = {
|
|
189
|
-
promise: translationPromise,
|
|
190
|
-
hash: hash,
|
|
191
|
-
type: 'jsx',
|
|
192
|
-
})];
|
|
193
213
|
});
|
|
194
214
|
}); }))];
|
|
195
215
|
case 6:
|
|
196
|
-
//
|
|
216
|
+
// ---- TRANSLATE DICTIONARY STRINGS ---- //
|
|
217
|
+
/**
|
|
218
|
+
* Strings Entries: hang until translation resolves
|
|
219
|
+
* JSX Entries: pass directly to client (translation will be performed on demand)
|
|
220
|
+
*
|
|
221
|
+
* We will also be populating the dictionary
|
|
222
|
+
*/
|
|
197
223
|
_d.sent();
|
|
198
|
-
return [2 /*return*/, ((0, jsx_runtime_1.jsx)(ClientProvider_1.default, __assign({ dictionary: dictionary, initialTranslations:
|
|
224
|
+
return [2 /*return*/, ((0, jsx_runtime_1.jsx)(ClientProvider_1.default, __assign({ dictionary: dictionary, initialTranslations: translations, translationPromises: promises, locale: locale, locales: I18NConfig.getLocales(), defaultLocale: defaultLocale, translationRequired: translationRequired, dialectTranslationRequired: dialectTranslationRequired, requiredPrefix: id, renderSettings: I18NConfig.getRenderSettings() }, I18NConfig.getClientSideConfig(), { children: children })))];
|
|
199
225
|
}
|
|
200
226
|
});
|
|
201
227
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTProvider.js","sourceRoot":"","sources":["../../src/provider/GTProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,
|
|
1
|
+
{"version":3,"file":"GTProvider.js","sourceRoot":"","sources":["../../src/provider/GTProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,6BA0IC;;AApKD,8CAM2B;AAE3B,0EAAoD;AACpD,mEAA6C;AAC7C,uEAAiD;AACjD,yDAA0E;AAC1E,2EAAgF;AAChF,oEAA8C;AAE9C,uDAAqE;AAGrE;;;;;;;GAOG;AACH,SAA8B,UAAU;wDAAC,EAMxC;;;YALC,QAAQ,cAAA,EACR,EAAE,QAAA;;;;oBAOI,KAAK,GAAG,UAAC,MAAc,IAAO,OAAO,EAAE,CAAC,CAAC,CAAC,UAAG,EAAE,cAAI,MAAM,CAAE,CAAC,CAAC,CAAC,MAAM,CAA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BAKG;oBAEH,SAgFC,CAAC;oBAEF,sBAAO,CACL,uBAAC,wBAAc,aACb,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,YAAY,EACjC,mBAAmB,EAAE,QAAQ,EAC7B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,UAAU,CAAC,UAAU,EAAE,EAChC,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,0BAA0B,EAAE,0BAA0B,EACtD,cAAc,EAAE,EAAE,EAClB,cAAc,EAAE,UAAU,CAAC,iBAAiB,EAAE,IAC1C,UAAU,CAAC,mBAAmB,EAAE,cAEnC,QAAQ,IACM,CAClB,EAAC;;;;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGT.d.ts","sourceRoot":"","sources":["../../src/server/getGT.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getGT.d.ts","sourceRoot":"","sources":["../../src/server/getGT.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAC9C;;;;;;;;;;;;GAYG;AACH,wBAAsB,KAAK,CACzB,EAAE,CAAC,EAAE,MAAM,GACV,OAAO,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,CAqHzE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CACxB,EAAE,CAAC,EAAE,MAAM,GACV,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CA8ClE"}
|
package/dist/server/getGT.js
CHANGED
|
@@ -110,7 +110,7 @@ var react_1 = __importStar(require("react"));
|
|
|
110
110
|
*/
|
|
111
111
|
function getGT(id) {
|
|
112
112
|
return __awaiter(this, void 0, void 0, function () {
|
|
113
|
-
var getId, I18NConfig, defaultLocale, locale,
|
|
113
|
+
var getId, I18NConfig, defaultLocale, locale, translationRequired, filteredTranslations, translationsPromise, additionalMetadata_1, dictionarySubset, flattenedDictionaryEntries, translations_1;
|
|
114
114
|
var _this = this;
|
|
115
115
|
return __generator(this, function (_a) {
|
|
116
116
|
switch (_a.label) {
|
|
@@ -123,78 +123,76 @@ function getGT(id) {
|
|
|
123
123
|
return [4 /*yield*/, (0, server_1.getLocale)()];
|
|
124
124
|
case 1:
|
|
125
125
|
locale = _a.sent();
|
|
126
|
-
|
|
127
|
-
translationRequired = I18NConfig.requiresTranslation(locale) || regionalTranslationRequired;
|
|
126
|
+
translationRequired = I18NConfig.requiresTranslation(locale);
|
|
128
127
|
filteredTranslations = {};
|
|
129
128
|
if (!translationRequired) return [3 /*break*/, 5];
|
|
130
|
-
translationsPromise = I18NConfig.
|
|
129
|
+
translationsPromise = I18NConfig.getCachedTranslations(locale);
|
|
131
130
|
return [4 /*yield*/, (0, getMetadata_1.default)()];
|
|
132
131
|
case 2:
|
|
133
132
|
additionalMetadata_1 = _a.sent();
|
|
134
|
-
renderSettings_1 = I18NConfig.getRenderSettings();
|
|
135
133
|
dictionarySubset = (id ? (0, getDictionary_1.getDictionaryEntry)(id) : (0, getDictionary_1.default)()) || {};
|
|
136
|
-
if (typeof dictionarySubset !== 'object' || Array.isArray(dictionarySubset))
|
|
134
|
+
if (typeof dictionarySubset !== 'object' || Array.isArray(dictionarySubset)) // check that it is a Dictionary, not a Dictionary Entry
|
|
137
135
|
throw new Error((0, createErrors_1.createDictionarySubsetError)(id !== null && id !== void 0 ? id : '', 'getGT'));
|
|
138
|
-
|
|
136
|
+
flattenedDictionaryEntries = (0, internal_1.flattenDictionary)(dictionarySubset);
|
|
139
137
|
return [4 /*yield*/, translationsPromise];
|
|
140
138
|
case 3:
|
|
141
139
|
translations_1 = _a.sent();
|
|
142
|
-
// Translate all strings in
|
|
143
|
-
return [4 /*yield*/, Promise.all(Object.entries(
|
|
144
|
-
var _c, entry, metadata, contentArray,
|
|
145
|
-
var
|
|
140
|
+
// Translate all strings in sub dictionary (block until completed)
|
|
141
|
+
return [4 /*yield*/, Promise.all(Object.entries(flattenedDictionaryEntries !== null && flattenedDictionaryEntries !== void 0 ? flattenedDictionaryEntries : {}).map(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
142
|
+
var _c, entry, metadata, contentArray, hash, entryId, translationEntry, translationPromise, _d, _e, error_1;
|
|
143
|
+
var _f;
|
|
146
144
|
var suffix = _b[0], dictionaryEntry = _b[1];
|
|
147
|
-
return __generator(this, function (
|
|
148
|
-
switch (
|
|
145
|
+
return __generator(this, function (_g) {
|
|
146
|
+
switch (_g.label) {
|
|
149
147
|
case 0:
|
|
150
148
|
_c = (0, internal_1.extractEntryMetadata)(dictionaryEntry), entry = _c.entry, metadata = _c.metadata;
|
|
149
|
+
// only tx strings
|
|
151
150
|
if (typeof entry !== 'string')
|
|
152
151
|
return [2 /*return*/];
|
|
153
152
|
contentArray = (0, generaltranslation_1.splitStringToContent)(entry);
|
|
153
|
+
hash = I18NConfig.hashContent(contentArray, metadata === null || metadata === void 0 ? void 0 : metadata.context);
|
|
154
154
|
entryId = getId(suffix);
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
translationEntry = (_f = translations_1[entryId]) === null || _f === void 0 ? void 0 : _f[hash];
|
|
156
|
+
if (translationEntry) {
|
|
157
|
+
// success
|
|
158
|
+
if (translationEntry.state === 'success')
|
|
159
|
+
return [2 /*return*/, (filteredTranslations[entryId] = translationEntry.target)];
|
|
160
|
+
// error
|
|
161
|
+
return [2 /*return*/];
|
|
162
|
+
}
|
|
159
163
|
translationPromise = I18NConfig.translateContent({
|
|
160
164
|
source: contentArray,
|
|
161
165
|
targetLocale: locale,
|
|
162
166
|
options: __assign({ id: entryId, hash: hash }, additionalMetadata_1),
|
|
163
167
|
});
|
|
164
|
-
|
|
165
|
-
if (renderSettings_1.method == 'subtle')
|
|
166
|
-
return [2 /*return*/, filteredTranslations[entryId] = contentArray];
|
|
167
|
-
_h.label = 1;
|
|
168
|
+
_g.label = 1;
|
|
168
169
|
case 1:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
_g.trys.push([1, 3, , 4]);
|
|
171
|
+
_d = filteredTranslations;
|
|
172
|
+
_e = entryId;
|
|
172
173
|
return [4 /*yield*/, translationPromise];
|
|
173
174
|
case 2:
|
|
174
|
-
_e
|
|
175
|
+
_d[_e] = _g.sent();
|
|
175
176
|
return [3 /*break*/, 4];
|
|
176
177
|
case 3:
|
|
177
|
-
error_1 =
|
|
178
|
+
error_1 = _g.sent();
|
|
178
179
|
console.error((0, createErrors_1.createDictionaryStringTranslationError)(entryId), error_1);
|
|
179
|
-
|
|
180
|
-
return [3 /*break*/, 4];
|
|
180
|
+
return [2 /*return*/];
|
|
181
181
|
case 4: return [2 /*return*/];
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
184
|
}); }))];
|
|
185
185
|
case 4:
|
|
186
|
-
// Translate all strings in
|
|
186
|
+
// Translate all strings in sub dictionary (block until completed)
|
|
187
187
|
_a.sent();
|
|
188
188
|
_a.label = 5;
|
|
189
189
|
case 5: return [2 /*return*/, function (id, options) {
|
|
190
|
+
// Get entry
|
|
190
191
|
id = getId(id);
|
|
191
|
-
// Get entry
|
|
192
192
|
var dictionaryEntry = (0, getDictionary_1.getDictionaryEntry)(id);
|
|
193
|
-
if (dictionaryEntry === undefined ||
|
|
194
|
-
dictionaryEntry ===
|
|
195
|
-
|
|
196
|
-
!(0, react_1.isValidElement)(dictionaryEntry) &&
|
|
197
|
-
!Array.isArray(dictionaryEntry))) {
|
|
193
|
+
if (!dictionaryEntry === undefined || // no entry found
|
|
194
|
+
(typeof dictionaryEntry === 'object' && !(0, react_1.isValidElement)(dictionaryEntry) && !Array.isArray(dictionaryEntry)) // make sure is DictionaryEntry, not Dictionary
|
|
195
|
+
) {
|
|
198
196
|
console.warn((0, createErrors_1.createNoEntryWarning)(id));
|
|
199
197
|
return undefined;
|
|
200
198
|
}
|
|
@@ -202,10 +200,12 @@ function getGT(id) {
|
|
|
202
200
|
// Get variables and variable options
|
|
203
201
|
var variables = options;
|
|
204
202
|
var variablesOptions = metadata === null || metadata === void 0 ? void 0 : metadata.variablesOptions;
|
|
203
|
+
// Render strings
|
|
205
204
|
if (typeof entry === 'string') {
|
|
206
205
|
var contentArray = filteredTranslations[id] || (0, generaltranslation_1.splitStringToContent)(entry);
|
|
207
206
|
return (0, generaltranslation_1.renderContentToString)(contentArray, [locale, defaultLocale], variables, variablesOptions);
|
|
208
207
|
}
|
|
208
|
+
// Translate on demand
|
|
209
209
|
return ((0, jsx_runtime_1.jsx)(T_1.default, __assign({ id: id, variables: variables, variablesOptions: variablesOptions }, metadata, { children: entry })));
|
|
210
210
|
}];
|
|
211
211
|
}
|
|
@@ -245,11 +245,9 @@ function useElement(id) {
|
|
|
245
245
|
id = getId(id);
|
|
246
246
|
// Get entry
|
|
247
247
|
var dictionaryEntry = (0, getDictionary_1.getDictionaryEntry)(id);
|
|
248
|
-
if (dictionaryEntry === undefined ||
|
|
249
|
-
dictionaryEntry ===
|
|
250
|
-
|
|
251
|
-
!(0, react_1.isValidElement)(dictionaryEntry) &&
|
|
252
|
-
!Array.isArray(dictionaryEntry))) {
|
|
248
|
+
if (dictionaryEntry === undefined || // no entry found
|
|
249
|
+
(typeof dictionaryEntry === 'object' && !(0, react_1.isValidElement)(dictionaryEntry) && !Array.isArray(dictionaryEntry)) // make sure is DictionaryEntry, not Dictionary
|
|
250
|
+
) {
|
|
253
251
|
console.warn((0, createErrors_1.createNoEntryWarning)(id));
|
|
254
252
|
return (0, jsx_runtime_1.jsx)(react_1.default.Fragment, {});
|
|
255
253
|
}
|
|
@@ -257,6 +255,7 @@ function useElement(id) {
|
|
|
257
255
|
// Get variables and variable options
|
|
258
256
|
var variables = options;
|
|
259
257
|
var variablesOptions = metadata === null || metadata === void 0 ? void 0 : metadata.variablesOptions;
|
|
258
|
+
// Translate on demand
|
|
260
259
|
return ((0, jsx_runtime_1.jsx)(T_1.default, __assign({ id: id, variables: variables, variablesOptions: variablesOptions }, metadata, { children: entry })));
|
|
261
260
|
}
|
|
262
261
|
return t;
|
package/dist/server/getGT.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGT.js","sourceRoot":"","sources":["../../src/server/getGT.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getGT.js","sourceRoot":"","sources":["../../src/server/getGT.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,sBAuHC;AAiBD,gCAgDC;;AA5ND,8CAM2B;AAC3B,iDAA2B;AAC3B,2EAAgF;AAChF,oCAAsC;AACtC,0EAAoD;AACpD,yDAI4B;AAC5B,uEAAiD;AACjD,uDAIgC;AAChC,6CAA8C;AAC9C;;;;;;;;;;;;GAYG;AACH,SAAsB,KAAK,CACzB,EAAW;;;;;;;oBAEL,KAAK,GAAG,UAAC,MAAc;wBAC3B,OAAO,EAAE,CAAC,CAAC,CAAC,UAAG,EAAE,cAAI,MAAM,CAAE,CAAC,CAAC,CAAC,MAAM,CAAC;oBACzC,CAAC,CAAC;oBAII,UAAU,GAAG,IAAA,uBAAa,GAAE,CAAC;oBAC7B,aAAa,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC;oBACrC,qBAAM,IAAA,kBAAS,GAAE,EAAA;;oBAA1B,MAAM,GAAG,SAAiB;oBAC1B,mBAAmB,GAAG,UAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;oBAC/D,oBAAoB,GAAsC,EAAE,CAAC;yBAE7D,m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,IAAI,iBAAiB;YAClD,CAAC,OAAO,eAAe,KAAK,QAAQ,IAAI,CAAC,IAAA,sBAAc,EAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,+CAA+C;UAC5J,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,IAAA,mCAAoB,EAAC,EAAE,CAAC,CAAC,CAAC;YACvC,OAAO,uBAAC,eAAK,CAAC,QAAQ,KAAG,CAAC;QAC5B,CAAC;QACG,IAAA,KAAsB,IAAA,+BAAoB,EAAC,eAAkC,CAAC,EAA5E,KAAK,WAAA,EAAE,QAAQ,cAA6D,CAAC;QAEnF,qCAAqC;QACrC,IAAI,SAAS,GAAG,OAAO,CAAC;QACxB,IAAI,gBAAgB,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,gBAAgB,CAAC;QAElD,sBAAsB;QACtB,OAAO,CACL,uBAAC,WAAC,aACA,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,IAC9B,QAAQ,cAEX,KAAK,IACJ,CACL,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -29,10 +29,9 @@
|
|
|
29
29
|
* @param {React.ReactNode} children - The content to be translated or displayed.
|
|
30
30
|
* @param {string} [id] - Optional identifier for the translation string. If not provided, a hash will be generated from the content.
|
|
31
31
|
* @param {Object} [renderSettings] - Optional settings controlling how fallback content is rendered during translation.
|
|
32
|
-
* @param {"skeleton" | "replace" | "
|
|
32
|
+
* @param {"skeleton" | "replace" | "default"} [renderSettings.method] - Specifies the rendering method:
|
|
33
33
|
* - "skeleton": show a placeholder while translation is loading.
|
|
34
34
|
* - "replace": show the default content as a fallback while the translation is loading.
|
|
35
|
-
* - "subtle": display children without a translation initially, with translations being applied later if available.
|
|
36
35
|
* - "default": behave like skeleton unless language is same (ie en-GB vs en-US), then behave like replace
|
|
37
36
|
* @param {number | null} [renderSettings.timeout] - Optional timeout for translation loading.
|
|
38
37
|
* @param {any} [context] - Additional context for translation key generation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"T.d.ts","sourceRoot":"","sources":["../../../src/server/inline/T.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"T.d.ts","sourceRoot":"","sources":["../../../src/server/inline/T.tsx"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,iBAAe,CAAC,CAAC,EACf,QAAQ,EACR,EAAE,EACF,OAAO,EACP,SAAS,EACT,gBAAgB,GACjB,EAAE;IACD,QAAQ,EAAE,GAAG,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,GAAG,OAAO,CAAC,GAAG,CAAC,CA+Hf;kBA1Ic,CAAC;;;AA8IhB,eAAe,CAAC,CAAC"}
|