next-intl non english url
Answered
Netherland Dwarf posted this in #help-forum
Netherland DwarfOP
How do i handle encodedUrl?
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:
export const localePrefix = undefined;
export type AppPathnames = keyof typeof pathnames;
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:
alwaysexport const localePrefix = undefined;
export type AppPathnames = keyof typeof pathnames;
whats the best practice to handle this issue?
what im using:
- App router
- next-intl : https://next-intl-docs.vercel.app/docs/getting-started/app-router
- App router
- next-intl : https://next-intl-docs.vercel.app/docs/getting-started/app-router
Netherland DwarfOP
@Ray coming in clutch again, thanks alot!
