added tons of features

This commit is contained in:
2025-02-05 08:01:14 +02:00
parent 4ae0d8c545
commit 8138da6b1d
195 changed files with 12619 additions and 415 deletions

42
i18n/request.ts Normal file
View File

@@ -0,0 +1,42 @@
import {Formats, hasLocale} from 'next-intl'
import {getRequestConfig} from 'next-intl/server'
import {routing} from './routing'
export const formats = {
dateTime: {
short: {
day: 'numeric',
month: 'short',
year: 'numeric'
}
},
number: {
precise: {
maximumFractionDigits: 2
}
},
list: {
enumeration: {
style: 'long',
type: 'conjunction'
}
}
} satisfies Formats
export default getRequestConfig(async ({requestLocale}) => {
// Typically corresponds to the `[locale]` segment
const requested = await requestLocale
const locale = hasLocale(routing.locales, requested)
? requested
: routing.defaultLocale
/**
* https://dev.to/hpouyanmehr/split-your-translations-in-next-intl-in-a-nice-way-4jof
* Split your translations in `next-intl` in a nice way!
*/
return {
locale,
messages: (await import(`../messages/${locale}.json`)).default
}
})