QuiiBz / next-international

Type-safe internationalization (i18n) for Next.js
https://next-international.vercel.app
MIT License
1.28k stars 59 forks source link

Default locale not added on redirect #394

Open schoettler opened 5 months ago

schoettler commented 5 months ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Set your next-international/middleware without any rewrite rule:
    const I18nMiddleware = createI18nMiddleware({
    locales: ['en', 'fr'], // oui oui je suis canadienne
    defaultLocale: 'en',
    });
  2. useRouter to navigate

Expected behavior

import { useRouter } from 'next/navigation'
[...]
      router.push('/');
[...]

It is expected to resolve localhost/[basePath]/[defaultLocale] (maybe my expectation is wrong).

But it's only resolving localhost/[basePath]

About (please complete the following information):