QuiiBz / next-international

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

fix(docs): typos & edit page url #134

Closed QuiiBz closed 1 year ago

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-international ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2023 4:00pm
stuartrobinson3007 commented 1 year ago

createI18nMiddleware expects locales and defaultLocale to be the first two params.

This PR puts all params into an object:

const I18nMiddleware = createI18nMiddleware({
  locales: ['en', 'fr'],
  defaultLocale: 'en',
  urlMappingStrategy: 'rewrite'
})

It should be:

const I18nMiddleware = createI18nMiddleware(['en', 'fr'], 'en', {
  urlMappingStrategy: 'rewrite',
})

I think these two pages are the only places it's an issue. The examples in the github readme are ok.