next-translate 3.0.0 → 3.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.
@@ -62,7 +62,12 @@ function appWithI18n(AppToTranslate, config) {
62
62
  function AppWithTranslations(props) {
63
63
  var _a, _b;
64
64
  var defaultLocale = config.defaultLocale;
65
- return (react_1.default.createElement(I18nProvider_1.default, { lang: ((_a = props.pageProps) === null || _a === void 0 ? void 0 : _a.__lang) || props.__lang || defaultLocale, namespaces: ((_b = props.pageProps) === null || _b === void 0 ? void 0 : _b.__namespaces) || props.__namespaces, config: config },
65
+ var lang = ((_a = props.pageProps) === null || _a === void 0 ? void 0 : _a.__lang) || props.__lang || defaultLocale;
66
+ var namespaces = ((_b = props.pageProps) === null || _b === void 0 ? void 0 : _b.__namespaces) || props.__namespaces;
67
+ if (lang && namespaces) {
68
+ globalThis.__NEXT_TRANSLATE__ = { lang: lang, namespaces: namespaces, config: config };
69
+ }
70
+ return (react_1.default.createElement(I18nProvider_1.default, { lang: lang, namespaces: namespaces, config: config },
66
71
  react_1.default.createElement(AppToTranslate, __assign({}, props))));
67
72
  }
68
73
  if (typeof config.staticsHoc === 'function') {
@@ -57,7 +57,12 @@ export default function appWithI18n(AppToTranslate, config) {
57
57
  function AppWithTranslations(props) {
58
58
  var _a, _b;
59
59
  var defaultLocale = config.defaultLocale;
60
- return (React.createElement(I18nProvider, { lang: ((_a = props.pageProps) === null || _a === void 0 ? void 0 : _a.__lang) || props.__lang || defaultLocale, namespaces: ((_b = props.pageProps) === null || _b === void 0 ? void 0 : _b.__namespaces) || props.__namespaces, config: config },
60
+ var lang = ((_a = props.pageProps) === null || _a === void 0 ? void 0 : _a.__lang) || props.__lang || defaultLocale;
61
+ var namespaces = ((_b = props.pageProps) === null || _b === void 0 ? void 0 : _b.__namespaces) || props.__namespaces;
62
+ if (lang && namespaces) {
63
+ globalThis.__NEXT_TRANSLATE__ = { lang: lang, namespaces: namespaces, config: config };
64
+ }
65
+ return (React.createElement(I18nProvider, { lang: lang, namespaces: namespaces, config: config },
61
66
  React.createElement(AppToTranslate, __assign({}, props))));
62
67
  }
63
68
  if (typeof config.staticsHoc === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-translate",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Tiny and powerful i18n tools (Next plugin + API) to translate your Next.js pages.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -30,6 +30,7 @@
30
30
  "module": "./lib/esm/index.js",
31
31
  "types": "./index.d.ts",
32
32
  "exports": {
33
+ "./package.json": "./package.json",
33
34
  ".": {
34
35
  "types": "./index.d.ts",
35
36
  "import": "./lib/esm/index.js",