feat: setup i18next
All checks were successful
Deploy to VPS (dist) / deploy (push) Successful in 1m27s

This commit is contained in:
Hewston Fox
2026-03-10 03:05:06 +02:00
parent ced418544b
commit fcb8dab8a0
19 changed files with 290 additions and 4 deletions

21
i18next.config.ts Normal file
View File

@@ -0,0 +1,21 @@
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"),
},
};