add prettier code formater

This commit is contained in:
2026-02-15 11:32:30 +01:00
parent 11b3a926d2
commit 627ddfc464
61 changed files with 7471 additions and 7312 deletions

View File

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

View File

@@ -8,46 +8,42 @@ import fr from "@/../locales/fr.json";
import { Config } from "@/config/config";
const resources = {
en: { translation: en },
fr: { translation: fr },
en: { translation: en },
fr: { translation: fr },
};
i18next
.use(initReactI18next)
.init({
resources: resources,
fallbackLng: "fr",
debug: Config.debug,
detection: {
caches: [],
},
interpolation: {
escapeValue: false,
},
ns: ["translation"],
defaultNS: "translation",
})
.then(() => {
[Settings.defaultLocale] = i18next.language.split("-");
i18next.services.formatter?.add(
"capfirst",
(value) => {
if (typeof value !== "string" || !value.length) {
return value;
}
return value.charAt(0).toUpperCase() + value.slice(1);
}
);
});
.use(initReactI18next)
.init({
resources: resources,
fallbackLng: "fr",
debug: Config.debug,
detection: {
caches: [],
},
interpolation: {
escapeValue: false,
},
ns: ["translation"],
defaultNS: "translation",
})
.then(() => {
[Settings.defaultLocale] = i18next.language.split("-");
i18next.services.formatter?.add("capfirst", (value) => {
if (typeof value !== "string" || !value.length) {
return value;
}
return value.charAt(0).toUpperCase() + value.slice(1);
});
});
export function t(message: string, params?: Record<string, unknown>) {
const result = i18next.t(message, params);
if (params?.capfirst && typeof result === "string" && result.length) {
return result.charAt(0).toUpperCase() + result.slice(1);
}
return result;
const result = i18next.t(message, params);
if (params?.capfirst && typeof result === "string" && result.length) {
return result.charAt(0).toUpperCase() + result.slice(1);
}
return result;
}
export default i18next;