mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
build(deps): update Next.js to v15 and ESLint to v9
This commit is contained in:
@ -1,26 +0,0 @@
|
||||
import type { Locale } from "@repo/utils/constants"
|
||||
import type { RichTranslationValues } from "next-intl"
|
||||
|
||||
export interface LocaleProps {
|
||||
params: {
|
||||
locale: Locale
|
||||
}
|
||||
}
|
||||
|
||||
export const defaultTranslationValues: RichTranslationValues = {
|
||||
br: () => {
|
||||
return <br />
|
||||
},
|
||||
strong: (children) => {
|
||||
return <strong>{children}</strong>
|
||||
},
|
||||
em: (children) => {
|
||||
return <em>{children}</em>
|
||||
},
|
||||
s: (children) => {
|
||||
return <s>{children}</s>
|
||||
},
|
||||
u: (children) => {
|
||||
return <u>{children}</u>
|
||||
},
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
import { createSharedPathnamesNavigation } from "next-intl/navigation"
|
||||
|
||||
import { LOCALES, LOCALE_PREFIX } from "@repo/utils/constants"
|
||||
|
||||
export const { Link, redirect, usePathname, useRouter, permanentRedirect } =
|
||||
createSharedPathnamesNavigation({
|
||||
locales: LOCALES,
|
||||
localePrefix: LOCALE_PREFIX,
|
||||
})
|
@ -1,15 +1,14 @@
|
||||
import deepmerge from "deepmerge"
|
||||
import type { AbstractIntlMessages } from "next-intl"
|
||||
import { getRequestConfig } from "next-intl/server"
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
import type { Locale } from "@repo/utils/constants"
|
||||
import { LOCALE_DEFAULT, LOCALES } from "@repo/utils/constants"
|
||||
import { defaultTranslationValues } from "./config.tsx"
|
||||
|
||||
export default getRequestConfig(async ({ locale }) => {
|
||||
export default getRequestConfig(async ({ requestLocale }) => {
|
||||
let locale = await requestLocale
|
||||
if (!LOCALES.includes(locale as Locale)) {
|
||||
return notFound()
|
||||
locale = LOCALE_DEFAULT
|
||||
}
|
||||
|
||||
const userMessages = (await import(`./translations/${locale}.json`)).default
|
||||
@ -22,7 +21,7 @@ export default getRequestConfig(async ({ locale }) => {
|
||||
)
|
||||
|
||||
return {
|
||||
locale,
|
||||
messages,
|
||||
defaultTranslationValues,
|
||||
}
|
||||
})
|
26
packages/i18n/src/routing.ts
Normal file
26
packages/i18n/src/routing.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { createNavigation } from "next-intl/navigation"
|
||||
|
||||
import { LOCALES, LOCALE_DEFAULT, LOCALE_PREFIX } from "@repo/utils/constants"
|
||||
import { defineRouting } from "next-intl/routing"
|
||||
import type { Locale } from "@repo/utils/constants"
|
||||
|
||||
export interface LocaleProps {
|
||||
params: Promise<{
|
||||
locale: Locale
|
||||
}>
|
||||
}
|
||||
|
||||
export const routing = defineRouting({
|
||||
locales: LOCALES,
|
||||
defaultLocale: LOCALE_DEFAULT,
|
||||
localePrefix: LOCALE_PREFIX,
|
||||
})
|
||||
|
||||
export const {
|
||||
Link,
|
||||
redirect,
|
||||
usePathname,
|
||||
useRouter,
|
||||
getPathname,
|
||||
permanentRedirect,
|
||||
} = createNavigation(routing)
|
@ -10,10 +10,10 @@
|
||||
"institution": "Conservatoire National des Arts et Métiers (CNAM), in Eckbolsheim - UIMM Alsace - ITII Alsace",
|
||||
"study-type": "Engineer in Computer Science and Information Systems (IS)",
|
||||
"years": {
|
||||
"2024-2025": {
|
||||
"2024-2027": {
|
||||
"courses": {},
|
||||
"description": "1st year",
|
||||
"title": "2024 - 2025"
|
||||
"description": "",
|
||||
"title": "2024 - 2027"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -10,10 +10,10 @@
|
||||
"institution": "Conservatoire National des Arts et Métiers (CNAM) à Eckbolsheim - UIMM Alsace - ITII Alsace",
|
||||
"study-type": "Ingénieur en Informatique et Systèmes d'Information (SI)",
|
||||
"years": {
|
||||
"2024-2025": {
|
||||
"2024-2027": {
|
||||
"courses": {},
|
||||
"description": "1ère année",
|
||||
"title": "2024 - 2025"
|
||||
"description": "",
|
||||
"title": "2024 - 2027"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user