first commit

This commit is contained in:
Jelaletdin12
2025-11-10 10:07:48 +05:00
commit fdec9e4b0e
131 changed files with 16660 additions and 0 deletions

32
i18n.ts Normal file
View File

@@ -0,0 +1,32 @@
import { getRequestConfig } from "next-intl/server"
import { notFound } from "next/navigation"
export const locales = ["ru", "tm"] as const
export const defaultLocale = "ru" as const
export default getRequestConfig(async ({ requestLocale }) => {
let locale = await requestLocale
// Fallback to default if undefined
if (!locale) {
locale = defaultLocale
}
// Validate locale
if (!locales.includes(locale as any)) {
notFound()
}
try {
const messages = (await import(`./messages/${locale}.json`)).default
return {
locale,
messages,
}
} catch (error) {
return {
locale,
messages: {},
}
}
})