next-i18next 14.0.0 → 14.0.1

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/README.md CHANGED
@@ -373,7 +373,7 @@ This means that the i18n configuration file will be in the same directory as `ne
373
373
 
374
374
  ### Vercel and Netlify
375
375
 
376
- Some serverless PaaS may not be able to locate the path of your translations and require additional configuration. If you have filesystem issues using `serverSideTranslations`, set `config.localePath` to use `path.resolve`. An example can be [found here](https://github.com/i18next/next-i18next/issues/1552#issuecomment-981156476).
376
+ Some serverless PaaS may not be able to locate the path of your translations and require additional configuration. If you have filesystem issues using `serverSideTranslations`, set `config.localePath` to use `path.resolve`. An example can be [found here](https://github.com/i18next/next-i18next/issues/1552#issuecomment-1538452722).
377
377
 
378
378
  ### Docker
379
379
 
@@ -460,9 +460,6 @@ This project follows the [all-contributors](https://github.com/kentcdodds/all-co
460
460
  <a href="https://locize.com/" target="_blank">
461
461
  <img src="https://raw.githubusercontent.com/i18next/i18next/master/assets/locize_sponsor_240.gif" width="240px">
462
462
  </a>
463
- <a href="https://localistars.com/" target="_blank">
464
- <img src="https://raw.githubusercontent.com/i18next/i18next/master/assets/localistars_sponsor_240.gif" width="240px">
465
- </a>
466
463
  </p>
467
464
 
468
465
  ---
@@ -31,6 +31,8 @@ var _default = function _default(config) {
31
31
  instance = globalInstance;
32
32
  } else {
33
33
  instance = globalInstance.cloneInstance(_objectSpread(_objectSpread({}, config), {}, {
34
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
35
+ // @ts-ignore
34
36
  initImmediate: false
35
37
  }));
36
38
  }
@@ -20,10 +20,10 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
20
20
  require("core-js/modules/es.object.to-string.js");
21
21
  require("core-js/modules/es.promise.js");
22
22
  require("core-js/modules/es.array.some.js");
23
+ require("core-js/modules/es.array.is-array.js");
23
24
  require("core-js/modules/es.array.for-each.js");
24
25
  require("core-js/modules/web.dom-collections.for-each.js");
25
26
  require("core-js/modules/es.array.concat.js");
26
- require("core-js/modules/es.array.is-array.js");
27
27
  require("core-js/modules/es.array.map.js");
28
28
  require("core-js/modules/es.regexp.exec.js");
29
29
  require("core-js/modules/es.string.replace.js");
@@ -131,7 +131,7 @@ var serverSideTranslations = /*#__PURE__*/function () {
131
131
  break;
132
132
  }
133
133
  _context.next = 25;
134
- return i18n.loadNamespaces(namespacesRequired);
134
+ return i18n.loadNamespaces(Array.isArray(namespacesRequired) ? namespacesRequired : namespacesRequired);
135
135
  case 25:
136
136
  initialI18nStore = (0, _defineProperty2["default"])({}, initialLocale, {});
137
137
  (0, _utils.getFallbackForLng)(initialLocale, fallbackLng !== null && fallbackLng !== void 0 ? fallbackLng : false).concat(extraLocales || []).forEach(function (lng) {
@@ -10,6 +10,8 @@ export default (config => {
10
10
  } else {
11
11
  instance = globalInstance.cloneInstance({
12
12
  ...config,
13
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
14
+ // @ts-ignore
13
15
  initImmediate: false
14
16
  });
15
17
  }
@@ -50,7 +50,7 @@ export const serverSideTranslations = async (initialLocale, namespacesRequired =
50
50
  await initPromise;
51
51
  const hasCustomBackend = userConfig?.use?.some(b => b.type === 'backend');
52
52
  if (hasCustomBackend && namespacesRequired) {
53
- await i18n.loadNamespaces(namespacesRequired);
53
+ await i18n.loadNamespaces(Array.isArray(namespacesRequired) ? namespacesRequired : namespacesRequired);
54
54
  }
55
55
  const initialI18nStore = {
56
56
  [initialLocale]: {}
@@ -12,6 +12,8 @@ export default (function (config) {
12
12
  instance = globalInstance;
13
13
  } else {
14
14
  instance = globalInstance.cloneInstance(_objectSpread(_objectSpread({}, config), {}, {
15
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
16
+ // @ts-ignore
15
17
  initImmediate: false
16
18
  }));
17
19
  }
@@ -96,7 +96,7 @@ export var serverSideTranslations = /*#__PURE__*/function () {
96
96
  break;
97
97
  }
98
98
  _context.next = 25;
99
- return i18n.loadNamespaces(namespacesRequired);
99
+ return i18n.loadNamespaces(Array.isArray(namespacesRequired) ? namespacesRequired : namespacesRequired);
100
100
  case 25:
101
101
  initialI18nStore = _defineProperty({}, initialLocale, {});
102
102
  getFallbackForLng(initialLocale, fallbackLng !== null && fallbackLng !== void 0 ? fallbackLng : false).concat(extraLocales || []).forEach(function (lng) {
@@ -1,2 +1,5 @@
1
1
  import { UserConfig, SSRConfig } from './types';
2
- export declare const serverSideTranslations: (initialLocale: string, namespacesRequired?: string | string[] | undefined, configOverride?: UserConfig | null, extraLocales?: string[] | false) => Promise<SSRConfig>;
2
+ import { Namespace } from 'i18next';
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": "14.0.0",
3
+ "version": "14.0.1",
4
4
  "repository": "git@github.com:i18next/next-i18next.git",
5
5
  "author": "i18next",
6
6
  "funding": [
@@ -48,6 +48,7 @@
48
48
  "build:example:simple": "cd examples/simple && npm run build",
49
49
  "build:example:ssg": "cd examples/ssg && npm run build",
50
50
  "typecheck": "tsc --project ./tsconfig.json --noEmit",
51
+ "typecheck:example:simple": "cd examples/simple && npm run typecheck",
51
52
  "check-size": "size-limit",
52
53
  "check-size:why": "size-limit --why",
53
54
  "check-dist": "npm-run-all -s check-dist:*",
@@ -113,7 +114,7 @@
113
114
  "eslint-plugin-typescript-sort-keys": "^2.1.0",
114
115
  "gh-release": "7.0.2",
115
116
  "husky": "^8.0.3",
116
- "i18next": "^23.0.1",
117
+ "i18next": "^23.4.6",
117
118
  "jest": "^29.5.0",
118
119
  "jest-environment-jsdom": "^29.5.0",
119
120
  "next": "^13.1.6",
@@ -121,7 +122,7 @@
121
122
  "prettier": "2.8.3",
122
123
  "react": "^18.2.0",
123
124
  "react-dom": "^18.2.0",
124
- "react-i18next": "^13.0.0",
125
+ "react-i18next": "^13.2.1",
125
126
  "rimraf": "^4.1.2",
126
127
  "size-limit": "^8.1.2",
127
128
  "start-server-and-test": "^1.15.3",
@@ -136,9 +137,9 @@
136
137
  "i18next-fs-backend": "^2.1.5"
137
138
  },
138
139
  "peerDependencies": {
139
- "i18next": "^23.0.1",
140
+ "i18next": "^23.4.6",
140
141
  "next": ">= 12.0.0",
141
142
  "react": ">= 17.0.2",
142
- "react-i18next": "^13.0.0"
143
+ "react-i18next": "^13.2.1"
143
144
  }
144
145
  }