@djangocfg/nextjs 2.1.193 → 2.1.196
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 +1 -2
- package/dist/i18n/client.mjs.map +1 -1
- package/dist/i18n/components.mjs +1 -2
- 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 +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/nextjs",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.196",
|
|
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.196",
|
|
152
|
+
"@djangocfg/ui-core": "^2.1.196",
|
|
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.196",
|
|
172
|
+
"@djangocfg/ui-core": "^2.1.196",
|
|
173
|
+
"@djangocfg/imgai": "^2.1.196",
|
|
174
|
+
"@djangocfg/layouts": "^2.1.196",
|
|
175
|
+
"@djangocfg/typescript-config": "^2.1.196",
|
|
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
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
useTranslations as useNextIntlTranslations
|
|
26
26
|
} from 'next-intl';
|
|
27
27
|
|
|
28
|
-
import { usePathname
|
|
28
|
+
import { usePathname } from './navigation';
|
|
29
29
|
import { I18nProvider, NextIntlProvider } from './provider';
|
|
30
30
|
import { routing } from './routing';
|
|
31
31
|
|
|
@@ -193,7 +193,6 @@ export function useDefaultLocale(): LocaleCode {
|
|
|
193
193
|
* ```
|
|
194
194
|
*/
|
|
195
195
|
export function useChangeLocale() {
|
|
196
|
-
const router = useRouter();
|
|
197
196
|
const pathname = usePathname();
|
|
198
197
|
|
|
199
198
|
return (locale: LocaleCode) => {
|
|
@@ -202,7 +201,9 @@ export function useChangeLocale() {
|
|
|
202
201
|
date.setFullYear(date.getFullYear() + 1);
|
|
203
202
|
document.cookie = `NEXT_LOCALE=${locale}; expires=${date.toUTCString()}; path=/`;
|
|
204
203
|
|
|
205
|
-
|
|
204
|
+
// Hard navigation to force full page reload with new locale
|
|
205
|
+
// (ensures server components re-render with updated translations)
|
|
206
|
+
window.location.href = `/${locale}${pathname}`;
|
|
206
207
|
};
|
|
207
208
|
}
|
|
208
209
|
|