Files
RobertFent 3f75ff69cb Use Array.from to avoid @ts-ignore when copying i18n.locales (#82148)
### What?
Replaces:
```ts
// @ts-ignore locales are readonly
const locales: string[] = i18n.locales;
```
with:
```ts
const locales = Array.from(i18n.locales);
```

### Why?
Avoids suppressing TypeScript errors via @ts-ignore.
Array.from safely creates a mutable copy without modifying the readonly
original, making the code cleaner and more type-safe.

### How?
Used Array.from(i18n.locales) instead of a forced type assertion.<br>

<br>
No functional change, purely a lint-/type-safety improvement.

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-09-30 00:13:41 +02:00
..
…

Internationalized Routing

Next.js doesn't support internationalized routing in app directory out of the box. But you can easily implement it yourself. This example shows how to implement internationalized routing on the Edge.

Deploy your own

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example i18n-routing i18n-routing-app
yarn create next-app --example i18n-routing i18n-routing-app
pnpm create next-app --example i18n-routing i18n-routing-app

Deploy it to the cloud with Vercel (Documentation).