next-i18next 13.2.0 → 13.2.2
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.
|
@@ -56,7 +56,8 @@ var appWithTranslation = function appWithTranslation(WrappedComponent) {
|
|
|
56
56
|
var configOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
57
57
|
var AppWithTranslation = function AppWithTranslation(props) {
|
|
58
58
|
var _nextI18Next$initialL, _props$router;
|
|
59
|
-
var
|
|
59
|
+
var _ref = props.pageProps || {},
|
|
60
|
+
_nextI18Next = _ref._nextI18Next; // pageProps may be undefined on strange setups, i.e. https://github.com/i18next/next-i18next/issues/2109
|
|
60
61
|
var locale = (_nextI18Next$initialL = _nextI18Next === null || _nextI18Next === void 0 ? void 0 : _nextI18Next.initialLocale) !== null && _nextI18Next$initialL !== void 0 ? _nextI18Next$initialL : props === null || props === void 0 ? void 0 : (_props$router = props.router) === null || _props$router === void 0 ? void 0 : _props$router.locale;
|
|
61
62
|
var ns = _nextI18Next === null || _nextI18Next === void 0 ? void 0 : _nextI18Next.ns;
|
|
62
63
|
|
|
@@ -77,8 +78,8 @@ var appWithTranslation = function appWithTranslation(WrappedComponent) {
|
|
|
77
78
|
if (!(userConfig !== null && userConfig !== void 0 && (_userConfig$i18n = userConfig.i18n) !== null && _userConfig$i18n !== void 0 && _userConfig$i18n.defaultLocale)) {
|
|
78
79
|
throw new Error('config.i18n does not include a defaultLocale property');
|
|
79
80
|
}
|
|
80
|
-
var
|
|
81
|
-
initialI18nStore =
|
|
81
|
+
var _ref2 = _nextI18Next || {},
|
|
82
|
+
initialI18nStore = _ref2.initialI18nStore;
|
|
82
83
|
var resources = configOverride !== null && configOverride !== void 0 && configOverride.resources ? configOverride.resources : initialI18nStore;
|
|
83
84
|
if (!locale) locale = userConfig.i18n.defaultLocale;
|
|
84
85
|
var instance = (0, _createClient["default"])(_objectSpread(_objectSpread({}, (0, _createConfig.createConfig)(_objectSpread(_objectSpread({}, userConfig), {}, {
|
|
@@ -10,7 +10,7 @@ export const appWithTranslation = (WrappedComponent, configOverride = null) => {
|
|
|
10
10
|
const AppWithTranslation = props => {
|
|
11
11
|
const {
|
|
12
12
|
_nextI18Next
|
|
13
|
-
} = props.pageProps;
|
|
13
|
+
} = props.pageProps || {}; // pageProps may be undefined on strange setups, i.e. https://github.com/i18next/next-i18next/issues/2109
|
|
14
14
|
let locale = _nextI18Next?.initialLocale ?? props?.router?.locale;
|
|
15
15
|
const ns = _nextI18Next?.ns;
|
|
16
16
|
|
|
@@ -14,7 +14,8 @@ export var appWithTranslation = function appWithTranslation(WrappedComponent) {
|
|
|
14
14
|
var configOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
15
15
|
var AppWithTranslation = function AppWithTranslation(props) {
|
|
16
16
|
var _nextI18Next$initialL, _props$router;
|
|
17
|
-
var
|
|
17
|
+
var _ref = props.pageProps || {},
|
|
18
|
+
_nextI18Next = _ref._nextI18Next; // pageProps may be undefined on strange setups, i.e. https://github.com/i18next/next-i18next/issues/2109
|
|
18
19
|
var locale = (_nextI18Next$initialL = _nextI18Next === null || _nextI18Next === void 0 ? void 0 : _nextI18Next.initialLocale) !== null && _nextI18Next$initialL !== void 0 ? _nextI18Next$initialL : props === null || props === void 0 ? void 0 : (_props$router = props.router) === null || _props$router === void 0 ? void 0 : _props$router.locale;
|
|
19
20
|
var ns = _nextI18Next === null || _nextI18Next === void 0 ? void 0 : _nextI18Next.ns;
|
|
20
21
|
|
|
@@ -35,8 +36,8 @@ export var appWithTranslation = function appWithTranslation(WrappedComponent) {
|
|
|
35
36
|
if (!(userConfig !== null && userConfig !== void 0 && (_userConfig$i18n = userConfig.i18n) !== null && _userConfig$i18n !== void 0 && _userConfig$i18n.defaultLocale)) {
|
|
36
37
|
throw new Error('config.i18n does not include a defaultLocale property');
|
|
37
38
|
}
|
|
38
|
-
var
|
|
39
|
-
initialI18nStore =
|
|
39
|
+
var _ref2 = _nextI18Next || {},
|
|
40
|
+
initialI18nStore = _ref2.initialI18nStore;
|
|
40
41
|
var resources = configOverride !== null && configOverride !== void 0 && configOverride.resources ? configOverride.resources : initialI18nStore;
|
|
41
42
|
if (!locale) locale = userConfig.i18n.defaultLocale;
|
|
42
43
|
var instance = createClient(_objectSpread(_objectSpread({}, createConfig(_objectSpread(_objectSpread({}, userConfig), {}, {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { UserConfig, SSRConfig } from './types';
|
|
2
2
|
import { Namespace } from 'i18next';
|
|
3
|
-
|
|
3
|
+
type ArrayElementOrSelf<T> = T extends Array<infer U> ? U[] : T[];
|
|
4
|
+
export declare const serverSideTranslations: (initialLocale: string, namespacesRequired?: ArrayElementOrSelf<Namespace> | undefined, configOverride?: UserConfig | null, extraLocales?: string[] | false) => Promise<SSRConfig>;
|
|
5
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-i18next",
|
|
3
|
-
"version": "13.2.
|
|
3
|
+
"version": "13.2.2",
|
|
4
4
|
"repository": "git@github.com:i18next/next-i18next.git",
|
|
5
5
|
"author": "i18next",
|
|
6
6
|
"funding": [
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"eslint-plugin-typescript-sort-keys": "^2.1.0",
|
|
113
113
|
"gh-release": "7.0.2",
|
|
114
114
|
"husky": "^8.0.3",
|
|
115
|
-
"i18next": "^22.4.
|
|
115
|
+
"i18next": "^22.4.10",
|
|
116
116
|
"jest": "^29.4.2",
|
|
117
117
|
"jest-environment-jsdom": "^29.4.2",
|
|
118
118
|
"next": "^13.1.6",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"prettier": "2.8.3",
|
|
121
121
|
"react": "^18.2.0",
|
|
122
122
|
"react-dom": "^18.2.0",
|
|
123
|
-
"react-i18next": "^12.
|
|
123
|
+
"react-i18next": "^12.2.0",
|
|
124
124
|
"rimraf": "^4.1.2",
|
|
125
125
|
"size-limit": "^8.1.2",
|
|
126
126
|
"start-server-and-test": "^1.15.3",
|
|
@@ -138,6 +138,6 @@
|
|
|
138
138
|
"i18next": "^22.0.6",
|
|
139
139
|
"next": ">= 12.0.0",
|
|
140
140
|
"react": ">= 17.0.2",
|
|
141
|
-
"react-i18next": "^12.
|
|
141
|
+
"react-i18next": "^12.2.0"
|
|
142
142
|
}
|
|
143
143
|
}
|