2025-04-28 17:30:58 +03:00
|
|
|
import { beforeAll } from "vitest";
|
|
|
|
import i18next from "i18next";
|
|
|
|
import { join } from "path";
|
2025-05-17 09:45:53 +03:00
|
|
|
import dayjs from "dayjs";
|
2025-04-28 17:30:58 +03:00
|
|
|
|
|
|
|
beforeAll(async () => {
|
|
|
|
// Initialize the translations manually to avoid any side effects.
|
|
|
|
const Backend = (await import("i18next-fs-backend")).default;
|
|
|
|
|
|
|
|
// Initialize translations
|
|
|
|
await i18next.use(Backend).init({
|
|
|
|
lng: "en",
|
|
|
|
fallbackLng: "en",
|
|
|
|
ns: "server",
|
|
|
|
backend: {
|
2025-04-28 17:35:52 +03:00
|
|
|
loadPath: join(__dirname, "../src/assets/translations/{{lng}}/{{ns}}.json")
|
2025-04-28 17:30:58 +03:00
|
|
|
}
|
|
|
|
});
|
2025-05-17 09:45:53 +03:00
|
|
|
|
|
|
|
// Initialize dayjs
|
|
|
|
await import("dayjs/locale/en.js");
|
|
|
|
dayjs.locale("en");
|
2025-04-28 17:30:58 +03:00
|
|
|
});
|