Files
honey-fe/i18next.config.ts
Hewston Fox fcb8dab8a0
All checks were successful
Deploy to VPS (dist) / deploy (push) Successful in 1m27s
feat: setup i18next
2026-03-10 03:05:06 +02:00

22 lines
596 B
TypeScript

import { readdirSync } from "fs";
import { join } from "path";
export const LOCALES_PATH = join("locales");
export const LOCAL_LOCALES_PATH = join("public", LOCALES_PATH);
export const DEFAULT_LANGUAGE = "en";
export default {
locales: readdirSync(LOCAL_LOCALES_PATH)
.filter((file) => file.endsWith(".json"))
.map((locale) => locale.replace(".json", "")),
defaultLocale: DEFAULT_LANGUAGE,
fallbackLng: DEFAULT_LANGUAGE,
react: {
useSuspense: false,
},
extract: {
input: "src/**/*.{js,jsx,ts,tsx}",
output: join(LOCAL_LOCALES_PATH, "{{language}}.json"),
},
};