Skip to content

Commit

Permalink
Load the default translations in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Nov 14, 2024
1 parent 08eab0c commit f54bfa8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/vitest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { cleanup } from "@testing-library/react";
import "vitest-axe/extend-expect";
import { logger } from "matrix-js-sdk/src/logger";

import EN_GB from "../public/locales/en-GB/app.json"
import { Config } from "./config/Config";

// Bare-minimum i18n config
Expand All @@ -24,6 +25,13 @@ i18n
.init({
lng: "en-GB",
fallbackLng: "en-GB",
supportedLngs: ["en-GB"],
// We embed the translations, so that it never needs to fetch
resources: {
"en-GB": {
app: EN_GB,
},
},
interpolation: {
escapeValue: false, // React has built-in XSS protections
},
Expand Down

0 comments on commit f54bfa8

Please sign in to comment.