Next.js Discord

Discord Forum

next-intl non english url

Answered
Netherland Dwarf posted this in #help-forum
Open in Discord
Netherland DwarfOP
How do i handle encodedUrl?
Answered by Ray
https://github.com/amannn/next-intl/pull/959
try the pre-release version next-intl@3.11.0-beta.2
View full answer

6 Replies

Netherland DwarfOP
given the url is like this, but when it comes to routing, they cant find the path.

but if i'm using en/de it works except for zh/ja
import { Pathnames } from "next-intl/navigation";

export const locales = ["en", "zh", "ja", "de"] as const;

export const pathnames = {
"/": "/",
"/pathnames": {
en: "/pathnames",
zh: "/路径名",
ja: "/パス名",
de: '/pfadnamen'
},
"/news": {
en: "/news",
zh: "/æ–°é—»",
ja: "/ニュース",
de: '/newsss'
},
"/product": {
en: "/product",
zh: "/产品",
ja: "/製品",
de: '/productsss'
},
} satisfies Pathnames<typeof locales>;

// Use the default: always
export const localePrefix = undefined;

export type AppPathnames = keyof typeof pathnames;
whats the best practice to handle this issue?
Answer
Netherland DwarfOP
@Ray coming in clutch again, thanks alot!
:aww: