next-translate-plugin 2.4.2 → 2.4.4

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.
@@ -44,7 +44,7 @@ exports.default = templateAppDir;
44
44
  function templateRSCPage(_a) {
45
45
  var pagePkg = _a.pagePkg, hash = _a.hash, pageVariableName = _a.pageVariableName, pathname = _a.pathname, routeType = _a.routeType, existLocalesFolder = _a.existLocalesFolder;
46
46
  var code = pagePkg.getCode();
47
- return "\n import ".concat(utils_1.INTERNAL_CONFIG_KEY, " from '@next-translate-root/i18n'\n import AppDirI18nProvider from 'next-translate/AppDirI18nProvider'\n import __loadNamespaces from 'next-translate/loadNamespaces'\n\n ").concat(code, "\n\n export default async function __Next_Translate_new__").concat(hash, "__(props) {\n const config = { \n ...").concat(utils_1.INTERNAL_CONFIG_KEY, ",\n locale: props.params?.lang ?? props.searchParams?.lang ?? ").concat(utils_1.INTERNAL_CONFIG_KEY, ".defaultLocale,\n loaderName: 'server ").concat(routeType, "',\n pathname: '").concat(pathname, "'\n }\n\n const { __lang, __namespaces } = await __loadNamespaces({ ...config, ").concat((0, utils_1.addLoadLocalesFrom)(existLocalesFolder), " });\n globalThis.__NEXT_TRANSLATE__ = { lang: __lang, namespaces: __namespaces, config }\n\n return <AppDirI18nProvider lang={__lang} namespaces={__namespaces} config={config}><").concat(pageVariableName, " {...props} /></AppDirI18nProvider>\n }\n");
47
+ return "\n import ".concat(utils_1.INTERNAL_CONFIG_KEY, " from '@next-translate-root/i18n'\n import AppDirI18nProvider from 'next-translate/AppDirI18nProvider'\n import __loadNamespaces from 'next-translate/loadNamespaces'\n\n ").concat(code, "\n\n export default async function __Next_Translate_new__").concat(hash, "__(props) {\n const config = { \n ...").concat(utils_1.INTERNAL_CONFIG_KEY, ",\n locale: props.params?.lang ?? props.searchParams?.lang ?? ").concat(utils_1.INTERNAL_CONFIG_KEY, ".defaultLocale,\n loaderName: 'server ").concat(routeType, "',\n pathname: '").concat(pathname, "'\n }\n\n const { __lang, __namespaces } = await __loadNamespaces({ ...config, ").concat((0, utils_1.addLoadLocalesFrom)(existLocalesFolder), " });\n globalThis.__NEXT_TRANSLATE__ = { lang: __lang, namespaces: __namespaces, config }\n\n return <AppDirI18nProvider lang={__lang} namespaces={__namespaces} config={JSON.parse(JSON.stringify(config))}><").concat(pageVariableName, " {...props} /></AppDirI18nProvider>\n }\n");
48
48
  }
49
49
  function templateRCCPage(_a) {
50
50
  var pagePkg = _a.pagePkg, hash = _a.hash, pageVariableName = _a.pageVariableName, pathname = _a.pathname, routeType = _a.routeType, existLocalesFolder = _a.existLocalesFolder;
@@ -41,7 +41,7 @@ export default function templateAppDir(pagePkg, _a) {
41
41
  function templateRSCPage(_a) {
42
42
  var pagePkg = _a.pagePkg, hash = _a.hash, pageVariableName = _a.pageVariableName, pathname = _a.pathname, routeType = _a.routeType, existLocalesFolder = _a.existLocalesFolder;
43
43
  var code = pagePkg.getCode();
44
- return "\n import ".concat(INTERNAL_CONFIG_KEY, " from '@next-translate-root/i18n'\n import AppDirI18nProvider from 'next-translate/AppDirI18nProvider'\n import __loadNamespaces from 'next-translate/loadNamespaces'\n\n ").concat(code, "\n\n export default async function __Next_Translate_new__").concat(hash, "__(props) {\n const config = { \n ...").concat(INTERNAL_CONFIG_KEY, ",\n locale: props.params?.lang ?? props.searchParams?.lang ?? ").concat(INTERNAL_CONFIG_KEY, ".defaultLocale,\n loaderName: 'server ").concat(routeType, "',\n pathname: '").concat(pathname, "'\n }\n\n const { __lang, __namespaces } = await __loadNamespaces({ ...config, ").concat(addLoadLocalesFrom(existLocalesFolder), " });\n globalThis.__NEXT_TRANSLATE__ = { lang: __lang, namespaces: __namespaces, config }\n\n return <AppDirI18nProvider lang={__lang} namespaces={__namespaces} config={config}><").concat(pageVariableName, " {...props} /></AppDirI18nProvider>\n }\n");
44
+ return "\n import ".concat(INTERNAL_CONFIG_KEY, " from '@next-translate-root/i18n'\n import AppDirI18nProvider from 'next-translate/AppDirI18nProvider'\n import __loadNamespaces from 'next-translate/loadNamespaces'\n\n ").concat(code, "\n\n export default async function __Next_Translate_new__").concat(hash, "__(props) {\n const config = { \n ...").concat(INTERNAL_CONFIG_KEY, ",\n locale: props.params?.lang ?? props.searchParams?.lang ?? ").concat(INTERNAL_CONFIG_KEY, ".defaultLocale,\n loaderName: 'server ").concat(routeType, "',\n pathname: '").concat(pathname, "'\n }\n\n const { __lang, __namespaces } = await __loadNamespaces({ ...config, ").concat(addLoadLocalesFrom(existLocalesFolder), " });\n globalThis.__NEXT_TRANSLATE__ = { lang: __lang, namespaces: __namespaces, config }\n\n return <AppDirI18nProvider lang={__lang} namespaces={__namespaces} config={JSON.parse(JSON.stringify(config))}><").concat(pageVariableName, " {...props} /></AppDirI18nProvider>\n }\n");
45
45
  }
46
46
  function templateRCCPage(_a) {
47
47
  var pagePkg = _a.pagePkg, hash = _a.hash, pageVariableName = _a.pageVariableName, pathname = _a.pathname, routeType = _a.routeType, existLocalesFolder = _a.existLocalesFolder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-translate-plugin",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
4
4
  "description": "Tiny and powerful i18n plugin to translate your Next.js pages.",
5
5
  "license": "MIT",
6
6
  "keywords": [