@intlayer/next-intl 9.5.9 → 9.5.10
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/routing.cjs +1 -1
- package/dist/cjs/routing.cjs.map +1 -1
- package/dist/esm/routing.mjs +1 -1
- package/dist/esm/routing.mjs.map +1 -1
- package/package.json +10 -10
package/dist/cjs/routing.cjs
CHANGED
|
@@ -20,7 +20,7 @@ let _intlayer_config_built = require("@intlayer/config/built");
|
|
|
20
20
|
const defineRouting = (config) => ({
|
|
21
21
|
locales: config?.locales ?? _intlayer_config_built.internationalization?.locales ?? [],
|
|
22
22
|
defaultLocale: config?.defaultLocale ?? _intlayer_config_built.internationalization?.defaultLocale,
|
|
23
|
-
localePrefix: config?.localePrefix ?? (_intlayer_config_built.routing?.
|
|
23
|
+
localePrefix: config?.localePrefix ?? (_intlayer_config_built.routing?.mode === "prefix-all" ? "always" : _intlayer_config_built.routing?.mode === "no-prefix" ? "never" : "as-needed"),
|
|
24
24
|
...config
|
|
25
25
|
});
|
|
26
26
|
|
package/dist/cjs/routing.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.cjs","names":["internationalization","routing"],"sources":["../../src/routing.ts"],"sourcesContent":["import { internationalization, routing } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nexport type Routing = {\n locales: LocalesValues[];\n defaultLocale: LocalesValues;\n localePrefix?: 'always' | 'as-needed' | 'never';\n pathnames?: Record<string, string | Record<string, string>>;\n};\n\n/**\n * Drop-in replacement for next-intl's `defineRouting()`.\n *\n * Merges the provided config with Intlayer's own routing / internationalization\n * configuration so you don't have to repeat locale lists. All fields are\n * optional — omitted values are read from the Intlayer config at runtime.\n *\n * @example\n * ```ts\n * export default defineRouting({\n * locales: ['en', 'fr'],\n * defaultLocale: 'en',\n * });\n * ```\n */\nexport const defineRouting: (config?: Partial<Routing>) => Routing = (\n config?: Partial<Routing>\n): Routing => ({\n locales:\n config?.locales ??\n ((internationalization?.locales ?? []) as LocalesValues[]),\n defaultLocale:\n config?.defaultLocale ??\n (internationalization?.defaultLocale as LocalesValues),\n localePrefix:\n config?.localePrefix
|
|
1
|
+
{"version":3,"file":"routing.cjs","names":["internationalization","routing"],"sources":["../../src/routing.ts"],"sourcesContent":["import { internationalization, routing } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nexport type Routing = {\n locales: LocalesValues[];\n defaultLocale: LocalesValues;\n localePrefix?: 'always' | 'as-needed' | 'never';\n pathnames?: Record<string, string | Record<string, string>>;\n};\n\n/**\n * Drop-in replacement for next-intl's `defineRouting()`.\n *\n * Merges the provided config with Intlayer's own routing / internationalization\n * configuration so you don't have to repeat locale lists. All fields are\n * optional — omitted values are read from the Intlayer config at runtime.\n *\n * @example\n * ```ts\n * export default defineRouting({\n * locales: ['en', 'fr'],\n * defaultLocale: 'en',\n * });\n * ```\n */\nexport const defineRouting: (config?: Partial<Routing>) => Routing = (\n config?: Partial<Routing>\n): Routing => ({\n locales:\n config?.locales ??\n ((internationalization?.locales ?? []) as LocalesValues[]),\n defaultLocale:\n config?.defaultLocale ??\n (internationalization?.defaultLocale as LocalesValues),\n localePrefix:\n config?.localePrefix ??\n (routing?.mode === 'prefix-all'\n ? 'always'\n : routing?.mode === 'no-prefix'\n ? 'never'\n : 'as-needed'),\n ...config,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,MAAa,iBACX,YACa;CACb,SACE,QAAQ,WACNA,6CAAsB,WAAW,CAAC;CACtC,eACE,QAAQ,iBACPA,6CAAsB;CACzB,cACE,QAAQ,iBACPC,gCAAS,SAAS,eACf,WACAA,gCAAS,SAAS,cAChB,UACA;CACR,GAAG;AACL"}
|
package/dist/esm/routing.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import { internationalization, routing } from "@intlayer/config/built";
|
|
|
19
19
|
const defineRouting = (config) => ({
|
|
20
20
|
locales: config?.locales ?? internationalization?.locales ?? [],
|
|
21
21
|
defaultLocale: config?.defaultLocale ?? internationalization?.defaultLocale,
|
|
22
|
-
localePrefix: config?.localePrefix ?? (routing?.
|
|
22
|
+
localePrefix: config?.localePrefix ?? (routing?.mode === "prefix-all" ? "always" : routing?.mode === "no-prefix" ? "never" : "as-needed"),
|
|
23
23
|
...config
|
|
24
24
|
});
|
|
25
25
|
|
package/dist/esm/routing.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.mjs","names":[],"sources":["../../src/routing.ts"],"sourcesContent":["import { internationalization, routing } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nexport type Routing = {\n locales: LocalesValues[];\n defaultLocale: LocalesValues;\n localePrefix?: 'always' | 'as-needed' | 'never';\n pathnames?: Record<string, string | Record<string, string>>;\n};\n\n/**\n * Drop-in replacement for next-intl's `defineRouting()`.\n *\n * Merges the provided config with Intlayer's own routing / internationalization\n * configuration so you don't have to repeat locale lists. All fields are\n * optional — omitted values are read from the Intlayer config at runtime.\n *\n * @example\n * ```ts\n * export default defineRouting({\n * locales: ['en', 'fr'],\n * defaultLocale: 'en',\n * });\n * ```\n */\nexport const defineRouting: (config?: Partial<Routing>) => Routing = (\n config?: Partial<Routing>\n): Routing => ({\n locales:\n config?.locales ??\n ((internationalization?.locales ?? []) as LocalesValues[]),\n defaultLocale:\n config?.defaultLocale ??\n (internationalization?.defaultLocale as LocalesValues),\n localePrefix:\n config?.localePrefix
|
|
1
|
+
{"version":3,"file":"routing.mjs","names":[],"sources":["../../src/routing.ts"],"sourcesContent":["import { internationalization, routing } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nexport type Routing = {\n locales: LocalesValues[];\n defaultLocale: LocalesValues;\n localePrefix?: 'always' | 'as-needed' | 'never';\n pathnames?: Record<string, string | Record<string, string>>;\n};\n\n/**\n * Drop-in replacement for next-intl's `defineRouting()`.\n *\n * Merges the provided config with Intlayer's own routing / internationalization\n * configuration so you don't have to repeat locale lists. All fields are\n * optional — omitted values are read from the Intlayer config at runtime.\n *\n * @example\n * ```ts\n * export default defineRouting({\n * locales: ['en', 'fr'],\n * defaultLocale: 'en',\n * });\n * ```\n */\nexport const defineRouting: (config?: Partial<Routing>) => Routing = (\n config?: Partial<Routing>\n): Routing => ({\n locales:\n config?.locales ??\n ((internationalization?.locales ?? []) as LocalesValues[]),\n defaultLocale:\n config?.defaultLocale ??\n (internationalization?.defaultLocale as LocalesValues),\n localePrefix:\n config?.localePrefix ??\n (routing?.mode === 'prefix-all'\n ? 'always'\n : routing?.mode === 'no-prefix'\n ? 'never'\n : 'as-needed'),\n ...config,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAa,iBACX,YACa;CACb,SACE,QAAQ,WACN,sBAAsB,WAAW,CAAC;CACtC,eACE,QAAQ,iBACP,sBAAsB;CACzB,cACE,QAAQ,iBACP,SAAS,SAAS,eACf,WACA,SAAS,SAAS,cAChB,UACA;CACR,GAAG;AACL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/next-intl",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "next-intl API adapter for intlayer — useTranslations, useLocale, getTranslations, getLocale, NextIntlClientProvider backed by next-intlayer",
|
|
6
6
|
"keywords": [
|
|
@@ -112,14 +112,14 @@
|
|
|
112
112
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
113
113
|
},
|
|
114
114
|
"dependencies": {
|
|
115
|
-
"@intlayer/config": "9.5.
|
|
116
|
-
"@intlayer/core": "9.5.
|
|
117
|
-
"@intlayer/dictionaries-entry": "9.5.
|
|
118
|
-
"@intlayer/engine": "9.5.
|
|
119
|
-
"@intlayer/types": "9.5.
|
|
120
|
-
"@intlayer/use-intl": "9.5.
|
|
121
|
-
"next-intlayer": "9.5.
|
|
122
|
-
"react-intlayer": "9.5.
|
|
115
|
+
"@intlayer/config": "9.5.10",
|
|
116
|
+
"@intlayer/core": "9.5.10",
|
|
117
|
+
"@intlayer/dictionaries-entry": "9.5.10",
|
|
118
|
+
"@intlayer/engine": "9.5.10",
|
|
119
|
+
"@intlayer/types": "9.5.10",
|
|
120
|
+
"@intlayer/use-intl": "9.5.10",
|
|
121
|
+
"next-intlayer": "9.5.10",
|
|
122
|
+
"react-intlayer": "9.5.10"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
125
|
"@types/node": "^22",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"rimraf": "6.1.3",
|
|
132
132
|
"tsdown": "0.23.0",
|
|
133
133
|
"typescript": "7.0.2",
|
|
134
|
-
"vitest": "5.0.
|
|
134
|
+
"vitest": "5.0.2"
|
|
135
135
|
},
|
|
136
136
|
"peerDependencies": {
|
|
137
137
|
"next": ">=14.0.0",
|