add base front

This commit is contained in:
Julien Aldon
2026-02-10 16:49:26 +01:00
parent be7ca58513
commit 7df0af8f1d
26 changed files with 4541 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
export const Config = {
backend_uri: import.meta.env.VITE_API_URL,
debug: import.meta.env.NODE_ENV === "development"
}

View File

@@ -0,0 +1,41 @@
/* eslint-disable @typescript-eslint/no-restricted-imports */
/* eslint-disable @typescript-eslint/no-explicit-any */
import i18next from "i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import { Settings } from "luxon";
import { initReactI18next } from "react-i18next";
import en from "../../locales/en.json";
import fr from "../../locales/fr.json";
import { Config } from "./config";
const resources = {
en: { translation: en },
fr: { translation: fr },
};
i18next
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources: resources,
fallbackLng: "en",
debug: Config.debug,
detection: {
caches: [],
},
interpolation: {
escapeValue: false,
},
ns: ["translation"],
defaultNS: "translation",
})
.then(() => {
[Settings.defaultLocale] = i18next.language.split("-");
});
export function t(message: string, params?: Record<string, any>) {
return i18next.t(message, params);
}
export default i18next;