gt-next 6.16.27 → 6.16.28
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 +14 -0
- package/dist/_dictionary.js +8 -5
- package/dist/_dictionary.js.map +1 -1
- package/dist/_load-dictionary.js +8 -5
- package/dist/_load-dictionary.js.map +1 -1
- package/dist/_load-translations.js +8 -5
- package/dist/_load-translations.js.map +1 -1
- package/dist/_request.js +11 -8
- package/dist/_request.js.map +1 -1
- package/dist/_virtual/_rolldown/runtime.js +23 -0
- package/dist/branches/Branch.js +34 -49
- package/dist/branches/Branch.js.map +1 -1
- package/dist/branches/Plural.js +36 -47
- package/dist/branches/Plural.js.map +1 -1
- package/dist/client.js +32 -34
- package/dist/config-dir/DictionaryManager.js +49 -103
- package/dist/config-dir/DictionaryManager.js.map +1 -1
- package/dist/config-dir/I18NConfiguration.js +201 -339
- package/dist/config-dir/I18NConfiguration.js.map +1 -1
- package/dist/config-dir/getI18NConfig.js +42 -61
- package/dist/config-dir/getI18NConfig.js.map +1 -1
- package/dist/config-dir/loadTranslation.js +36 -113
- package/dist/config-dir/loadTranslation.js.map +1 -1
- package/dist/config-dir/props/defaultWithGTConfigProps.js +43 -78
- package/dist/config-dir/props/defaultWithGTConfigProps.js.map +1 -1
- package/dist/config-dir/props/withGTConfigProps.js +15 -18
- package/dist/config-dir/props/withGTConfigProps.js.map +1 -1
- package/dist/config-dir/utils/resolveConfigFilepath.js +27 -37
- package/dist/config-dir/utils/resolveConfigFilepath.js.map +1 -1
- package/dist/config-dir/utils/resolveRequestFunctionPaths.js +27 -39
- package/dist/config-dir/utils/resolveRequestFunctionPaths.js.map +1 -1
- package/dist/config-dir/utils/validateCompiler.js +27 -35
- package/dist/config-dir/utils/validateCompiler.js.map +1 -1
- package/dist/config.js +329 -520
- package/dist/config.js.map +1 -1
- package/dist/dictionary/getDictionary.js +46 -115
- package/dist/dictionary/getDictionary.js.map +1 -1
- package/dist/dictionary/setDictionary.js +7 -5
- package/dist/dictionary/setDictionary.js.map +1 -1
- package/dist/errors/cacheComponents.d.ts +4 -4
- package/dist/errors/cacheComponents.d.ts.map +1 -1
- package/dist/errors/cacheComponents.js +40 -13
- package/dist/errors/cacheComponents.js.map +1 -1
- package/dist/errors/createErrors.d.ts +12 -12
- package/dist/errors/createErrors.d.ts.map +1 -1
- package/dist/errors/createErrors.js +236 -165
- package/dist/errors/createErrors.js.map +1 -1
- package/dist/errors/diagnostics.d.ts +6 -0
- package/dist/errors/diagnostics.d.ts.map +1 -0
- package/dist/errors/diagnostics.js +22 -0
- package/dist/errors/diagnostics.js.map +1 -0
- package/dist/errors/ssg.d.ts +7 -7
- package/dist/errors/ssg.d.ts.map +1 -1
- package/dist/errors/ssg.js +60 -32
- package/dist/errors/ssg.js.map +1 -1
- package/dist/index.client.d.ts +3 -2
- package/dist/index.client.d.ts.map +1 -1
- package/dist/index.client.js +43 -43
- package/dist/index.client.js.map +1 -1
- package/dist/index.server.d.ts +3 -2
- package/dist/index.server.d.ts.map +1 -1
- package/dist/index.server.js +60 -58
- package/dist/index.server.js.map +1 -1
- package/dist/index.types.d.ts +2 -2
- package/dist/index.types.d.ts.map +1 -1
- package/dist/index.types.js +464 -462
- package/dist/index.types.js.map +1 -1
- package/dist/internal/_getDomain.js +11 -51
- package/dist/internal/_getDomain.js.map +1 -1
- package/dist/internal/_getLocale.js +11 -51
- package/dist/internal/_getLocale.js.map +1 -1
- package/dist/internal/_getRegion.js +11 -51
- package/dist/internal/_getRegion.js.map +1 -1
- package/dist/internal/static/_getDomain.js +11 -48
- package/dist/internal/static/_getDomain.js.map +1 -1
- package/dist/internal/static/_getLocale.js +11 -48
- package/dist/internal/static/_getLocale.js.map +1 -1
- package/dist/internal/static/_getRegion.js +11 -48
- package/dist/internal/static/_getRegion.js.map +1 -1
- package/dist/middleware-dir/createNextMiddleware.js +129 -233
- package/dist/middleware-dir/createNextMiddleware.js.map +1 -1
- package/dist/middleware-dir/utils.js +145 -244
- package/dist/middleware-dir/utils.js.map +1 -1
- package/dist/middleware.js +3 -6
- package/dist/plugin/checks/cacheComponentsChecks.js +17 -37
- package/dist/plugin/checks/cacheComponentsChecks.js.map +1 -1
- package/dist/plugin/checks/ssgChecks.js +10 -21
- package/dist/plugin/checks/ssgChecks.js.map +1 -1
- package/dist/plugin/constants.js +15 -10
- package/dist/plugin/constants.js.map +1 -1
- package/dist/plugin/getStableNextVersionInfo.d.ts.map +1 -1
- package/dist/plugin/getStableNextVersionInfo.js +60 -63
- package/dist/plugin/getStableNextVersionInfo.js.map +1 -1
- package/dist/provider/ClientProviderWrapper.js +65 -88
- package/dist/provider/ClientProviderWrapper.js.map +1 -1
- package/dist/provider/GTProvider.js +44 -132
- package/dist/provider/GTProvider.js.map +1 -1
- package/dist/request/getLocale.js +35 -94
- package/dist/request/getLocale.js.map +1 -1
- package/dist/request/getLocaleDirection.js +24 -30
- package/dist/request/getLocaleDirection.js.map +1 -1
- package/dist/request/getRegion.js +23 -74
- package/dist/request/getRegion.js.map +1 -1
- package/dist/request/headers/getNextDomain.js +17 -60
- package/dist/request/headers/getNextDomain.js.map +1 -1
- package/dist/request/headers/getNextLocale.js +34 -90
- package/dist/request/headers/getNextLocale.js.map +1 -1
- package/dist/request/headers/getNextRegion.js +10 -55
- package/dist/request/headers/getNextRegion.js.map +1 -1
- package/dist/request/localeStore.js +7 -5
- package/dist/request/localeStore.js.map +1 -1
- package/dist/request/registerLocale.js +15 -13
- package/dist/request/registerLocale.js.map +1 -1
- package/dist/request/types.js +16 -13
- package/dist/request/types.js.map +1 -1
- package/dist/request/utils/getRequestFunction.js +122 -214
- package/dist/request/utils/getRequestFunction.js.map +1 -1
- package/dist/request/utils/isSSR.js +21 -26
- package/dist/request/utils/isSSR.js.map +1 -1
- package/dist/request/utils/legacyGetLocaleFunction.js +17 -70
- package/dist/request/utils/legacyGetLocaleFunction.js.map +1 -1
- package/dist/request/utils/legacyGetRegionFunction.js +14 -65
- package/dist/request/utils/legacyGetRegionFunction.js.map +1 -1
- package/dist/request/utils/legacyGetRequestFunction.js +157 -250
- package/dist/request/utils/legacyGetRequestFunction.js.map +1 -1
- package/dist/resolvers/resolveDictionaryLoader.js +20 -74
- package/dist/resolvers/resolveDictionaryLoader.js.map +1 -1
- package/dist/resolvers/resolveTranslationLoader.js +20 -74
- package/dist/resolvers/resolveTranslationLoader.js.map +1 -1
- package/dist/server-dir/buildtime/T.js +122 -205
- package/dist/server-dir/buildtime/T.js.map +1 -1
- package/dist/server-dir/buildtime/getTranslationFunction.d.ts +1 -1
- package/dist/server-dir/buildtime/getTranslationFunction.d.ts.map +1 -1
- package/dist/server-dir/buildtime/getTranslationFunction.js +269 -406
- package/dist/server-dir/buildtime/getTranslationFunction.js.map +1 -1
- package/dist/server-dir/buildtime/getTranslations.d.ts +1 -1
- package/dist/server-dir/buildtime/getTranslations.d.ts.map +1 -1
- package/dist/server-dir/buildtime/getTranslations.js +235 -361
- package/dist/server-dir/buildtime/getTranslations.js.map +1 -1
- package/dist/server-dir/runtime/_Tx.js +105 -207
- package/dist/server-dir/runtime/_Tx.js.map +1 -1
- package/dist/server-dir/runtime/tx.js +103 -173
- package/dist/server-dir/runtime/tx.js.map +1 -1
- package/dist/server-dir/variables/renderVariable.js +40 -47
- package/dist/server-dir/variables/renderVariable.js.map +1 -1
- package/dist/server.js +80 -43
- package/dist/server.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -3
- package/dist/utils/constants.js +6 -4
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/cookies.js +16 -12
- package/dist/utils/cookies.js.map +1 -1
- package/dist/utils/errors.js +18 -35
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/headers.js +8 -6
- package/dist/utils/headers.js.map +1 -1
- package/dist/utils/types.js +1 -3
- package/dist/utils/use.js +8 -72
- package/dist/utils/use.js.map +1 -1
- package/dist/variables/Currency.js +36 -48
- package/dist/variables/Currency.js.map +1 -1
- package/dist/variables/DateTime.js +34 -49
- package/dist/variables/DateTime.js.map +1 -1
- package/dist/variables/Num.js +38 -50
- package/dist/variables/Num.js.map +1 -1
- package/dist/variables/RelativeTime.js +56 -68
- package/dist/variables/RelativeTime.js.map +1 -1
- package/dist/variables/Var.js +25 -21
- package/dist/variables/Var.js.map +1 -1
- package/package.json +10 -8
- package/dist/client.js.map +0 -1
- package/dist/gt_swc_plugin.wasm +0 -0
- package/dist/middleware.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/types.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# gt-next
|
|
2
2
|
|
|
3
|
+
## 6.16.28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1419](https://github.com/generaltranslation/gt/pull/1419) [`a877a2a`](https://github.com/generaltranslation/gt/commit/a877a2a5bd5ca47b199c6caf53a6d60d96e3a300) Thanks [@bgub](https://github.com/bgub)! - Improve diagnostic messages and package-local diagnostic formatting.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`bb3624e`](https://github.com/generaltranslation/gt/commit/bb3624e58546c334c04370a1f5a262238bd040fa), [`a877a2a`](https://github.com/generaltranslation/gt/commit/a877a2a5bd5ca47b199c6caf53a6d60d96e3a300)]:
|
|
10
|
+
- @generaltranslation/format@0.1.1
|
|
11
|
+
- generaltranslation@8.2.15
|
|
12
|
+
- gt-i18n@0.9.3
|
|
13
|
+
- gt-react@10.19.17
|
|
14
|
+
- @generaltranslation/compiler@1.3.23
|
|
15
|
+
- @generaltranslation/supported-locales@2.0.73
|
|
16
|
+
|
|
3
17
|
## 6.16.27
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/_dictionary.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#region src/_dictionary.ts
|
|
6
|
+
var _dictionary_default = {};
|
|
7
|
+
throw new Error(`Something has gone seriously wrong if you're seeing this error message. Check docs.generaltranslation.com for the latest documentation and make sure you've got the library configured properly.`);
|
|
8
|
+
|
|
6
9
|
//# sourceMappingURL=_dictionary.js.map
|
package/dist/_dictionary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dictionary.js","
|
|
1
|
+
{"version":3,"file":"_dictionary.js","names":[],"sources":["../src/_dictionary.ts"],"sourcesContent":["// hidden internal route\nexport default {};\nthrow new Error(\n `Something has gone seriously wrong if you're seeing this error message. Check docs.generaltranslation.com for the latest documentation and make sure you've got the library configured properly.`\n);\n"],"mappings":";;;;;AACA,IAAA,sBAAe,EAAE;AACjB,MAAM,IAAI,MACR,mMACD"}
|
package/dist/_load-dictionary.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#region src/_load-dictionary.ts
|
|
6
|
+
var _load_dictionary_default = {};
|
|
7
|
+
throw new Error(`Something has gone seriously wrong if you're seeing this error message. Check docs.generaltranslation.com for the latest documentation and make sure you've got the library configured properly.`);
|
|
8
|
+
|
|
6
9
|
//# sourceMappingURL=_load-dictionary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_load-dictionary.js","
|
|
1
|
+
{"version":3,"file":"_load-dictionary.js","names":[],"sources":["../src/_load-dictionary.ts"],"sourcesContent":["// hidden internal route\nexport default {};\nthrow new Error(\n `Something has gone seriously wrong if you're seeing this error message. Check docs.generaltranslation.com for the latest documentation and make sure you've got the library configured properly.`\n);\n"],"mappings":";;;;;AACA,IAAA,2BAAe,EAAE;AACjB,MAAM,IAAI,MACR,mMACD"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#region src/_load-translations.ts
|
|
6
|
+
var _load_translations_default = {};
|
|
7
|
+
throw new Error(`Something has gone seriously wrong if you're seeing this error message. Check docs.generaltranslation.com for the latest documentation and make sure you've got the library configured properly.`);
|
|
8
|
+
|
|
6
9
|
//# sourceMappingURL=_load-translations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_load-translations.js","
|
|
1
|
+
{"version":3,"file":"_load-translations.js","names":[],"sources":["../src/_load-translations.ts"],"sourcesContent":["// hidden internal route\nexport default {};\nthrow new Error(\n `Something has gone seriously wrong if you're seeing this error message. Check docs.generaltranslation.com for the latest documentation and make sure you've got the library configured properly.`\n);\n"],"mappings":";;;;;AACA,IAAA,6BAAe,EAAE;AACjB,MAAM,IAAI,MACR,mMACD"}
|
package/dist/_request.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#region src/_request.ts
|
|
6
|
+
var _request_default = { getLocale: () => {
|
|
7
|
+
throw new Error(`Unable to import custom getLocale(). Check docs.generaltranslation.com for the latest documentation.`);
|
|
8
|
+
} };
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.default = _request_default;
|
|
11
|
+
|
|
9
12
|
//# sourceMappingURL=_request.js.map
|
package/dist/_request.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_request.js","
|
|
1
|
+
{"version":3,"file":"_request.js","names":[],"sources":["../src/_request.ts"],"sourcesContent":["// hidden internal route\nexport default {\n getLocale: () => {\n throw new Error(\n `Unable to import custom getLocale(). Check docs.generaltranslation.com for the latest documentation.`\n );\n },\n};\n"],"mappings":";;;;;AACA,IAAA,mBAAe,EACb,iBAAiB;AACf,OAAM,IAAI,MACR,uGACD;GAEJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|
package/dist/branches/Branch.js
CHANGED
|
@@ -1,53 +1,38 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.Branch = Branch;
|
|
15
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
//#region src/branches/Branch.tsx
|
|
16
5
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function Branch(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (typeof branch === 'string' && branch.startsWith('data-')) {
|
|
44
|
-
branch = undefined;
|
|
45
|
-
}
|
|
46
|
-
var renderedBranch = branch && typeof branches[branch] !== 'undefined'
|
|
47
|
-
? branches[branch]
|
|
48
|
-
: children;
|
|
49
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: renderedBranch });
|
|
6
|
+
* The `<Branch>` component dynamically renders a specified branch of content or a fallback child component.
|
|
7
|
+
* It allows for flexible content switching based on the `branch` prop and an object of possible branches (`...branches`).
|
|
8
|
+
* If the specified `branch` is present in the `branches` object, it renders the content of that branch.
|
|
9
|
+
* If the `branch` is not found, it renders the provided `children` as fallback content.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```jsx
|
|
13
|
+
* <Branch
|
|
14
|
+
* branch={user.gender}
|
|
15
|
+
* female={<p>She is happy.</p>}
|
|
16
|
+
* male={<p>He is happy.</p>}
|
|
17
|
+
* >
|
|
18
|
+
* <p>They are happy.</p>
|
|
19
|
+
* </Branch>
|
|
20
|
+
* ```
|
|
21
|
+
* If the `branch` prop is set to `"male"`, it will render `<p>He is happy.</p>`. If the `branch` is set to "female" it will render `<p>She is happy.</p>`. If the gender is not set or does not match any props, it renders the fallback content `<p>Fallback content</p>`.
|
|
22
|
+
*
|
|
23
|
+
* @param {any} [children] - Fallback content to render if no matching branch is found.
|
|
24
|
+
* @param {any} [branch] - The name of the branch to render. The component looks for this key in the `...branches` object.
|
|
25
|
+
* @param {...branches} [branches] - A spread object containing possible branches as keys and their corresponding content as values.
|
|
26
|
+
* @returns {React.JSX.Element} The rendered branch or fallback content.
|
|
27
|
+
*/
|
|
28
|
+
function Branch({ children, branch, ...branches }) {
|
|
29
|
+
branch = branch?.toString();
|
|
30
|
+
if (typeof branch === "string" && branch.startsWith("data-")) branch = void 0;
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: branch && typeof branches[branch] !== "undefined" ? branches[branch] : children });
|
|
50
32
|
}
|
|
51
33
|
/** @internal _gtt - The GT transformation for the component. */
|
|
52
|
-
Branch._gtt =
|
|
34
|
+
Branch._gtt = "branch";
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.Branch = Branch;
|
|
37
|
+
|
|
53
38
|
//# sourceMappingURL=Branch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Branch.js","
|
|
1
|
+
{"version":3,"file":"Branch.js","names":[],"sources":["../../src/branches/Branch.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\n/**\n * The `<Branch>` component dynamically renders a specified branch of content or a fallback child component.\n * It allows for flexible content switching based on the `branch` prop and an object of possible branches (`...branches`).\n * If the specified `branch` is present in the `branches` object, it renders the content of that branch.\n * If the `branch` is not found, it renders the provided `children` as fallback content.\n *\n * @example\n * ```jsx\n * <Branch\n * branch={user.gender}\n * female={<p>She is happy.</p>}\n * male={<p>He is happy.</p>}\n * >\n * <p>They are happy.</p>\n * </Branch>\n * ```\n * If the `branch` prop is set to `\"male\"`, it will render `<p>He is happy.</p>`. If the `branch` is set to \"female\" it will render `<p>She is happy.</p>`. If the gender is not set or does not match any props, it renders the fallback content `<p>Fallback content</p>`.\n *\n * @param {any} [children] - Fallback content to render if no matching branch is found.\n * @param {any} [branch] - The name of the branch to render. The component looks for this key in the `...branches` object.\n * @param {...branches} [branches] - A spread object containing possible branches as keys and their corresponding content as values.\n * @returns {React.JSX.Element} The rendered branch or fallback content.\n */\nexport function Branch({\n children,\n branch,\n ...branches\n}: {\n children?: ReactNode;\n branch?: string | number | boolean;\n [key: string]: ReactNode;\n}): React.JSX.Element {\n branch = branch?.toString();\n // ignore data-* attributes\n if (typeof branch === 'string' && branch.startsWith('data-')) {\n branch = undefined;\n }\n const renderedBranch =\n branch && typeof branches[branch] !== 'undefined'\n ? branches[branch]\n : children;\n return <>{renderedBranch}</>;\n}\n/** @internal _gtt - The GT transformation for the component. */\nBranch._gtt = 'branch';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,OAAO,EACrB,UACA,QACA,GAAG,YAKiB;AACpB,UAAS,QAAQ,UAAU;AAE3B,KAAI,OAAO,WAAW,YAAY,OAAO,WAAW,QAAQ,CAC1D,UAAS,KAAA;AAMX,QAAO,iBAAA,GAAA,kBAAA,KAAA,kBAAA,UAAA,EAAA,UAHL,UAAU,OAAO,SAAS,YAAY,cAClC,SAAS,UACT,UACsB,CAAA;;;AAG9B,OAAO,OAAO"}
|
package/dist/branches/Plural.js
CHANGED
|
@@ -1,51 +1,40 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.Plural = Plural;
|
|
15
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
var internal_1 = require("gt-react/internal");
|
|
17
|
-
var getI18NConfig_1 = require("../config-dir/getI18NConfig");
|
|
18
|
-
var getLocale_1 = require("../request/getLocale");
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
3
|
+
const require_config_dir_getI18NConfig = require("../config-dir/getI18NConfig.js");
|
|
4
|
+
const require_request_getLocale = require("../request/getLocale.js");
|
|
5
|
+
let gt_react_internal = require("gt-react/internal");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
//#region src/branches/Plural.tsx
|
|
19
8
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function Plural(
|
|
44
|
-
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (typeof n === 'number'
|
|
46
|
-
? (0, internal_1.getPluralBranch)(n, locales, branches)
|
|
47
|
-
: children) || children }));
|
|
9
|
+
* The `<Plural>` component dynamically renders content based on the plural form of the given number (`n`).
|
|
10
|
+
* It determines which content to display by matching the value of `n` to the appropriate pluralization branch,
|
|
11
|
+
* based on the current locale or a default locale. If no matching plural branch is found, the component renders
|
|
12
|
+
* the fallback `children` content.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```jsx
|
|
16
|
+
* <Plural
|
|
17
|
+
* n={n}
|
|
18
|
+
* one={<>There is <Num children={n}/> item.</>}
|
|
19
|
+
* other={<>There are <Num children={n}/> items.</>}
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
* In this ex ample, if `n` is 1, it renders `"There is 1 item"`. If `n` is a different number, it renders
|
|
23
|
+
* `"There are {n} items"`.
|
|
24
|
+
*
|
|
25
|
+
* @param {any} [children] - Fallback content to render if no matching plural branch is found.
|
|
26
|
+
* @param {number} [n] - The number used to determine the plural form. This is required for pluralization to work.
|
|
27
|
+
* @param {...branches} [branches] - A spread object containing possible plural branches, typically including `one` for singular
|
|
28
|
+
* and `other` for plural forms, but it may vary depending on the locale.
|
|
29
|
+
* @returns {React.JSX.Element} The rendered content corresponding to the plural form of `n`, or the fallback content.
|
|
30
|
+
* @throws {Error} If `n` is not provided or not a valid number.
|
|
31
|
+
*/
|
|
32
|
+
function Plural({ children, n, locales = [require_request_getLocale.useLocale(), require_config_dir_getI18NConfig.getI18NConfig().getDefaultLocale()], ...branches }) {
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: (typeof n === "number" ? (0, gt_react_internal.getPluralBranch)(n, locales, branches) : children) || children });
|
|
48
34
|
}
|
|
49
35
|
/** @internal _gtt - The GT transformation for the component. */
|
|
50
|
-
Plural._gtt =
|
|
36
|
+
Plural._gtt = "plural";
|
|
37
|
+
//#endregion
|
|
38
|
+
exports.Plural = Plural;
|
|
39
|
+
|
|
51
40
|
//# sourceMappingURL=Plural.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plural.js","
|
|
1
|
+
{"version":3,"file":"Plural.js","names":["useLocale","getI18NConfig"],"sources":["../../src/branches/Plural.tsx"],"sourcesContent":["import { getPluralBranch } from 'gt-react/internal';\nimport type { ReactNode } from 'react';\nimport { getI18NConfig } from '../config-dir/getI18NConfig';\nimport { useLocale } from '../request/getLocale';\n\n/**\n * The `<Plural>` component dynamically renders content based on the plural form of the given number (`n`).\n * It determines which content to display by matching the value of `n` to the appropriate pluralization branch,\n * based on the current locale or a default locale. If no matching plural branch is found, the component renders\n * the fallback `children` content.\n *\n * @example\n * ```jsx\n * <Plural\n * n={n}\n * one={<>There is <Num children={n}/> item.</>}\n * other={<>There are <Num children={n}/> items.</>}\n * />\n * ```\n * In this ex ample, if `n` is 1, it renders `\"There is 1 item\"`. If `n` is a different number, it renders\n * `\"There are {n} items\"`.\n *\n * @param {any} [children] - Fallback content to render if no matching plural branch is found.\n * @param {number} [n] - The number used to determine the plural form. This is required for pluralization to work.\n * @param {...branches} [branches] - A spread object containing possible plural branches, typically including `one` for singular\n * and `other` for plural forms, but it may vary depending on the locale.\n * @returns {React.JSX.Element} The rendered content corresponding to the plural form of `n`, or the fallback content.\n * @throws {Error} If `n` is not provided or not a valid number.\n */\nexport function Plural({\n children,\n n,\n locales = [useLocale(), getI18NConfig().getDefaultLocale()],\n ...branches\n}: {\n children?: ReactNode;\n n?: number;\n locales?: string[];\n [key: string]: ReactNode;\n}) {\n return (\n <>\n {(typeof n === 'number'\n ? getPluralBranch(n, locales, branches)\n : children) || children}\n </>\n );\n}\n/** @internal _gtt - The GT transformation for the component. */\nPlural._gtt = 'plural';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAgB,OAAO,EACrB,UACA,GACA,UAAU,CAACA,0BAAAA,WAAW,EAAEC,iCAAAA,eAAe,CAAC,kBAAkB,CAAC,EAC3D,GAAG,YAMF;AACD,QACE,iBAAA,GAAA,kBAAA,KAAA,kBAAA,UAAA,EAAA,WACI,OAAO,MAAM,YAAA,GAAA,kBAAA,iBACK,GAAG,SAAS,SAAS,GACrC,aAAa,UAChB,CAAA;;;AAIP,OAAO,OAAO"}
|
package/dist/client.js
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
"use
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Object.defineProperty(exports, "useMessages", { enumerable: true, get: function () { return client_1.useMessages; } });
|
|
34
|
-
//# sourceMappingURL=client.js.map
|
|
1
|
+
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("./_virtual/_rolldown/runtime.js");
|
|
4
|
+
let gt_react_client = require("gt-react/client");
|
|
5
|
+
exports.Branch = gt_react_client.Branch;
|
|
6
|
+
exports.Currency = gt_react_client.Currency;
|
|
7
|
+
exports.DateTime = gt_react_client.DateTime;
|
|
8
|
+
exports.GTClientProvider = gt_react_client.GTProvider;
|
|
9
|
+
exports.LocaleSelector = gt_react_client.LocaleSelector;
|
|
10
|
+
exports.Num = gt_react_client.Num;
|
|
11
|
+
exports.Plural = gt_react_client.Plural;
|
|
12
|
+
exports.RegionSelector = gt_react_client.RegionSelector;
|
|
13
|
+
exports.RelativeTime = gt_react_client.RelativeTime;
|
|
14
|
+
exports.T = gt_react_client.T;
|
|
15
|
+
exports.Var = gt_react_client.Var;
|
|
16
|
+
exports.decodeMsg = gt_react_client.decodeMsg;
|
|
17
|
+
exports.decodeOptions = gt_react_client.decodeOptions;
|
|
18
|
+
exports.msg = gt_react_client.msg;
|
|
19
|
+
exports.useDefaultLocale = gt_react_client.useDefaultLocale;
|
|
20
|
+
exports.useGT = gt_react_client.useGT;
|
|
21
|
+
exports.useGTClass = gt_react_client.useGTClass;
|
|
22
|
+
exports.useLocale = gt_react_client.useLocale;
|
|
23
|
+
exports.useLocaleDirection = gt_react_client.useLocaleDirection;
|
|
24
|
+
exports.useLocaleProperties = gt_react_client.useLocaleProperties;
|
|
25
|
+
exports.useLocaleSelector = gt_react_client.useLocaleSelector;
|
|
26
|
+
exports.useLocales = gt_react_client.useLocales;
|
|
27
|
+
exports.useMessages = gt_react_client.useMessages;
|
|
28
|
+
exports.useRegion = gt_react_client.useRegion;
|
|
29
|
+
exports.useRegionSelector = gt_react_client.useRegionSelector;
|
|
30
|
+
exports.useSetLocale = gt_react_client.useSetLocale;
|
|
31
|
+
exports.useTranslations = gt_react_client.useTranslations;
|
|
32
|
+
exports.useVersionId = gt_react_client.useVersionId;
|
|
@@ -1,106 +1,52 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.dictionaryManager = exports.DictionaryManager = void 0;
|
|
40
|
-
var format_1 = require("@generaltranslation/format");
|
|
41
|
-
var resolveDictionaryLoader_1 = require("../resolvers/resolveDictionaryLoader");
|
|
42
|
-
var createErrors_1 = require("../errors/createErrors");
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
3
|
+
const require_errors_createErrors = require("../errors/createErrors.js");
|
|
4
|
+
const require_resolvers_resolveDictionaryLoader = require("../resolvers/resolveDictionaryLoader.js");
|
|
5
|
+
let _generaltranslation_format = require("@generaltranslation/format");
|
|
6
|
+
//#region src/config-dir/DictionaryManager.ts
|
|
43
7
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var DictionaryManager =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (process.env.NODE_ENV === 'development') {
|
|
86
|
-
console.warn((0, createErrors_1.customLoadDictionaryWarning)(reference), error_1);
|
|
87
|
-
}
|
|
88
|
-
return [2 /*return*/, undefined];
|
|
89
|
-
case 4: return [2 /*return*/, result];
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* @description Sets the dictionary for a given locale
|
|
96
|
-
* @param {string} locale - The locale code.
|
|
97
|
-
* @param {Dictionary} dictionary - The dictionary data.
|
|
98
|
-
*/
|
|
99
|
-
DictionaryManager.prototype.setDictionary = function (locale, dictionary) {
|
|
100
|
-
this.dictionaryMap.set(locale, dictionary);
|
|
101
|
-
};
|
|
102
|
-
return DictionaryManager;
|
|
103
|
-
}());
|
|
8
|
+
* Manages Dictionary
|
|
9
|
+
*/
|
|
10
|
+
var DictionaryManager = class {
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of TranslationManager.
|
|
13
|
+
* @constructor
|
|
14
|
+
*/
|
|
15
|
+
constructor() {
|
|
16
|
+
this.dictionaryMap = /* @__PURE__ */ new Map();
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves dictionary for a given locale from bundle.
|
|
20
|
+
* @param {string} locale - The locale code.
|
|
21
|
+
* @returns {Promise<Dictionary | undefined>} The dictionary data or undefined if not found.
|
|
22
|
+
*/
|
|
23
|
+
async getDictionary(locale) {
|
|
24
|
+
const reference = process.env._GENERALTRANSLATION_GT_SERVICES_ENABLED === "true" ? (0, _generaltranslation_format.standardizeLocale)(locale) : locale;
|
|
25
|
+
let result = this.dictionaryMap.get(reference);
|
|
26
|
+
if (result) return result;
|
|
27
|
+
const customLoadDictionary = require_resolvers_resolveDictionaryLoader.resolveDictionaryLoader();
|
|
28
|
+
if (customLoadDictionary) try {
|
|
29
|
+
result = await customLoadDictionary(reference);
|
|
30
|
+
if (!result) return void 0;
|
|
31
|
+
this.dictionaryMap.set(reference, result);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (process.env.NODE_ENV === "development") console.warn(require_errors_createErrors.customLoadDictionaryWarning(reference), error);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @description Sets the dictionary for a given locale
|
|
40
|
+
* @param {string} locale - The locale code.
|
|
41
|
+
* @param {Dictionary} dictionary - The dictionary data.
|
|
42
|
+
*/
|
|
43
|
+
setDictionary(locale, dictionary) {
|
|
44
|
+
this.dictionaryMap.set(locale, dictionary);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const dictionaryManager = new DictionaryManager();
|
|
48
|
+
//#endregion
|
|
104
49
|
exports.DictionaryManager = DictionaryManager;
|
|
105
|
-
exports.dictionaryManager =
|
|
50
|
+
exports.dictionaryManager = dictionaryManager;
|
|
51
|
+
|
|
106
52
|
//# sourceMappingURL=DictionaryManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryManager.js","
|
|
1
|
+
{"version":3,"file":"DictionaryManager.js","names":["resolveDictionaryLoader","customLoadDictionaryWarning"],"sources":["../../src/config-dir/DictionaryManager.ts"],"sourcesContent":["import { standardizeLocale } from '@generaltranslation/format';\nimport { Dictionary } from 'gt-react/internal';\nimport { resolveDictionaryLoader } from '../resolvers/resolveDictionaryLoader';\nimport { customLoadDictionaryWarning } from '../errors/createErrors';\n\n/**\n * Manages Dictionary\n */\nexport class DictionaryManager {\n private dictionaryMap: Map<string, Dictionary>;\n\n /**\n * Creates an instance of TranslationManager.\n * @constructor\n */\n constructor() {\n this.dictionaryMap = new Map();\n }\n\n /**\n * Retrieves dictionary for a given locale from bundle.\n * @param {string} locale - The locale code.\n * @returns {Promise<Dictionary | undefined>} The dictionary data or undefined if not found.\n */\n async getDictionary(locale: string): Promise<Dictionary | undefined> {\n const reference =\n process.env._GENERALTRANSLATION_GT_SERVICES_ENABLED === 'true'\n ? standardizeLocale(locale)\n : locale;\n\n // Check internal cache\n let result = this.dictionaryMap.get(reference);\n if (result) return result;\n\n // Load dictionary\n const customLoadDictionary = resolveDictionaryLoader();\n if (customLoadDictionary) {\n try {\n result = (await customLoadDictionary(reference)) as\n | Dictionary\n | undefined;\n if (!result) return undefined;\n this.dictionaryMap.set(reference, result);\n } catch (error) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(customLoadDictionaryWarning(reference), error);\n }\n return undefined;\n }\n }\n\n return result;\n }\n\n /**\n * @description Sets the dictionary for a given locale\n * @param {string} locale - The locale code.\n * @param {Dictionary} dictionary - The dictionary data.\n */\n setDictionary(locale: string, dictionary: Dictionary) {\n this.dictionaryMap.set(locale, dictionary);\n }\n}\n\nexport const dictionaryManager = new DictionaryManager();\n"],"mappings":";;;;;;;;;AAQA,IAAa,oBAAb,MAA+B;;;;;CAO7B,cAAc;AACZ,OAAK,gCAAgB,IAAI,KAAK;;;;;;;CAQhC,MAAM,cAAc,QAAiD;EACnE,MAAM,YACJ,QAAQ,IAAI,4CAA4C,UAAA,GAAA,2BAAA,mBAClC,OAAO,GACzB;EAGN,IAAI,SAAS,KAAK,cAAc,IAAI,UAAU;AAC9C,MAAI,OAAQ,QAAO;EAGnB,MAAM,uBAAuBA,0CAAAA,yBAAyB;AACtD,MAAI,qBACF,KAAI;AACF,YAAU,MAAM,qBAAqB,UAAU;AAG/C,OAAI,CAAC,OAAQ,QAAO,KAAA;AACpB,QAAK,cAAc,IAAI,WAAW,OAAO;WAClC,OAAO;AACd,OAAI,QAAQ,IAAI,aAAa,cAC3B,SAAQ,KAAKC,4BAAAA,4BAA4B,UAAU,EAAE,MAAM;AAE7D;;AAIJ,SAAO;;;;;;;CAQT,cAAc,QAAgB,YAAwB;AACpD,OAAK,cAAc,IAAI,QAAQ,WAAW;;;AAI9C,MAAa,oBAAoB,IAAI,mBAAmB"}
|