@djangocfg/nextjs 2.1.188 → 2.1.190
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/config/index.mjs +1 -1
- package/dist/config/index.mjs.map +1 -1
- package/dist/i18n/client.mjs +3 -0
- package/dist/i18n/client.mjs.map +1 -1
- package/dist/i18n/components.mjs +3 -0
- package/dist/i18n/components.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/i18n/client.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/nextjs",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.190",
|
|
4
4
|
"description": "Next.js server utilities: sitemap, health, OG images, contact forms, navigation, config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nextjs",
|
|
@@ -148,8 +148,8 @@
|
|
|
148
148
|
"ai-docs": "tsx src/ai/cli.ts"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
151
|
-
"@djangocfg/i18n": "^2.1.
|
|
152
|
-
"@djangocfg/ui-core": "^2.1.
|
|
151
|
+
"@djangocfg/i18n": "^2.1.190",
|
|
152
|
+
"@djangocfg/ui-core": "^2.1.190",
|
|
153
153
|
"next": "^16.0.10"
|
|
154
154
|
},
|
|
155
155
|
"peerDependenciesMeta": {
|
|
@@ -168,11 +168,11 @@
|
|
|
168
168
|
"serwist": "^9.2.3"
|
|
169
169
|
},
|
|
170
170
|
"devDependencies": {
|
|
171
|
-
"@djangocfg/i18n": "^2.1.
|
|
172
|
-
"@djangocfg/ui-core": "^2.1.
|
|
173
|
-
"@djangocfg/imgai": "^2.1.
|
|
174
|
-
"@djangocfg/layouts": "^2.1.
|
|
175
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
171
|
+
"@djangocfg/i18n": "^2.1.190",
|
|
172
|
+
"@djangocfg/ui-core": "^2.1.190",
|
|
173
|
+
"@djangocfg/imgai": "^2.1.190",
|
|
174
|
+
"@djangocfg/layouts": "^2.1.190",
|
|
175
|
+
"@djangocfg/typescript-config": "^2.1.190",
|
|
176
176
|
"@types/node": "^24.7.2",
|
|
177
177
|
"@types/react": "19.2.2",
|
|
178
178
|
"@types/react-dom": "19.2.1",
|
package/src/i18n/client.ts
CHANGED
|
@@ -197,6 +197,11 @@ export function useChangeLocale() {
|
|
|
197
197
|
const pathname = usePathname();
|
|
198
198
|
|
|
199
199
|
return (locale: LocaleCode) => {
|
|
200
|
+
// Set NEXT_LOCALE cookie so middleware remembers the choice
|
|
201
|
+
const date = new Date();
|
|
202
|
+
date.setFullYear(date.getFullYear() + 1);
|
|
203
|
+
document.cookie = `NEXT_LOCALE=${locale}; expires=${date.toUTCString()}; path=/`;
|
|
204
|
+
|
|
200
205
|
router.replace(pathname, { locale });
|
|
201
206
|
};
|
|
202
207
|
}
|