import { supportedLocales } from "./types.ts";
import type { SupportedLocale } from "./types.ts";
import { commonMessages } from "./modules/common/index.ts";
import type { CommonMessages } from "./modules/common/index.ts";
import { bookingMessages } from "./modules/booking/index.ts";
import type { BookingMessages } from "./modules/booking/index.ts";
import { goodsMessages } from "./modules/goods/index.ts";
import type { GoodsMessages } from "./modules/goods/index.ts";
import { homeMessages } from "./modules/home/index.ts";
import type { HomeMessages } from "./modules/home/index.ts";
import { orderMessages } from "./modules/order/index.ts";
import type { OrderMessages } from "./modules/order/index.ts";
import { quickMessages } from "./modules/quick/index.ts";
import type { QuickMessages } from "./modules/quick/index.ts";
import { serviceMessages } from "./modules/service/index.ts";
import type { ServiceMessages } from "./modules/service/index.ts";

export type AppMessages = {
  booking: BookingMessages;
  common: CommonMessages;
  goods: GoodsMessages;
  home: HomeMessages;
  order: OrderMessages;
  quick: QuickMessages;
  service: ServiceMessages;
};

export const messages = Object.fromEntries(
  supportedLocales.map((locale) => [
    locale,
    {
      booking: bookingMessages[locale],
      common: commonMessages[locale],
      goods: goodsMessages[locale],
      home: homeMessages[locale],
      order: orderMessages[locale],
      quick: quickMessages[locale],
      service: serviceMessages[locale],
    },
  ]),
) as Record<SupportedLocale, AppMessages>;
