Update next-intl (and other packages), internationalize URLs

This commit is contained in:
Timothy Armes
2023-10-10 19:48:13 +02:00
committed by Owen Rees
parent 44bfe17c8f
commit effb912641
32 changed files with 902 additions and 939 deletions
+32
View File
@@ -0,0 +1,32 @@
import {
Pathnames,
createLocalizedPathnamesNavigation,
} from "next-intl/navigation";
export const locales = ["fr", "en"] as const;
// The `pathnames` object holds pairs of internal
// and external paths, separated by locale.
export const pathnames = {
"/": "/",
"/clubs": "/clubs",
"/elo": "/elo",
"/tournaments": {
fr: "/tournois",
en: "/tournaments",
},
"/add-tournament": {
fr: "/ajouter-un-tournoi",
en: "/add-tournament",
},
"/contact-us": {
fr: "/contactez-nous",
en: "/contact-us",
},
} satisfies Pathnames<typeof locales>;
export const { Link, redirect, usePathname, useRouter, getPathname } =
createLocalizedPathnamesNavigation({ locales, pathnames });