mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
build: update to Node.js v24.0.0, pnpm v10, Tailwind CSS v4
This commit is contained in:
15
packages/i18n/src/messages.d.ts
vendored
15
packages/i18n/src/messages.d.ts
vendored
@ -1,10 +1,9 @@
|
||||
import type fr from "./translations/fr-FR.json"
|
||||
import type { routing } from "./routing.ts"
|
||||
import type messages from "./translations/en-US.json"
|
||||
|
||||
type Messages = typeof fr
|
||||
|
||||
declare global {
|
||||
/**
|
||||
* Use type safe message keys with `next-intl`.
|
||||
*/
|
||||
interface IntlMessages extends Messages {}
|
||||
declare module "next-intl" {
|
||||
interface AppConfig {
|
||||
Locale: (typeof routing.locales)[number]
|
||||
Messages: typeof messages
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
import type { AbstractIntlMessages } from "next-intl"
|
||||
import { hasLocale } from "next-intl"
|
||||
import { getRequestConfig } from "next-intl/server"
|
||||
import { routing } from "./routing.ts"
|
||||
|
||||
import type { Locale } from "@repo/utils/constants"
|
||||
import { LOCALE_DEFAULT, LOCALES } from "@repo/utils/constants"
|
||||
import { LOCALE_DEFAULT } from "@repo/utils/constants"
|
||||
import { deepMerge } from "@repo/utils/objects"
|
||||
|
||||
export default getRequestConfig(async ({ requestLocale }) => {
|
||||
let locale = await requestLocale
|
||||
if (!LOCALES.includes(locale as Locale)) {
|
||||
locale = LOCALE_DEFAULT
|
||||
}
|
||||
const requested = await requestLocale
|
||||
const locale = hasLocale(routing.locales, requested)
|
||||
? requested
|
||||
: routing.defaultLocale
|
||||
|
||||
const userMessages = (await import(`./translations/${locale}.json`)).default
|
||||
const defaultMessages = (
|
||||
|
Reference in New Issue
Block a user