gt-next 5.2.7 → 5.2.9-alpha.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/dist/_load-dictionary.d.ts +3 -0
- package/dist/_load-dictionary.d.ts.map +1 -0
- package/dist/_load-dictionary.js +6 -0
- package/dist/_load-dictionary.js.map +1 -0
- package/dist/{_load-messages.d.ts → _routing.d.ts} +1 -1
- package/dist/_routing.d.ts.map +1 -0
- package/dist/{_load-messages.js → _routing.js} +1 -1
- package/dist/_routing.js.map +1 -0
- package/dist/config-dir/DictionaryManager.d.ts +22 -0
- package/dist/config-dir/DictionaryManager.d.ts.map +1 -0
- package/dist/config-dir/{MessagesManager.js → DictionaryManager.js} +22 -22
- package/dist/config-dir/DictionaryManager.js.map +1 -0
- package/dist/config-dir/I18NConfiguration.d.ts +5 -5
- package/dist/config-dir/I18NConfiguration.d.ts.map +1 -1
- package/dist/config-dir/I18NConfiguration.js +9 -9
- package/dist/config-dir/I18NConfiguration.js.map +1 -1
- package/dist/config-dir/TranslationManager.d.ts.map +1 -1
- package/dist/config-dir/TranslationManager.js.map +1 -1
- package/dist/config-dir/getI18NConfig.js +1 -1
- package/dist/config-dir/getI18NConfig.js.map +1 -1
- package/dist/config-dir/gt-router.d.ts +2 -0
- package/dist/config-dir/gt-router.d.ts.map +1 -0
- package/dist/config-dir/gt-router.js +8 -0
- package/dist/config-dir/gt-router.js.map +1 -0
- package/dist/config-dir/props/defaultWithGTConfigProps.d.ts +2 -2
- package/dist/config-dir/props/withGTConfigProps.d.ts +1 -1
- package/dist/config-dir/props/withGTConfigProps.d.ts.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +28 -20
- package/dist/config.js.map +1 -1
- package/dist/dictionary/getDictionary.js +7 -7
- package/dist/dictionary/getDictionary.js.map +1 -1
- package/dist/errors/createErrors.d.ts +4 -4
- package/dist/errors/createErrors.d.ts.map +1 -1
- package/dist/errors/createErrors.js +9 -9
- package/dist/errors/createErrors.js.map +1 -1
- package/dist/loaders/resolveDictionaryDictionary.d.ts +3 -0
- package/dist/loaders/resolveDictionaryDictionary.d.ts.map +1 -0
- package/dist/loaders/{resolveMessagesLoader.js → resolveDictionaryDictionary.js} +19 -19
- package/dist/loaders/resolveDictionaryDictionary.js.map +1 -0
- package/dist/middleware-dir/createNextMiddleware.d.ts +11 -6
- package/dist/middleware-dir/createNextMiddleware.d.ts.map +1 -1
- package/dist/middleware-dir/createNextMiddleware.js +302 -28
- package/dist/middleware-dir/createNextMiddleware.js.map +1 -1
- package/dist/provider/ClientProviderWrapper.d.ts.map +1 -1
- package/dist/provider/ClientProviderWrapper.js +26 -0
- package/dist/provider/ClientProviderWrapper.js.map +1 -1
- package/dist/provider/GTProvider.d.ts.map +1 -1
- package/dist/provider/GTProvider.js +4 -4
- package/dist/provider/GTProvider.js.map +1 -1
- package/dist/request/getLocale.d.ts.map +1 -1
- package/dist/request/getLocale.js +4 -1
- package/dist/request/getLocale.js.map +1 -1
- package/dist/server-dir/buildtime/T.d.ts.map +1 -1
- package/dist/server-dir/buildtime/T.js +4 -1
- package/dist/server-dir/buildtime/T.js.map +1 -1
- package/dist/server-dir/buildtime/getDict.js +9 -9
- package/dist/server-dir/buildtime/getDict.js.map +1 -1
- package/dist/server-dir/buildtime/getGT.d.ts.map +1 -1
- package/dist/server-dir/buildtime/getGT.js +18 -2
- package/dist/server-dir/buildtime/getGT.js.map +1 -1
- package/dist/variables/Currency.js +1 -1
- package/dist/variables/Currency.js.map +1 -1
- package/dist/variables/DateTime.js +12 -1
- package/dist/variables/DateTime.js.map +1 -1
- package/dist/variables/Num.js +12 -1
- package/dist/variables/Num.js.map +1 -1
- package/package.json +19 -10
- package/dist/_load-messages.d.ts.map +0 -1
- package/dist/_load-messages.js.map +0 -1
- package/dist/config-dir/MessagesManager.d.ts +0 -22
- package/dist/config-dir/MessagesManager.d.ts.map +0 -1
- package/dist/config-dir/MessagesManager.js.map +0 -1
- package/dist/loaders/resolveMessagesLoader.d.ts +0 -3
- package/dist/loaders/resolveMessagesLoader.d.ts.map +0 -1
- package/dist/loaders/resolveMessagesLoader.js.map +0 -1
- package/dist/translations/index.d.ts +0 -1
- package/dist/translations/index.d.ts.map +0 -1
- package/dist/translations/index.js +0 -2
- package/dist/translations/index.js.map +0 -1
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,oCA4QC;AAtUD,8CAAwB;AACxB,0CAAoB;AAEpB,yGAAmF;AAEnF,sDAO+B;AAC/B,2EAA2E;AAC3E,yDAAyD;AAEzD,qEAA8C;AAErC,mBAFF,mBAAQ,CAEE;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,SAAgB,YAAY,CAC1B,UAAoB,EACpB,KAA6B;;IAD7B,2BAAA,EAAA,eAAoB;IACpB,sBAAA,EAAA,UAA6B;IAE7B,+CAA+C;IAC/C,IAAI,YAAY,GAA+B,EAAE,CAAC;IAClD,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,IAAI,kCAAwB,CAAC,MAAM,CAAC;IACnE,IAAI,CAAC;QACH,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAChE,IAAM,WAAW,GAAG,YAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACzD,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B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CAAC;QAHC,IAAM,SAAS,SAAA;QAIlB,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,uCAAuC;IACvC,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -43,13 +43,13 @@ exports.default = getDictionary;
|
|
|
43
43
|
exports.getDictionaryEntry = getDictionaryEntry;
|
|
44
44
|
var internal_1 = require("gt-react/internal");
|
|
45
45
|
var createErrors_1 = require("../errors/createErrors");
|
|
46
|
-
var
|
|
46
|
+
var resolveDictionaryDictionary_1 = __importDefault(require("../loaders/resolveDictionaryDictionary"));
|
|
47
47
|
var defaultWithGTConfigProps_1 = __importDefault(require("../config-dir/props/defaultWithGTConfigProps"));
|
|
48
48
|
var generaltranslation_1 = require("generaltranslation");
|
|
49
49
|
var dictionary = undefined;
|
|
50
50
|
function getDictionary() {
|
|
51
51
|
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
-
var dictionaryFileType,
|
|
52
|
+
var dictionaryFileType, customLoadDictionary, defaultLocale, _a, languageCode, error_1;
|
|
53
53
|
var _b;
|
|
54
54
|
return __generator(this, function (_c) {
|
|
55
55
|
switch (_c.label) {
|
|
@@ -70,14 +70,14 @@ function getDictionary() {
|
|
|
70
70
|
catch (_d) { }
|
|
71
71
|
if (dictionary)
|
|
72
72
|
return [2 /*return*/, dictionary];
|
|
73
|
-
|
|
74
|
-
if (!
|
|
73
|
+
customLoadDictionary = (0, resolveDictionaryDictionary_1.default)();
|
|
74
|
+
if (!customLoadDictionary) return [3 /*break*/, 8];
|
|
75
75
|
defaultLocale = process.env._GENERALTRANSLATION_DEFAULT_LOCALE ||
|
|
76
76
|
defaultWithGTConfigProps_1.default.defaultLocale;
|
|
77
77
|
_c.label = 1;
|
|
78
78
|
case 1:
|
|
79
79
|
_c.trys.push([1, 3, , 4]);
|
|
80
|
-
return [4 /*yield*/,
|
|
80
|
+
return [4 /*yield*/, customLoadDictionary(defaultLocale)];
|
|
81
81
|
case 2:
|
|
82
82
|
dictionary = _c.sent();
|
|
83
83
|
return [3 /*break*/, 4];
|
|
@@ -90,14 +90,14 @@ function getDictionary() {
|
|
|
90
90
|
_c.label = 5;
|
|
91
91
|
case 5:
|
|
92
92
|
_c.trys.push([5, 7, , 8]);
|
|
93
|
-
return [4 /*yield*/,
|
|
93
|
+
return [4 /*yield*/, customLoadDictionary(languageCode)];
|
|
94
94
|
case 6:
|
|
95
95
|
dictionary = _c.sent();
|
|
96
96
|
return [3 /*break*/, 8];
|
|
97
97
|
case 7:
|
|
98
98
|
error_1 = _c.sent();
|
|
99
99
|
if (process.env.NODE_ENV === 'development') {
|
|
100
|
-
console.warn((0, createErrors_1.
|
|
100
|
+
console.warn((0, createErrors_1.customLoadDictionaryWarning)(languageCode), error_1);
|
|
101
101
|
}
|
|
102
102
|
return [3 /*break*/, 8];
|
|
103
103
|
case 8:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDictionary.js","sourceRoot":"","sources":["../../src/dictionary/getDictionary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,gCAgDC;AAED,gDAKC;AAtED,8CAI2B;AAC3B,uDAGgC;AAChC,
|
|
1
|
+
{"version":3,"file":"getDictionary.js","sourceRoot":"","sources":["../../src/dictionary/getDictionary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,gCAgDC;AAED,gDAKC;AAtED,8CAI2B;AAC3B,uDAGgC;AAChC,uGAA6E;AAC7E,0GAAoF;AACpF,yDAAyD;AAEzD,IAAI,UAAU,GAA2B,SAAS,CAAC;AAEnD,SAA8B,aAAa;;;;;;;oBACzC,oBAAoB;oBACpB,IAAI,UAAU,KAAK,SAAS;wBAAE,sBAAO,UAAU,EAAC;oBAG1C,kBAAkB,GACtB,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC;oBAE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U;QAAE,OAAO,SAAS,CAAC;IAClC,OAAO,IAAA,6BAAQ,EAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare const remoteTranslationsError = "gt-next Error: fetching remote translation.";
|
|
2
2
|
export declare const customLoadTranslationsError: (locale?: string) => string;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const customLoadDictionaryWarning: (locale?: string) => string;
|
|
4
4
|
export declare const createStringTranslationError: (string: string, id?: string, functionName?: string) => string;
|
|
5
5
|
export declare const createDictionaryTranslationError: (id: string) => string;
|
|
6
6
|
export declare const createRequiredPrefixError: (id: string, requiredPrefix: string) => string;
|
|
7
7
|
export declare const devApiKeyIncludedInProductionError = "gt-next Error: You are attempting a production using a development API key. Replace this API key with a production API key when you build your app for production.";
|
|
8
8
|
export declare const createDictionarySubsetError: (id: string, functionName: string) => string;
|
|
9
9
|
export declare const dictionaryDisabledError = "gt-next Error: You are trying to use a dictionary, but you have not added the withGTConfig() plugin to your app. You must add withGTConfig() to use dictionaries. For more information, visit generaltranslation.com/docs";
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const unresolvedCustomLoadDictionaryError = "gt-next Error: loadDictionary() could not be resolved. This usually means that the file was found, but the loadDictionary() function itself was not exported.";
|
|
11
11
|
export declare const unresolvedCustomLoadTranslationsError = "gt-next Error: loadTranslations() could not be resolved. This usually means that the file was found, but the loadTranslations() function itself was not exported.";
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const unresolvedLoadDictionaryBuildError: (path: string) => string;
|
|
13
13
|
export declare const unresolvedLoadTranslationsBuildError: (path: string) => string;
|
|
14
14
|
export declare const usingDefaultsWarning = "gt-next: Unable to access gt-next configuration. Using defaults.";
|
|
15
15
|
export declare const createNoEntryFoundWarning: (id: string) => string;
|
|
@@ -21,5 +21,5 @@ export declare const noInitGTWarn: string;
|
|
|
21
21
|
export declare const APIKeyMissingWarn: string;
|
|
22
22
|
export declare const translationLoadingWarning: string;
|
|
23
23
|
export declare const runtimeTranslationTimeoutWarning = "gt-next: Runtime translation timed out.";
|
|
24
|
-
export declare const dictionaryNotFoundWarning = "gt-next: Dictionary not found. Make sure you have added a dictionary to your project (either dictionary.js or
|
|
24
|
+
export declare const dictionaryNotFoundWarning = "gt-next: Dictionary not found. Make sure you have added a dictionary to your project (either dictionary.js or [defaultLocale].json), and you have added the withGTConfig() plugin.";
|
|
25
25
|
//# sourceMappingURL=createErrors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createErrors.d.ts","sourceRoot":"","sources":["../../src/errors/createErrors.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,gDACW,CAAC;AAEhD,eAAO,MAAM,2BAA2B,YAAY,MAAM,WAC8F,CAAC;AAEzJ,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"createErrors.d.ts","sourceRoot":"","sources":["../../src/errors/createErrors.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,gDACW,CAAC;AAEhD,eAAO,MAAM,2BAA2B,YAAY,MAAM,WAC8F,CAAC;AAEzJ,eAAO,MAAM,2BAA2B,YAAY,MAAM,WACwG,CAAC;AAEnK,eAAO,MAAM,4BAA4B,WAC/B,MAAM,OACT,MAAM,kCAKqB,CAAC;AAEnC,eAAO,MAAM,gCAAgC,OAAQ,MAAM,WACuB,CAAC;AAEnF,eAAO,MAAM,yBAAyB,OAAQ,MAAM,kBAAkB,MAAM,WACsJ,CAAC;AAEnO,eAAO,MAAM,kCAAkC,uKAAuK,CAAC;AAEvN,eAAO,MAAM,2BAA2B,OAAQ,MAAM,gBAAgB,MAAM,WAC2G,CAAC;AAExL,eAAO,MAAM,uBAAuB,8NAA8N,CAAC;AAEnQ,eAAO,MAAM,mCAAmC,kKAAkK,CAAC;AAEnN,eAAO,MAAM,qCAAqC,sKAAsK,CAAC;AAEzN,eAAO,MAAM,kCAAkC,SAAU,MAAM,WACmB,CAAC;AAEnF,eAAO,MAAM,oCAAoC,SAAU,MAAM,WAC4B,CAAC;AAI9F,eAAO,MAAM,oBAAoB,qEACmC,CAAC;AAErE,eAAO,MAAM,yBAAyB,OAAQ,MAAM,WACQ,CAAC;AAE7D,eAAO,MAAM,mCAAmC,OAAQ,MAAM,WACH,CAAC;AAE5D,eAAO,MAAM,+BAA+B,YAAa,MAAM,EAAE,WAMhD,CAAC;AAElB,eAAO,MAAM,4BAA4B,iBACzB,MAAM,gBACN,MAAM,WAE2L,CAAC;AAElN,eAAO,MAAM,oBAAoB,qMAAqM,CAAC;AAEvO,eAAO,MAAM,YAAY,QAIoE,CAAC;AAE9F,eAAO,MAAM,iBAAiB,QAGqF,CAAC;AAEpH,eAAO,MAAM,yBAAyB,QAEmD,CAAC;AAE1F,eAAO,MAAM,gCAAgC,4CAA4C,CAAC;AAE1F,eAAO,MAAM,yBAAyB,uLAAuL,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// ---- ERRORS ---- //
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.dictionaryNotFoundWarning = exports.runtimeTranslationTimeoutWarning = exports.translationLoadingWarning = exports.APIKeyMissingWarn = exports.noInitGTWarn = exports.projectIdMissingWarn = exports.createMismatchingHashWarning = exports.createUnsupportedLocalesWarning = exports.createInvalidDictionaryEntryWarning = exports.createNoEntryFoundWarning = exports.usingDefaultsWarning = exports.unresolvedLoadTranslationsBuildError = exports.
|
|
4
|
+
exports.dictionaryNotFoundWarning = exports.runtimeTranslationTimeoutWarning = exports.translationLoadingWarning = exports.APIKeyMissingWarn = exports.noInitGTWarn = exports.projectIdMissingWarn = exports.createMismatchingHashWarning = exports.createUnsupportedLocalesWarning = exports.createInvalidDictionaryEntryWarning = exports.createNoEntryFoundWarning = exports.usingDefaultsWarning = exports.unresolvedLoadTranslationsBuildError = exports.unresolvedLoadDictionaryBuildError = exports.unresolvedCustomLoadTranslationsError = exports.unresolvedCustomLoadDictionaryError = exports.dictionaryDisabledError = exports.createDictionarySubsetError = exports.devApiKeyIncludedInProductionError = exports.createRequiredPrefixError = exports.createDictionaryTranslationError = exports.createStringTranslationError = exports.customLoadDictionaryWarning = exports.customLoadTranslationsError = exports.remoteTranslationsError = void 0;
|
|
5
5
|
var generaltranslation_1 = require("generaltranslation");
|
|
6
6
|
exports.remoteTranslationsError = 'gt-next Error: fetching remote translation.';
|
|
7
7
|
var customLoadTranslationsError = function (locale) {
|
|
@@ -9,11 +9,11 @@ var customLoadTranslationsError = function (locale) {
|
|
|
9
9
|
return "gt-next Error: fetching locally stored translations. If you are using a custom loadTranslations(\"".concat(locale, "\"), make sure it is correctly implemented.");
|
|
10
10
|
};
|
|
11
11
|
exports.customLoadTranslationsError = customLoadTranslationsError;
|
|
12
|
-
var
|
|
12
|
+
var customLoadDictionaryWarning = function (locale) {
|
|
13
13
|
if (locale === void 0) { locale = ''; }
|
|
14
|
-
return "gt-next Warning: fetching locally stored
|
|
14
|
+
return "gt-next Warning: fetching locally stored translation dictionary. If you are using a custom loadDictionary(\"".concat(locale, "\"), make sure it is correctly implemented.");
|
|
15
15
|
};
|
|
16
|
-
exports.
|
|
16
|
+
exports.customLoadDictionaryWarning = customLoadDictionaryWarning;
|
|
17
17
|
var createStringTranslationError = function (string, id, functionName) {
|
|
18
18
|
if (functionName === void 0) { functionName = 'tx'; }
|
|
19
19
|
return "gt-next string translation error. ".concat(functionName, "(\"").concat(string, "\")").concat(id ? " with id \"".concat(id, "\"") : '', " could not locate translation.");
|
|
@@ -33,12 +33,12 @@ var createDictionarySubsetError = function (id, functionName) {
|
|
|
33
33
|
};
|
|
34
34
|
exports.createDictionarySubsetError = createDictionarySubsetError;
|
|
35
35
|
exports.dictionaryDisabledError = "gt-next Error: You are trying to use a dictionary, but you have not added the withGTConfig() plugin to your app. You must add withGTConfig() to use dictionaries. For more information, visit generaltranslation.com/docs";
|
|
36
|
-
exports.
|
|
36
|
+
exports.unresolvedCustomLoadDictionaryError = "gt-next Error: loadDictionary() could not be resolved. This usually means that the file was found, but the loadDictionary() function itself was not exported.";
|
|
37
37
|
exports.unresolvedCustomLoadTranslationsError = "gt-next Error: loadTranslations() could not be resolved. This usually means that the file was found, but the loadTranslations() function itself was not exported.";
|
|
38
|
-
var
|
|
39
|
-
return "gt-next Error: File defining
|
|
38
|
+
var unresolvedLoadDictionaryBuildError = function (path) {
|
|
39
|
+
return "gt-next Error: File defining loadDictionary() could not be resolved at ".concat(path);
|
|
40
40
|
};
|
|
41
|
-
exports.
|
|
41
|
+
exports.unresolvedLoadDictionaryBuildError = unresolvedLoadDictionaryBuildError;
|
|
42
42
|
var unresolvedLoadTranslationsBuildError = function (path) {
|
|
43
43
|
return "gt-next Error: File defining loadTranslations() function could not be resolved at ".concat(path);
|
|
44
44
|
};
|
|
@@ -77,5 +77,5 @@ exports.APIKeyMissingWarn = "gt-next: A Development API key is required for runt
|
|
|
77
77
|
exports.translationLoadingWarning = "gt-next: [DEV ONLY] Translations have changed since the last update. " +
|
|
78
78
|
"Translations in production will be preloaded, and page will not need to be refreshed.";
|
|
79
79
|
exports.runtimeTranslationTimeoutWarning = "gt-next: Runtime translation timed out.";
|
|
80
|
-
exports.dictionaryNotFoundWarning = "gt-next: Dictionary not found. Make sure you have added a dictionary to your project (either dictionary.js or
|
|
80
|
+
exports.dictionaryNotFoundWarning = "gt-next: Dictionary not found. Make sure you have added a dictionary to your project (either dictionary.js or [defaultLocale].json), and you have added the withGTConfig() plugin.";
|
|
81
81
|
//# sourceMappingURL=createErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createErrors.js","sourceRoot":"","sources":["../../src/errors/createErrors.ts"],"names":[],"mappings":";AAAA,sBAAsB;;;AAEtB,yDAAyD;AAE5C,QAAA,uBAAuB,GAClC,6CAA6C,CAAC;AAEzC,IAAM,2BAA2B,GAAG,UAAC,MAAmB;IAAnB,uBAAA,EAAA,WAAmB;IAC7D,OAAA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CAAC;AAE1N,QAAA,YAAY,GACvB,kFAAkF;IAClF,wHAAwH;IACxH,wDAAwD;IACxD,2FAA2F,CAAC;AAEjF,QAAA,iBAAiB,GAC5B,uEAAuE;IACvE,oEAAoE;IACpE,iHAAiH,CAAC;AAEvG,QAAA,yBAAyB,GACpC,uEAAuE;IACvE,uFAAuF,CAAC;AAE7E,QAAA,gCAAgC,GAAG,yCAAyC,CAAC;AAE7E,QAAA,yBAAyB,GAAG,oLAAoL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDictionaryDictionary.d.ts","sourceRoot":"","sources":["../../src/loaders/resolveDictionaryDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKjD,MAAM,CAAC,OAAO,UAAU,uBAAuB,IAAI,YAAY,GAAG,SAAS,CAkC1E"}
|
|
@@ -36,40 +36,40 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.default =
|
|
39
|
+
exports.default = resolveDictionaryLoader;
|
|
40
40
|
var createErrors_1 = require("../errors/createErrors");
|
|
41
|
-
var
|
|
42
|
-
function
|
|
41
|
+
var customLoadDictionary = undefined;
|
|
42
|
+
function resolveDictionaryLoader() {
|
|
43
43
|
var _this = this;
|
|
44
44
|
// Singleton pattern
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
47
|
-
// Check: local
|
|
48
|
-
if (process.env.
|
|
45
|
+
if (customLoadDictionary !== undefined)
|
|
46
|
+
return customLoadDictionary;
|
|
47
|
+
// Check: local dictionary loader is enabled
|
|
48
|
+
if (process.env._GENERALTRANSLATION_LOCAL_DICTIONARY_ENABLED !== 'true')
|
|
49
49
|
return;
|
|
50
|
-
// get load
|
|
51
|
-
var
|
|
50
|
+
// get load dictionary file
|
|
51
|
+
var customLoadDictionaryConfig;
|
|
52
52
|
try {
|
|
53
|
-
|
|
53
|
+
customLoadDictionaryConfig = require('gt-next/_load-dictionary');
|
|
54
54
|
}
|
|
55
55
|
catch (_a) { }
|
|
56
56
|
// Get custom loader
|
|
57
|
-
|
|
58
|
-
(
|
|
59
|
-
(
|
|
57
|
+
customLoadDictionary =
|
|
58
|
+
(customLoadDictionaryConfig === null || customLoadDictionaryConfig === void 0 ? void 0 : customLoadDictionaryConfig.default) ||
|
|
59
|
+
(customLoadDictionaryConfig === null || customLoadDictionaryConfig === void 0 ? void 0 : customLoadDictionaryConfig.getLocalDictionary);
|
|
60
60
|
// Check: custom loader is exported
|
|
61
|
-
if (!
|
|
61
|
+
if (!customLoadDictionary) {
|
|
62
62
|
// So the custom loader doesnt eval to falsey
|
|
63
|
-
|
|
63
|
+
customLoadDictionary = function (_) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
64
64
|
return [2 /*return*/, undefined];
|
|
65
65
|
}); }); };
|
|
66
66
|
// Throw error in dev
|
|
67
67
|
if (process.env.NODE_ENV !== 'production') {
|
|
68
|
-
throw new Error(createErrors_1.
|
|
68
|
+
throw new Error(createErrors_1.unresolvedCustomLoadDictionaryError);
|
|
69
69
|
}
|
|
70
70
|
// Custom loader file was defined but not exported
|
|
71
|
-
console.error(createErrors_1.
|
|
71
|
+
console.error(createErrors_1.unresolvedCustomLoadDictionaryError);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return customLoadDictionary;
|
|
74
74
|
}
|
|
75
|
-
//# sourceMappingURL=
|
|
75
|
+
//# sourceMappingURL=resolveDictionaryDictionary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDictionaryDictionary.js","sourceRoot":"","sources":["../../src/loaders/resolveDictionaryDictionary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,0CAkCC;AAtCD,uDAA6E;AAE7E,IAAI,oBAAoB,GAA6B,SAAS,CAAC;AAE/D,SAAwB,uBAAuB;IAA/C,iBAkCC;IAjCC,oBAAoB;IACpB,IAAI,oBAAoB,KAAK,SAAS;QAAE,OAAO,oBAAoB,CAAC;IAEpE,4CAA4C;IAC5C,IAAI,OAAO,CAAC,GAAG,CAAC,4CAA4C,KAAK,MAAM;QACrE,OAAO;IAET,2BAA2B;IAC3B,IAAI,0BAA0B,CAAC;IAC/B,IAAI,CAAC;QACH,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACnE,CAAC;IAAC,WAAM,CAAC,CAAA,CAAC;IAEV,oBAAoB;IACpB,oBAAoB;QAClB,CAAA,0BAA0B,aAA1B,0BAA0B,uBAA1B,0BAA0B,CAAE,OAAO;aACnC,0BAA0B,aAA1B,0BAA0B,uBAA1B,0BAA0B,CAAE,kBAAkB,CAAA,CAAC;IAEjD,mCAAmC;IACnC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC1B,6CAA6C;QAC7C,oBAAoB,GAAG,UAAO,CAAS;YAAK,sBAAA,SAAS,EAAA;iBAAA,CAAC;QAEtD,qBAAqB;QACrB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,kDAAmC,CAAC,CAAC;QACvD,CAAC;QAED,kDAAkD;QAClD,OAAO,CAAC,KAAK,CAAC,kDAAmC,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,oBAAoB,CAAC;AAC9B,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { NextResponse } from 'next/server';
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
type PathConfig = {
|
|
3
|
+
[key: string]: string | {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
2
7
|
/**
|
|
3
8
|
* Middleware factory to create a Next.js middleware for i18n routing and locale detection.
|
|
4
9
|
*
|
|
@@ -7,14 +12,14 @@ import { NextResponse } from 'next/server';
|
|
|
7
12
|
* If locale routing is enabled, it redirects to the localized pathname and
|
|
8
13
|
* updates the locale cookie.
|
|
9
14
|
*
|
|
10
|
-
* @param {Object} config - Configuration object for the middleware.
|
|
11
|
-
* @param {string} [config.defaultLocale='en'] - The default locale to use if no locale is detected.
|
|
12
|
-
* @param {string[]} [config.locales] - Array of supported locales. If provided, the locale will be validated against this list.
|
|
13
15
|
* @param {boolean} [config.localeRouting=true] - Flag to enable or disable automatic locale-based routing.
|
|
16
|
+
* @param {boolean} [config.prefixDefaultLocale=false] - Flag to enable or disable prefixing the default locale to the pathname, i.e., /en/about -> /about
|
|
14
17
|
* @returns {function} - A middleware function that processes the request and response.
|
|
15
18
|
*/
|
|
16
|
-
export default function createNextMiddleware({ localeRouting, prefixDefaultLocale, }
|
|
19
|
+
export default function createNextMiddleware({ localeRouting, prefixDefaultLocale, pathConfig, }: {
|
|
17
20
|
localeRouting?: boolean;
|
|
18
21
|
prefixDefaultLocale?: boolean;
|
|
19
|
-
|
|
22
|
+
pathConfig?: PathConfig;
|
|
23
|
+
}): (req: NextRequest) => NextResponse<unknown>;
|
|
24
|
+
export {};
|
|
20
25
|
//# sourceMappingURL=createNextMiddleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNextMiddleware.d.ts","sourceRoot":"","sources":["../../src/middleware-dir/createNextMiddleware.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"createNextMiddleware.d.ts","sourceRoot":"","sources":["../../src/middleware-dir/createNextMiddleware.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAaxD,KAAK,UAAU,GAAG;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACnD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,aAAoB,EACpB,mBAA2B,EAC3B,UAAe,GAChB,EAAE;IACD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,SAiR8B,WAAW,2BAoNzC"}
|