next-translate-plugin
Advanced tools
Comparing version 2.4.0-canary.4 to 2.4.0-canary.5
@@ -43,3 +43,3 @@ "use strict"; | ||
var code = pagePkg.getCode(); | ||
return "\n import ".concat(utils_1.INTERNAL_CONFIG_KEY, " from '@next-translate-root/i18n'\n import __loadNamespaces from 'next-translate/loadNamespaces'\n import __nt_store from 'next-translate/_store'\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.searchParams?.lang ?? props.params?.lang ?? ").concat(utils_1.INTERNAL_CONFIG_KEY, ".defaultLocale,\n loaderName: 'server ").concat(routeType, "',\n pathname: '").concat(pathname, "',\n ").concat((0, utils_1.addLoadLocalesFrom)(), "\n }\n const { __lang, __namespaces } = await __loadNamespaces(config)\n\n __nt_store.set({ lang: __lang, namespaces: __namespaces, config })\n\n return <").concat(pageVariableName, " {...props} />\n }\n"); | ||
return "\n import ".concat(utils_1.INTERNAL_CONFIG_KEY, " from '@next-translate-root/i18n'\n import __loadNamespaces from 'next-translate/loadNamespaces'\n import __nt_store from 'next-translate/_store'\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 ").concat((0, utils_1.addLoadLocalesFrom)(), "\n }\n const { __lang, __namespaces } = await __loadNamespaces(config)\n\n __nt_store.set({ lang: __lang, namespaces: __namespaces, config })\n\n return <").concat(pageVariableName, " {...props} />\n }\n"); | ||
} | ||
@@ -61,3 +61,3 @@ function templateClientComponent(_a) { | ||
var _b = _a.name, name = _b === void 0 ? '' : _b, _c = _a.pathname, pathname = _c === void 0 ? '' : _c, _d = _a.isPage, isPage = _d === void 0 ? false : _d, _e = _a.pageVariableName, pageVariableName = _e === void 0 ? '' : _e, _f = _a.routeType, routeType = _f === void 0 ? 'component' : _f; | ||
return "function ".concat(name, "(props) {\n const searchParams = __useSearchParams()\n const params = __useParams()\n const lang = searchParams.get('lang') ?? params.lang ?? ").concat(utils_1.INTERNAL_CONFIG_KEY, ".defaultLocale\n const config = { \n ...").concat(utils_1.INTERNAL_CONFIG_KEY, ",\n locale: lang,\n loaderName: 'client ").concat(routeType, "',\n pathname: '").concat(pathname, "',\n logBuild: ").concat(isPage, ",\n ").concat((0, utils_1.addLoadLocalesFrom)(), "\n }\n const { __lang, __namespaces } = __use(__loadNamespaces(config));\n\n __nt_store.set({ lang, namespaces: __namespaces, config })\n\n return <").concat(pageVariableName, " {...props} />\n }"); | ||
return "function ".concat(name, "(props) {\n const searchParams = __useSearchParams()\n const params = __useParams()\n const lang = params.lang ?? searchParams.get('lang') ?? ").concat(utils_1.INTERNAL_CONFIG_KEY, ".defaultLocale\n const config = {\n ...").concat(utils_1.INTERNAL_CONFIG_KEY, ",\n locale: lang,\n loaderName: 'client ").concat(routeType, "',\n pathname: '").concat(pathname, "',\n logBuild: ").concat(isPage, ",\n ").concat((0, utils_1.addLoadLocalesFrom)(), "\n }\n const { __lang, __namespaces } = __use(__loadNamespaces(config));\n\n __nt_store.set({ lang, namespaces: __namespaces, config })\n\n return <").concat(pageVariableName, " {...props} />\n }"); | ||
} | ||
@@ -64,0 +64,0 @@ function modifyNamedExportsComponents(pagePkg, hash) { |
@@ -40,3 +40,3 @@ import { interceptExport, addLoadLocalesFrom, clientLine, interceptNamedExportsFromReactComponents, INTERNAL_CONFIG_KEY, } from './utils'; | ||
var code = pagePkg.getCode(); | ||
return "\n import ".concat(INTERNAL_CONFIG_KEY, " from '@next-translate-root/i18n'\n import __loadNamespaces from 'next-translate/loadNamespaces'\n import __nt_store from 'next-translate/_store'\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.searchParams?.lang ?? props.params?.lang ?? ").concat(INTERNAL_CONFIG_KEY, ".defaultLocale,\n loaderName: 'server ").concat(routeType, "',\n pathname: '").concat(pathname, "',\n ").concat(addLoadLocalesFrom(), "\n }\n const { __lang, __namespaces } = await __loadNamespaces(config)\n\n __nt_store.set({ lang: __lang, namespaces: __namespaces, config })\n\n return <").concat(pageVariableName, " {...props} />\n }\n"); | ||
return "\n import ".concat(INTERNAL_CONFIG_KEY, " from '@next-translate-root/i18n'\n import __loadNamespaces from 'next-translate/loadNamespaces'\n import __nt_store from 'next-translate/_store'\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 ").concat(addLoadLocalesFrom(), "\n }\n const { __lang, __namespaces } = await __loadNamespaces(config)\n\n __nt_store.set({ lang: __lang, namespaces: __namespaces, config })\n\n return <").concat(pageVariableName, " {...props} />\n }\n"); | ||
} | ||
@@ -58,3 +58,3 @@ function templateClientComponent(_a) { | ||
var _b = _a.name, name = _b === void 0 ? '' : _b, _c = _a.pathname, pathname = _c === void 0 ? '' : _c, _d = _a.isPage, isPage = _d === void 0 ? false : _d, _e = _a.pageVariableName, pageVariableName = _e === void 0 ? '' : _e, _f = _a.routeType, routeType = _f === void 0 ? 'component' : _f; | ||
return "function ".concat(name, "(props) {\n const searchParams = __useSearchParams()\n const params = __useParams()\n const lang = searchParams.get('lang') ?? params.lang ?? ").concat(INTERNAL_CONFIG_KEY, ".defaultLocale\n const config = { \n ...").concat(INTERNAL_CONFIG_KEY, ",\n locale: lang,\n loaderName: 'client ").concat(routeType, "',\n pathname: '").concat(pathname, "',\n logBuild: ").concat(isPage, ",\n ").concat(addLoadLocalesFrom(), "\n }\n const { __lang, __namespaces } = __use(__loadNamespaces(config));\n\n __nt_store.set({ lang, namespaces: __namespaces, config })\n\n return <").concat(pageVariableName, " {...props} />\n }"); | ||
return "function ".concat(name, "(props) {\n const searchParams = __useSearchParams()\n const params = __useParams()\n const lang = params.lang ?? searchParams.get('lang') ?? ").concat(INTERNAL_CONFIG_KEY, ".defaultLocale\n const config = {\n ...").concat(INTERNAL_CONFIG_KEY, ",\n locale: lang,\n loaderName: 'client ").concat(routeType, "',\n pathname: '").concat(pathname, "',\n logBuild: ").concat(isPage, ",\n ").concat(addLoadLocalesFrom(), "\n }\n const { __lang, __namespaces } = __use(__loadNamespaces(config));\n\n __nt_store.set({ lang, namespaces: __namespaces, config })\n\n return <").concat(pageVariableName, " {...props} />\n }"); | ||
} | ||
@@ -61,0 +61,0 @@ function modifyNamedExportsComponents(pagePkg, hash) { |
{ | ||
"name": "next-translate-plugin", | ||
"version": "2.4.0-canary.4", | ||
"version": "2.4.0-canary.5", | ||
"description": "Tiny and powerful i18n plugin to translate your Next.js pages.", | ||
@@ -107,2 +107,2 @@ "license": "MIT", | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86654