connected api with profile, order

This commit is contained in:
Jelaletdin12
2025-11-15 16:14:01 +05:00
parent 21b9e88c5c
commit f867896817
70 changed files with 2370 additions and 2317 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: {},
}
}
})