@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/nextjs",
3
- "version": "2.1.193",
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.193",
152
- "@djangocfg/ui-core": "^2.1.193",
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.193",
172
- "@djangocfg/ui-core": "^2.1.193",
173
- "@djangocfg/imgai": "^2.1.193",
174
- "@djangocfg/layouts": "^2.1.193",
175
- "@djangocfg/typescript-config": "^2.1.193",
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",
@@ -25,7 +25,7 @@ import {
25
25
  useTranslations as useNextIntlTranslations
26
26
  } from 'next-intl';
27
27
 
28
- import { usePathname, useRouter } from './navigation';
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
- router.replace(pathname, { locale });
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