gt-react 2.0.127 → 2.0.131
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../src/client/GTProvider.tsx"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../src/client/GTProvider.tsx"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAA;AAUpB,KAAK,eAAe,GAAG;IACnB,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB,CAAA;AAUD,wBAA8B,UAAU,CAAC,EACrC,QAAQ,EAAE,YAAY,EACtB,UAAe,EACf,GAAG,KAAK,EACX,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,CAmChC"}
|
|
@@ -30,6 +30,7 @@ require("server-only");
|
|
|
30
30
|
const I18NConfig_1 = __importDefault(require("../config/I18NConfig"));
|
|
31
31
|
const ClientProvider_1 = __importDefault(require("./ClientProvider"));
|
|
32
32
|
const ServerI18N_1 = __importDefault(require("../server/ServerI18N"));
|
|
33
|
+
const intl_1 = __importDefault(require("../intl/intl"));
|
|
33
34
|
/*
|
|
34
35
|
e.g.
|
|
35
36
|
dictionary = {
|
|
@@ -47,8 +48,13 @@ function GTProvider(_a) {
|
|
|
47
48
|
}
|
|
48
49
|
let translatedDictionary = {};
|
|
49
50
|
yield Promise.all(Object.keys(dictionary).map((id) => __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
if (typeof dictionary[id] === 'string') {
|
|
52
|
+
translatedDictionary[id] = yield (0, intl_1.default)(dictionary[id], userLanguage, Object.assign(Object.assign({}, props), { id }));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
/* @ts-expect-error Server Component */
|
|
56
|
+
translatedDictionary[id] = (0, jsx_runtime_1.jsx)(ServerI18N_1.default, Object.assign({ userLanguage: userLanguage, id: id }, props, { children: dictionary[id] }));
|
|
57
|
+
}
|
|
52
58
|
})));
|
|
53
59
|
return ((0, jsx_runtime_1.jsx)(ClientProvider_1.default, { defaultLanguage: defaultLanguage, dictionary: translatedDictionary, children: children }));
|
|
54
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTProvider.js","sourceRoot":"","sources":["../../src/client/GTProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"GTProvider.js","sourceRoot":"","sources":["../../src/client/GTProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,6BAuCC;;AAnED,gBAAgB;AAChB,uBAAoB;AAIpB,sEAA8C;AAE9C,sEAA8C;AAC9C,sEAA8C;AAC9C,wDAAgC;AAWhC;;;;;;EAME;AAEF,SAA8B,UAAU,CAAC,EAIvB;;YAJuB,EACrC,QAAQ,EAAE,YAAY,EACtB,UAAU,GAAG,EAAE,OAED,EADX,KAAK,cAH6B,0CAIxC,CADW;QAGR,MAAM,eAAe,GAAG,oBAAU,CAAC,kBAAkB,EAAE,CAAC;QAExD,MAAM,mBAAmB,GAAY,CAAC,QAAQ,IAAI,oBAAU,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QAC/G,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACvB,OAAO,CACH,uBAAC,wBAAc,IACX,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,YA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