@intlayer/core 7.5.3 → 7.5.5
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/dist/cjs/localization/getLocaleFromPath.cjs +2 -2
- package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
- package/dist/cjs/localization/getPathWithoutLocale.cjs +1 -1
- package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
- package/dist/esm/localization/getLocaleFromPath.mjs +2 -2
- package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
- package/dist/esm/localization/getPathWithoutLocale.mjs +1 -1
- package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +8 -8
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +8 -8
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +2 -2
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
- package/dist/types/localization/getLocaleFromPath.d.ts +1 -1
- package/dist/types/localization/getLocaleFromPath.d.ts.map +1 -1
- package/dist/types/transpiler/translation/translation.d.ts +1 -1
- package/dist/types/transpiler/translation/translation.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -24,12 +24,12 @@ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built
|
|
|
24
24
|
* @param inputUrl - The complete URL string or pathname to process.
|
|
25
25
|
* @returns The detected locale or default (en) if no locale is found
|
|
26
26
|
*/
|
|
27
|
-
const getLocaleFromPath = (inputUrl) => {
|
|
27
|
+
const getLocaleFromPath = (inputUrl = "/") => {
|
|
28
28
|
const { defaultLocale, locales } = _intlayer_config_built.default?.internationalization ?? {};
|
|
29
29
|
if (!defaultLocale || !locales) return _intlayer_types.Locales.ENGLISH;
|
|
30
30
|
const isAbsoluteUrl = require_utils_checkIsURLAbsolute.checkIsURLAbsolute(inputUrl);
|
|
31
31
|
let fixedInputUrl = inputUrl;
|
|
32
|
-
if (inputUrl
|
|
32
|
+
if (inputUrl?.endsWith("/")) fixedInputUrl = inputUrl.slice(0, -1);
|
|
33
33
|
const pathname = (isAbsoluteUrl ? new URL(fixedInputUrl) : new URL(fixedInputUrl, "http://example.com")).pathname;
|
|
34
34
|
if (!pathname.startsWith("/")) return defaultLocale;
|
|
35
35
|
const firstSegment = pathname.split("/")[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocaleFromPath.cjs","names":["configuration","Locales","checkIsURLAbsolute"],"sources":["../../../src/localization/getLocaleFromPath.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { type Locale, Locales } from '@intlayer/types';\nimport { checkIsURLAbsolute } from '../utils/checkIsURLAbsolute';\n\n/**\n * Extracts the locale segment from the given URL or pathname if present.\n * If no locale is present, returns the default locale (en).\n *\n * Example:\n *\n * ```ts\n * getLocaleFromPath('/en/dashboard') // Returns 'en'\n * getLocaleFromPath('/fr/dashboard') // Returns 'fr'\n * getLocaleFromPath('/dashboard') // Returns 'en'\n * getLocaleFromPath('dashboard') // Returns 'en'\n * getLocaleFromPath('https://example.com/es/dashboard') // Returns 'es'\n * getLocaleFromPath('https://example.com/fr/dashboard') // Returns 'fr'\n * getLocaleFromPath('https://example.com/dashboard') // Returns 'en'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @returns The detected locale or default (en) if no locale is found\n */\nexport const getLocaleFromPath = (inputUrl: string): Locale => {\n // Define supported locales array\n const { defaultLocale, locales } = configuration?.internationalization ?? {};\n\n if (!defaultLocale || !locales) {\n return Locales.ENGLISH;\n }\n\n // Determine if the original URL is absolute (includes protocol)\n const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);\n\n let fixedInputUrl = inputUrl;\n\n if (inputUrl
|
|
1
|
+
{"version":3,"file":"getLocaleFromPath.cjs","names":["configuration","Locales","checkIsURLAbsolute"],"sources":["../../../src/localization/getLocaleFromPath.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { type Locale, Locales } from '@intlayer/types';\nimport { checkIsURLAbsolute } from '../utils/checkIsURLAbsolute';\n\n/**\n * Extracts the locale segment from the given URL or pathname if present.\n * If no locale is present, returns the default locale (en).\n *\n * Example:\n *\n * ```ts\n * getLocaleFromPath('/en/dashboard') // Returns 'en'\n * getLocaleFromPath('/fr/dashboard') // Returns 'fr'\n * getLocaleFromPath('/dashboard') // Returns 'en'\n * getLocaleFromPath('dashboard') // Returns 'en'\n * getLocaleFromPath('https://example.com/es/dashboard') // Returns 'es'\n * getLocaleFromPath('https://example.com/fr/dashboard') // Returns 'fr'\n * getLocaleFromPath('https://example.com/dashboard') // Returns 'en'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @returns The detected locale or default (en) if no locale is found\n */\nexport const getLocaleFromPath = (inputUrl: string = '/'): Locale => {\n // Define supported locales array\n const { defaultLocale, locales } = configuration?.internationalization ?? {};\n\n if (!defaultLocale || !locales) {\n return Locales.ENGLISH;\n }\n\n // Determine if the original URL is absolute (includes protocol)\n const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);\n\n let fixedInputUrl = inputUrl;\n\n if (inputUrl?.endsWith('/')) {\n fixedInputUrl = inputUrl.slice(0, -1);\n }\n\n // Initialize a URL object if the URL is absolute\n // For relative URLs, use a dummy base to leverage the URL API\n const url = isAbsoluteUrl\n ? new URL(fixedInputUrl)\n : new URL(fixedInputUrl, 'http://example.com');\n\n const pathname = url.pathname;\n\n // Ensure the pathname starts with '/'\n if (!pathname.startsWith('/')) {\n // If not, return the default locale\n return defaultLocale;\n }\n\n // Split the pathname to extract the first segment\n const pathSegments = pathname.split('/');\n const firstSegment = pathSegments[1]; // The segment after the first '/'\n\n // Check if the first segment is a supported locale\n if (firstSegment && locales.includes(firstSegment as Locale)) {\n // Return the detected locale\n return firstSegment as Locale;\n }\n\n // Return the default locale if no locale is found in the path\n return defaultLocale;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,qBAAqB,WAAmB,QAAgB;CAEnE,MAAM,EAAE,eAAe,YAAYA,gCAAe,wBAAwB,EAAE;AAE5E,KAAI,CAAC,iBAAiB,CAAC,QACrB,QAAOC,wBAAQ;CAIjB,MAAM,gBAAgBC,oDAAmB,SAAS;CAElD,IAAI,gBAAgB;AAEpB,KAAI,UAAU,SAAS,IAAI,CACzB,iBAAgB,SAAS,MAAM,GAAG,GAAG;CASvC,MAAM,YAJM,gBACR,IAAI,IAAI,cAAc,GACtB,IAAI,IAAI,eAAe,qBAAqB,EAE3B;AAGrB,KAAI,CAAC,SAAS,WAAW,IAAI,CAE3B,QAAO;CAKT,MAAM,eADe,SAAS,MAAM,IAAI,CACN;AAGlC,KAAI,gBAAgB,QAAQ,SAAS,aAAuB,CAE1D,QAAO;AAIT,QAAO"}
|
|
@@ -31,7 +31,7 @@ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built
|
|
|
31
31
|
const getPathWithoutLocale = (inputUrl, locales = _intlayer_config_built.default?.internationalization?.locales) => {
|
|
32
32
|
const isAbsoluteUrl = require_utils_checkIsURLAbsolute.checkIsURLAbsolute(inputUrl);
|
|
33
33
|
let fixedInputUrl = inputUrl;
|
|
34
|
-
if (inputUrl
|
|
34
|
+
if (inputUrl?.endsWith("/")) fixedInputUrl = inputUrl.slice(0, -1);
|
|
35
35
|
const url = isAbsoluteUrl ? new URL(fixedInputUrl) : new URL(fixedInputUrl, "http://example.com");
|
|
36
36
|
const pathname = url.pathname;
|
|
37
37
|
if (!pathname.startsWith("/")) url.pathname = `/${pathname}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPathWithoutLocale.cjs","names":["configuration","checkIsURLAbsolute"],"sources":["../../../src/localization/getPathWithoutLocale.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types';\n\nimport { checkIsURLAbsolute } from '../utils/checkIsURLAbsolute';\n\n/**\n * Removes the locale segment from the given URL or pathname if present.\n * Also removes locale from search parameters if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getPathWithoutLocale('/en/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/fr/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('dashboard') // Returns 'dashboard'\n * getPathWithoutLocale('/dashboard?locale=fr') // Returns '/dashboard'\n * getPathWithoutLocale('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/fr/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard?locale=fr') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string or pathname without the locale segment or locale search parameter.\n */\nexport const getPathWithoutLocale = (\n inputUrl: string,\n locales: LocalesValues[] = configuration?.internationalization?.locales\n): string => {\n // Determine if the original URL is absolute (includes protocol)\n const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);\n\n let fixedInputUrl = inputUrl;\n\n if (inputUrl
|
|
1
|
+
{"version":3,"file":"getPathWithoutLocale.cjs","names":["configuration","checkIsURLAbsolute"],"sources":["../../../src/localization/getPathWithoutLocale.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types';\n\nimport { checkIsURLAbsolute } from '../utils/checkIsURLAbsolute';\n\n/**\n * Removes the locale segment from the given URL or pathname if present.\n * Also removes locale from search parameters if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getPathWithoutLocale('/en/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/fr/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('dashboard') // Returns 'dashboard'\n * getPathWithoutLocale('/dashboard?locale=fr') // Returns '/dashboard'\n * getPathWithoutLocale('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/fr/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard?locale=fr') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string or pathname without the locale segment or locale search parameter.\n */\nexport const getPathWithoutLocale = (\n inputUrl: string,\n locales: LocalesValues[] = configuration?.internationalization?.locales\n): string => {\n // Determine if the original URL is absolute (includes protocol)\n const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);\n\n let fixedInputUrl = inputUrl;\n\n if (inputUrl?.endsWith('/')) {\n fixedInputUrl = inputUrl.slice(0, -1);\n }\n\n // Initialize a URL object if the URL is absolute\n // For relative URLs, use a dummy base to leverage the URL API\n const url = isAbsoluteUrl\n ? new URL(fixedInputUrl)\n : new URL(fixedInputUrl, 'http://example.com');\n\n const pathname = url.pathname;\n\n // Ensure the pathname starts with '/'\n if (!pathname.startsWith('/')) {\n // If not, return the URL as is\n url.pathname = `/${pathname}`;\n }\n\n // Split the pathname to extract the first segment\n const pathSegments = pathname.split('/');\n const firstSegment = pathSegments[1]; // The segment after the first '/'\n\n // Check if the first segment is a supported locale\n if (locales?.includes(firstSegment as LocalesValues)) {\n // Remove the locale segment from the pathname\n pathSegments.splice(1, 1); // Remove the first segment\n\n // Reconstruct the pathname\n const newPathname = pathSegments.join('/') ?? '/';\n url.pathname = newPathname;\n }\n\n // Remove locale from search parameters if present\n const searchParams = new URLSearchParams(url.search);\n if (searchParams.has('locale')) {\n searchParams.delete('locale');\n url.search = searchParams.toString();\n }\n\n if (isAbsoluteUrl) {\n // Return the modified URL as a string\n return url.toString();\n }\n\n // Return the modified URL as a string\n return url.toString().replace('http://example.com', '');\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,wBACX,UACA,UAA2BA,gCAAe,sBAAsB,YACrD;CAEX,MAAM,gBAAgBC,oDAAmB,SAAS;CAElD,IAAI,gBAAgB;AAEpB,KAAI,UAAU,SAAS,IAAI,CACzB,iBAAgB,SAAS,MAAM,GAAG,GAAG;CAKvC,MAAM,MAAM,gBACR,IAAI,IAAI,cAAc,GACtB,IAAI,IAAI,eAAe,qBAAqB;CAEhD,MAAM,WAAW,IAAI;AAGrB,KAAI,CAAC,SAAS,WAAW,IAAI,CAE3B,KAAI,WAAW,IAAI;CAIrB,MAAM,eAAe,SAAS,MAAM,IAAI;CACxC,MAAM,eAAe,aAAa;AAGlC,KAAI,SAAS,SAAS,aAA8B,EAAE;AAEpD,eAAa,OAAO,GAAG,EAAE;AAIzB,MAAI,WADgB,aAAa,KAAK,IAAI,IAAI;;CAKhD,MAAM,eAAe,IAAI,gBAAgB,IAAI,OAAO;AACpD,KAAI,aAAa,IAAI,SAAS,EAAE;AAC9B,eAAa,OAAO,SAAS;AAC7B,MAAI,SAAS,aAAa,UAAU;;AAGtC,KAAI,cAEF,QAAO,IAAI,UAAU;AAIvB,QAAO,IAAI,UAAU,CAAC,QAAQ,sBAAsB,GAAG"}
|
|
@@ -22,12 +22,12 @@ import configuration from "@intlayer/config/built";
|
|
|
22
22
|
* @param inputUrl - The complete URL string or pathname to process.
|
|
23
23
|
* @returns The detected locale or default (en) if no locale is found
|
|
24
24
|
*/
|
|
25
|
-
const getLocaleFromPath = (inputUrl) => {
|
|
25
|
+
const getLocaleFromPath = (inputUrl = "/") => {
|
|
26
26
|
const { defaultLocale, locales } = configuration?.internationalization ?? {};
|
|
27
27
|
if (!defaultLocale || !locales) return Locales.ENGLISH;
|
|
28
28
|
const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);
|
|
29
29
|
let fixedInputUrl = inputUrl;
|
|
30
|
-
if (inputUrl
|
|
30
|
+
if (inputUrl?.endsWith("/")) fixedInputUrl = inputUrl.slice(0, -1);
|
|
31
31
|
const pathname = (isAbsoluteUrl ? new URL(fixedInputUrl) : new URL(fixedInputUrl, "http://example.com")).pathname;
|
|
32
32
|
if (!pathname.startsWith("/")) return defaultLocale;
|
|
33
33
|
const firstSegment = pathname.split("/")[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocaleFromPath.mjs","names":[],"sources":["../../../src/localization/getLocaleFromPath.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { type Locale, Locales } from '@intlayer/types';\nimport { checkIsURLAbsolute } from '../utils/checkIsURLAbsolute';\n\n/**\n * Extracts the locale segment from the given URL or pathname if present.\n * If no locale is present, returns the default locale (en).\n *\n * Example:\n *\n * ```ts\n * getLocaleFromPath('/en/dashboard') // Returns 'en'\n * getLocaleFromPath('/fr/dashboard') // Returns 'fr'\n * getLocaleFromPath('/dashboard') // Returns 'en'\n * getLocaleFromPath('dashboard') // Returns 'en'\n * getLocaleFromPath('https://example.com/es/dashboard') // Returns 'es'\n * getLocaleFromPath('https://example.com/fr/dashboard') // Returns 'fr'\n * getLocaleFromPath('https://example.com/dashboard') // Returns 'en'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @returns The detected locale or default (en) if no locale is found\n */\nexport const getLocaleFromPath = (inputUrl: string): Locale => {\n // Define supported locales array\n const { defaultLocale, locales } = configuration?.internationalization ?? {};\n\n if (!defaultLocale || !locales) {\n return Locales.ENGLISH;\n }\n\n // Determine if the original URL is absolute (includes protocol)\n const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);\n\n let fixedInputUrl = inputUrl;\n\n if (inputUrl
|
|
1
|
+
{"version":3,"file":"getLocaleFromPath.mjs","names":[],"sources":["../../../src/localization/getLocaleFromPath.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { type Locale, Locales } from '@intlayer/types';\nimport { checkIsURLAbsolute } from '../utils/checkIsURLAbsolute';\n\n/**\n * Extracts the locale segment from the given URL or pathname if present.\n * If no locale is present, returns the default locale (en).\n *\n * Example:\n *\n * ```ts\n * getLocaleFromPath('/en/dashboard') // Returns 'en'\n * getLocaleFromPath('/fr/dashboard') // Returns 'fr'\n * getLocaleFromPath('/dashboard') // Returns 'en'\n * getLocaleFromPath('dashboard') // Returns 'en'\n * getLocaleFromPath('https://example.com/es/dashboard') // Returns 'es'\n * getLocaleFromPath('https://example.com/fr/dashboard') // Returns 'fr'\n * getLocaleFromPath('https://example.com/dashboard') // Returns 'en'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @returns The detected locale or default (en) if no locale is found\n */\nexport const getLocaleFromPath = (inputUrl: string = '/'): Locale => {\n // Define supported locales array\n const { defaultLocale, locales } = configuration?.internationalization ?? {};\n\n if (!defaultLocale || !locales) {\n return Locales.ENGLISH;\n }\n\n // Determine if the original URL is absolute (includes protocol)\n const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);\n\n let fixedInputUrl = inputUrl;\n\n if (inputUrl?.endsWith('/')) {\n fixedInputUrl = inputUrl.slice(0, -1);\n }\n\n // Initialize a URL object if the URL is absolute\n // For relative URLs, use a dummy base to leverage the URL API\n const url = isAbsoluteUrl\n ? new URL(fixedInputUrl)\n : new URL(fixedInputUrl, 'http://example.com');\n\n const pathname = url.pathname;\n\n // Ensure the pathname starts with '/'\n if (!pathname.startsWith('/')) {\n // If not, return the default locale\n return defaultLocale;\n }\n\n // Split the pathname to extract the first segment\n const pathSegments = pathname.split('/');\n const firstSegment = pathSegments[1]; // The segment after the first '/'\n\n // Check if the first segment is a supported locale\n if (firstSegment && locales.includes(firstSegment as Locale)) {\n // Return the detected locale\n return firstSegment as Locale;\n }\n\n // Return the default locale if no locale is found in the path\n return defaultLocale;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,qBAAqB,WAAmB,QAAgB;CAEnE,MAAM,EAAE,eAAe,YAAY,eAAe,wBAAwB,EAAE;AAE5E,KAAI,CAAC,iBAAiB,CAAC,QACrB,QAAO,QAAQ;CAIjB,MAAM,gBAAgB,mBAAmB,SAAS;CAElD,IAAI,gBAAgB;AAEpB,KAAI,UAAU,SAAS,IAAI,CACzB,iBAAgB,SAAS,MAAM,GAAG,GAAG;CASvC,MAAM,YAJM,gBACR,IAAI,IAAI,cAAc,GACtB,IAAI,IAAI,eAAe,qBAAqB,EAE3B;AAGrB,KAAI,CAAC,SAAS,WAAW,IAAI,CAE3B,QAAO;CAKT,MAAM,eADe,SAAS,MAAM,IAAI,CACN;AAGlC,KAAI,gBAAgB,QAAQ,SAAS,aAAuB,CAE1D,QAAO;AAIT,QAAO"}
|
|
@@ -29,7 +29,7 @@ import configuration from "@intlayer/config/built";
|
|
|
29
29
|
const getPathWithoutLocale = (inputUrl, locales = configuration?.internationalization?.locales) => {
|
|
30
30
|
const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);
|
|
31
31
|
let fixedInputUrl = inputUrl;
|
|
32
|
-
if (inputUrl
|
|
32
|
+
if (inputUrl?.endsWith("/")) fixedInputUrl = inputUrl.slice(0, -1);
|
|
33
33
|
const url = isAbsoluteUrl ? new URL(fixedInputUrl) : new URL(fixedInputUrl, "http://example.com");
|
|
34
34
|
const pathname = url.pathname;
|
|
35
35
|
if (!pathname.startsWith("/")) url.pathname = `/${pathname}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPathWithoutLocale.mjs","names":[],"sources":["../../../src/localization/getPathWithoutLocale.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types';\n\nimport { checkIsURLAbsolute } from '../utils/checkIsURLAbsolute';\n\n/**\n * Removes the locale segment from the given URL or pathname if present.\n * Also removes locale from search parameters if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getPathWithoutLocale('/en/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/fr/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('dashboard') // Returns 'dashboard'\n * getPathWithoutLocale('/dashboard?locale=fr') // Returns '/dashboard'\n * getPathWithoutLocale('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/fr/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard?locale=fr') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string or pathname without the locale segment or locale search parameter.\n */\nexport const getPathWithoutLocale = (\n inputUrl: string,\n locales: LocalesValues[] = configuration?.internationalization?.locales\n): string => {\n // Determine if the original URL is absolute (includes protocol)\n const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);\n\n let fixedInputUrl = inputUrl;\n\n if (inputUrl
|
|
1
|
+
{"version":3,"file":"getPathWithoutLocale.mjs","names":[],"sources":["../../../src/localization/getPathWithoutLocale.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types';\n\nimport { checkIsURLAbsolute } from '../utils/checkIsURLAbsolute';\n\n/**\n * Removes the locale segment from the given URL or pathname if present.\n * Also removes locale from search parameters if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getPathWithoutLocale('/en/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/fr/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('dashboard') // Returns 'dashboard'\n * getPathWithoutLocale('/dashboard?locale=fr') // Returns '/dashboard'\n * getPathWithoutLocale('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/fr/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard?locale=fr') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string or pathname without the locale segment or locale search parameter.\n */\nexport const getPathWithoutLocale = (\n inputUrl: string,\n locales: LocalesValues[] = configuration?.internationalization?.locales\n): string => {\n // Determine if the original URL is absolute (includes protocol)\n const isAbsoluteUrl = checkIsURLAbsolute(inputUrl);\n\n let fixedInputUrl = inputUrl;\n\n if (inputUrl?.endsWith('/')) {\n fixedInputUrl = inputUrl.slice(0, -1);\n }\n\n // Initialize a URL object if the URL is absolute\n // For relative URLs, use a dummy base to leverage the URL API\n const url = isAbsoluteUrl\n ? new URL(fixedInputUrl)\n : new URL(fixedInputUrl, 'http://example.com');\n\n const pathname = url.pathname;\n\n // Ensure the pathname starts with '/'\n if (!pathname.startsWith('/')) {\n // If not, return the URL as is\n url.pathname = `/${pathname}`;\n }\n\n // Split the pathname to extract the first segment\n const pathSegments = pathname.split('/');\n const firstSegment = pathSegments[1]; // The segment after the first '/'\n\n // Check if the first segment is a supported locale\n if (locales?.includes(firstSegment as LocalesValues)) {\n // Remove the locale segment from the pathname\n pathSegments.splice(1, 1); // Remove the first segment\n\n // Reconstruct the pathname\n const newPathname = pathSegments.join('/') ?? '/';\n url.pathname = newPathname;\n }\n\n // Remove locale from search parameters if present\n const searchParams = new URLSearchParams(url.search);\n if (searchParams.has('locale')) {\n searchParams.delete('locale');\n url.search = searchParams.toString();\n }\n\n if (isAbsoluteUrl) {\n // Return the modified URL as a string\n return url.toString();\n }\n\n // Return the modified URL as a string\n return url.toString().replace('http://example.com', '');\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,wBACX,UACA,UAA2B,eAAe,sBAAsB,YACrD;CAEX,MAAM,gBAAgB,mBAAmB,SAAS;CAElD,IAAI,gBAAgB;AAEpB,KAAI,UAAU,SAAS,IAAI,CACzB,iBAAgB,SAAS,MAAM,GAAG,GAAG;CAKvC,MAAM,MAAM,gBACR,IAAI,IAAI,cAAc,GACtB,IAAI,IAAI,eAAe,qBAAqB;CAEhD,MAAM,WAAW,IAAI;AAGrB,KAAI,CAAC,SAAS,WAAW,IAAI,CAE3B,KAAI,WAAW,IAAI;CAIrB,MAAM,eAAe,SAAS,MAAM,IAAI;CACxC,MAAM,eAAe,aAAa;AAGlC,KAAI,SAAS,SAAS,aAA8B,EAAE;AAEpD,eAAa,OAAO,GAAG,EAAE;AAIzB,MAAI,WADgB,aAAa,KAAK,IAAI,IAAI;;CAKhD,MAAM,eAAe,IAAI,gBAAgB,IAAI,OAAO;AACpD,KAAI,aAAa,IAAI,SAAS,EAAE;AAC9B,eAAa,OAAO,SAAS;AAC7B,MAAI,SAAS,aAAa,UAAU;;AAGtC,KAAI,cAEF,QAAO,IAAI,UAAU;AAIvB,QAAO,IAAI,UAAU,CAAC,QAAQ,sBAAsB,GAAG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
|
|
2
2
|
import "../interpreter/index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _intlayer_types13 from "@intlayer/types";
|
|
4
4
|
import { ContentNode, DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts
|
|
@@ -24,12 +24,12 @@ declare const getFilterMissingTranslationsContent: <T extends ContentNode, L ext
|
|
|
24
24
|
declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, localeToCheck: LocalesValues) => {
|
|
25
25
|
content: any;
|
|
26
26
|
$schema?: string;
|
|
27
|
-
id?:
|
|
27
|
+
id?: _intlayer_types13.DictionaryId;
|
|
28
28
|
projectIds?: string[];
|
|
29
|
-
localId?:
|
|
30
|
-
localIds?:
|
|
31
|
-
format?:
|
|
32
|
-
key:
|
|
29
|
+
localId?: _intlayer_types13.LocalDictionaryId;
|
|
30
|
+
localIds?: _intlayer_types13.LocalDictionaryId[];
|
|
31
|
+
format?: _intlayer_types13.DictionaryFormat;
|
|
32
|
+
key: _intlayer_types13.DictionaryKey;
|
|
33
33
|
title?: string;
|
|
34
34
|
description?: string;
|
|
35
35
|
versions?: string[];
|
|
@@ -37,11 +37,11 @@ declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, l
|
|
|
37
37
|
filePath?: string;
|
|
38
38
|
tags?: string[];
|
|
39
39
|
locale?: LocalesValues;
|
|
40
|
-
fill?:
|
|
40
|
+
fill?: _intlayer_types13.Fill;
|
|
41
41
|
filled?: true;
|
|
42
42
|
priority?: number;
|
|
43
43
|
live?: boolean;
|
|
44
|
-
location?:
|
|
44
|
+
location?: _intlayer_types13.DictionaryLocation;
|
|
45
45
|
};
|
|
46
46
|
//#endregion
|
|
47
47
|
export { filterMissingTranslationsOnlyPlugin, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAmMa,qDACI,kBACd;;AAFH;AA8LA;;;;;;;;AA0BA;;;;cA1Ba,gDACD,uBACA,gBAAgB,uBAEpB,kBACS,cACJ;cAoBA,qDACC,2BACG;;;OAAa,
|
|
1
|
+
{"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAmMa,qDACI,kBACd;;AAFH;AA8LA;;;;;;;;AA0BA;;;;cA1Ba,gDACD,uBACA,gBAAgB,uBAEpB,kBACS,cACJ;cAoBA,qDACC,2BACG;;;OAAa,iBAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeProps } from "../interpreter/getContent/plugins.js";
|
|
2
2
|
import "../interpreter/index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _intlayer_types0 from "@intlayer/types";
|
|
4
4
|
import { ContentNode, Dictionary, LocalesValues } from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilteredLocalesContent.d.ts
|
|
@@ -8,12 +8,12 @@ declare const getFilteredLocalesContent: (node: ContentNode, locales: LocalesVal
|
|
|
8
8
|
declare const getFilteredLocalesDictionary: (dictionary: Dictionary, locale: LocalesValues | LocalesValues[]) => {
|
|
9
9
|
content: any;
|
|
10
10
|
$schema?: string;
|
|
11
|
-
id?:
|
|
11
|
+
id?: _intlayer_types0.DictionaryId;
|
|
12
12
|
projectIds?: string[];
|
|
13
|
-
localId?:
|
|
14
|
-
localIds?:
|
|
15
|
-
format?:
|
|
16
|
-
key:
|
|
13
|
+
localId?: _intlayer_types0.LocalDictionaryId;
|
|
14
|
+
localIds?: _intlayer_types0.LocalDictionaryId[];
|
|
15
|
+
format?: _intlayer_types0.DictionaryFormat;
|
|
16
|
+
key: _intlayer_types0.DictionaryKey;
|
|
17
17
|
title?: string;
|
|
18
18
|
description?: string;
|
|
19
19
|
versions?: string[];
|
|
@@ -21,11 +21,11 @@ declare const getFilteredLocalesDictionary: (dictionary: Dictionary, locale: Loc
|
|
|
21
21
|
filePath?: string;
|
|
22
22
|
tags?: string[];
|
|
23
23
|
locale?: LocalesValues;
|
|
24
|
-
fill?:
|
|
24
|
+
fill?: _intlayer_types0.Fill;
|
|
25
25
|
filled?: true;
|
|
26
26
|
priority?: number;
|
|
27
27
|
live?: boolean;
|
|
28
|
-
location?:
|
|
28
|
+
location?: _intlayer_types0.DictionaryLocation;
|
|
29
29
|
};
|
|
30
30
|
//#endregion
|
|
31
31
|
export { getFilteredLocalesContent, getFilteredLocalesDictionary };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFilteredLocalesContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilteredLocalesContent.ts"],"sourcesContent":[],"mappings":";;;;;;cAsCa,kCACL,sBACG,gBAAgB,4BACd;cAwBA,2CACC,oBACJ,gBAAgB;;;EA7Bb,EAAA,CAAA,EA6B0B,
|
|
1
|
+
{"version":3,"file":"getFilteredLocalesContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilteredLocalesContent.ts"],"sourcesContent":[],"mappings":";;;;;;cAsCa,kCACL,sBACG,gBAAgB,4BACd;cAwBA,2CACC,oBACJ,gBAAgB;;;EA7Bb,EAAA,CAAA,EA6B0B,gBAAA,CAAA,YAbtC;EAfO,UAAA,CAAA,EAAA,MAAA,EAAA;EACG,OAAA,CAAA,oCAAA;EAAgB,QAAA,CAAA,sCAAA;EACd,MAAA,CAAA,mCAAA;EAAS,GAAA,gCAAA;EAwBT,KAAA,CAAA,EAAA,MAAA;EACC,WAAA,CAAA,EAAA,MAAA;EACJ,QAAA,CAAA,EAAA,MAAA,EAAA;EAAgB,OAAA,CAAA,EAAA,MAAA;EAAa,QAAA,CAAA,EAAA,MAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types20 from "@intlayer/types";
|
|
2
2
|
import { Dictionary } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/dictionaryManipulator/orderDictionaries.d.ts
|
|
@@ -10,7 +10,7 @@ import { Dictionary } from "@intlayer/types";
|
|
|
10
10
|
* @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')
|
|
11
11
|
* @returns Ordered array of dictionaries
|
|
12
12
|
*/
|
|
13
|
-
declare const orderDictionaries: (dictionaries: Dictionary[], configuration?:
|
|
13
|
+
declare const orderDictionaries: (dictionaries: Dictionary[], configuration?: _intlayer_types20.IntlayerConfig) => Dictionary[];
|
|
14
14
|
//#endregion
|
|
15
15
|
export { orderDictionaries };
|
|
16
16
|
//# sourceMappingURL=orderDictionaries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../../../src/interpreter/getContent/plugins.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAoCA;AAcA;;;;;;AAIc,KAlBF,OAAA,GAkBE;EACR,EAAA,EAAA,MAAA;EAAgB,SAAA,EAAA,CAAA,IAAA,EAAA,GAAA,EAAA,GAAA,OAAA;EACO,SAAA,EAAA,CAAA,IAAA,EAAA,GAAA,EAAA,KAAA,EAflB,SAekB,EAAA,WAAA,EAAA,CAAA,IAAA,EAAA,GAAA,EAAA,KAAA,EAdO,SAcP,EAAA,GAAA,GAAA,EAAA,GAAA,GAAA;CAAE;;;;AACM,KAPzB,eAOyB,CAAA,CAAA,EAAA,CAAA,EAAA,UAPO,aAOP,CAAA,GAPwB,CAOxB,SAAA;EAAI,QAAA,EAN7B,QAM6B,GAAA,MAAA;EAAjC,CALL,QAAA,CAAS,WAAA,CAKJ,EAAA,KAAA,EAAA;CAAoB,GAAA,CAAA,SAHd,MAGc,CAHP,WAGO,EAAA,OAAA,CAAA,GAFtB,CAEsB,SAAA,MAFN,CAEM,GADpB,oBACoB,CADC,CACD,CADG,CACH,CAAA,EADO,CACP,CAAA,GAApB,oBAAoB,CAAC,CAAD,CAAA,MAAS,CAAT,CAAA,EAAa,CAAb,CAAA,GAAA,KAAA,GAAA,KAAA;AAK5B;AACU,cADG,iBACH,EAAA,CAAA,MAAA,EAAA,aAAA,EAAA,QAAA,CAAA,EACG,aADH,EAAA,iBAAA,CAAA,EAAA,CAAA,MAAA,EAGE,aAHF,EAAA,QAAA,EAII,aAJJ,EAAA,OAAA,EAKG,OALH,EAAA,EAAA,GAAA,IAAA,EAAA,GAOP,OAPO;;;;AAKG,KAgCD,eAhCC,CA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GAAA,CAAA,SAAA,CAAA,GAgD2B,CAhD3B,GAAA,IAAA,GAAA,KAAA;;AAOV;AAOE;AAOmC,KAgCzB,oBAhCyB,CAAA,CAAA,EAAA,IAkC/B,uBAlC+B,EAAA,UAmCzB,aAnCyB,GAmCT,eAnCS,CAAA,GAoCjC,KApCiC,CAoC3B,CApC2B,CAAA,SAAA,IAAA,GAqCjC,CArCiC,GAsCjC,gBAtCiC,CAsChB,CAtCgB,EAAA,MAsCP,kBAtCO,CAsCY,CAtCZ,EAsCe,CAtCf,EAsCkB,CAtClB,CAAA,EAsCsB,CAtCtB,CAAA,SAAA,KAAA,GAwC/B,QAxC+B,CAwCtB,CAxCsB,EAwCnB,CAxCmB,EAwChB,CAxCgB,CAAA,GA0C/B,kBA1C+B,CA0CZ,CA1CY,EA0CT,CA1CS,EA0CN,CA1CM,CAAA,CAAA,MA0CG,kBA1CH,CA0CsB,CA1CtB,EA0CyB,CA1CzB,EA0C4B,CA1C5B,CAAA,CAAA"}
|
|
@@ -21,7 +21,7 @@ import { Locale } from "@intlayer/types";
|
|
|
21
21
|
* @param inputUrl - The complete URL string or pathname to process.
|
|
22
22
|
* @returns The detected locale or default (en) if no locale is found
|
|
23
23
|
*/
|
|
24
|
-
declare const getLocaleFromPath: (inputUrl
|
|
24
|
+
declare const getLocaleFromPath: (inputUrl?: string) => Locale;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { getLocaleFromPath };
|
|
27
27
|
//# sourceMappingURL=getLocaleFromPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocaleFromPath.d.ts","names":[],"sources":["../../../src/localization/getLocaleFromPath.ts"],"sourcesContent":[],"mappings":";;;;;;AAuBA;;;;;;;;;;;;;;;;;cAAa,
|
|
1
|
+
{"version":3,"file":"getLocaleFromPath.d.ts","names":[],"sources":["../../../src/localization/getLocaleFromPath.ts"],"sourcesContent":[],"mappings":";;;;;;AAuBA;;;;;;;;;;;;;;;;;cAAa,0CAA8C"}
|
|
@@ -23,7 +23,7 @@ type TranslationContent<Content = unknown, RecordContent extends StrictModeLocal
|
|
|
23
23
|
* - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
|
|
24
24
|
*/
|
|
25
25
|
declare const translation: <Content = unknown, ContentRecord extends StrictModeLocaleMap<Content> = StrictModeLocaleMap<Content>>(content: ContentRecord) => TypedNodeModel<NodeType.Translation, ContentRecord, {
|
|
26
|
-
nodeType: NodeType.Translation
|
|
26
|
+
nodeType: "translation" | NodeType.Translation;
|
|
27
27
|
} & {
|
|
28
28
|
translation: ContentRecord;
|
|
29
29
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.d.ts","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":[],"mappings":";;;KAOY,4DAGR,oBAAoB,WAAW,oBAAoB,YACnD,eAAe,QAAA,CAAS,aAAa;;AAJzC;;;;;;;;;AAIwD;;;;;;;;;;cAsBlD,WAKkB,EAAA,CAAA,UAAA,OAAA,EAAA,sBAFpB,mBAEoB,CAFA,OAEA,CAAA,GAFW,mBAEX,CAF+B,OAE/B,CAAA,CAAA,CAAA,OAAA,EAAb,aAAa,EAAA,GAAA,cAAA,CAAA,QAAA,CAAA,WAAA,EAAA,aAAA,EAAA;EAAA,QAAA,
|
|
1
|
+
{"version":3,"file":"translation.d.ts","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":[],"mappings":";;;KAOY,4DAGR,oBAAoB,WAAW,oBAAoB,YACnD,eAAe,QAAA,CAAS,aAAa;;AAJzC;;;;;;;;;AAIwD;;;;;;;;;;cAsBlD,WAKkB,EAAA,CAAA,UAAA,OAAA,EAAA,sBAFpB,mBAEoB,CAFA,OAEA,CAAA,GAFW,mBAEX,CAF+B,OAE/B,CAAA,CAAA,CAAA,OAAA,EAAb,aAAa,EAAA,GAAA,cAAA,CAAA,QAAA,CAAA,WAAA,EAAA,aAAA,EAAA;EAAA,QAAA,EAAA,aAAA,uBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
|
|
6
6
|
"keywords": [
|
|
@@ -107,11 +107,11 @@
|
|
|
107
107
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@intlayer/api": "7.5.
|
|
111
|
-
"@intlayer/config": "7.5.
|
|
112
|
-
"@intlayer/dictionaries-entry": "7.5.
|
|
113
|
-
"@intlayer/types": "7.5.
|
|
114
|
-
"@intlayer/unmerged-dictionaries-entry": "7.5.
|
|
110
|
+
"@intlayer/api": "7.5.5",
|
|
111
|
+
"@intlayer/config": "7.5.5",
|
|
112
|
+
"@intlayer/dictionaries-entry": "7.5.5",
|
|
113
|
+
"@intlayer/types": "7.5.5",
|
|
114
|
+
"@intlayer/unmerged-dictionaries-entry": "7.5.5",
|
|
115
115
|
"defu": "6.1.4"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|