Files
firma/i18n/request.ts
nabijonovdavronbek619@gmail.com aa2260f212 translation bug fixed
2025-11-29 13:48:55 +05:00

19 lines
597 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// i18n/request.ts
import { getRequestConfig, type GetRequestConfigParams } from "next-intl/server";
import { notFound } from "next/navigation";
export const locales = ['uz','ru'];
export default getRequestConfig(async ({ locale }: GetRequestConfigParams) => {
// Agar locale undefined yoki not supported bolsa, 404
if (!locale || !locales.includes(locale)) notFound();
// endi TypeScript uchun locale string ekanligi aniq
const messages = (await import(`../locales/${locale}.json`)).default;
return {
locale, // string, undefined emas
messages, // JSON fayl
};
});