amannn / next-intl

🌐 Internationalization (i18n) for Next.js
https://next-intl-docs.vercel.app
MIT License
2.58k stars 236 forks source link

feat: Support `./i18n/request.ts` in addition to `./i18n.ts` #1308

Closed amannn closed 2 months ago

amannn commented 2 months ago

There are typically at least two config files you're using when choosing the i18n routing setup:

i18n.ts is currently named in a rather generic way, almost indicating that it contains everything related to i18n.

In order to clarify the meaning of these files and to gather them in a shared place, this PR proposes a new default location for the request config as well as the routing config:

└── src
    └── i18n
        ├── request.ts
        └── routing.ts

From my experience, many people already use an i18n folder or similar. This change might come in handy and avoids a potential configuration step for users.

That being said, i18n.ts is still supported, so there's no need to change existing apps.

vercel[bot] commented 2 months ago

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

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 0:44am
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 0:44am
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 0:44am