feature/IO-3181-Test-Framework-Selection - Skeletons complete
This commit is contained in:
27
client/tests/setupI18n.js
Normal file
27
client/tests/setupI18n.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import i18n from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
import en_Translation from "../src/translations/en_us/common.json";
|
||||
import es_Translation from "../src/translations/es/common.json";
|
||||
import fr_Translation from "../src/translations/fr/common.json";
|
||||
|
||||
const resources = {
|
||||
"en-US": en_Translation,
|
||||
"fr-CA": fr_Translation,
|
||||
"es-MX": es_Translation
|
||||
};
|
||||
|
||||
i18n.use(initReactI18next).init({
|
||||
resources,
|
||||
lng: "en-US", // Default to en-US for tests (no LanguageDetector)
|
||||
fallbackLng: "en-US",
|
||||
debug: false, // Disable debug in tests
|
||||
react: {
|
||||
useSuspense: false // Disable Suspense for Vitest
|
||||
},
|
||||
interpolation: {
|
||||
escapeValue: false, // React handles XSS
|
||||
skipOnVariables: false
|
||||
}
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
Reference in New Issue
Block a user