first commit

This commit is contained in:
Jelaletdin12
2026-02-01 20:55:57 +05:00
commit b8c871750a
128 changed files with 23114 additions and 0 deletions

32
i18n/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: {},
}
}
})