This commit is contained in:
Fredrik Burmester
2024-08-18 17:10:31 +02:00
parent 21c1221138
commit 752cb1cdc6
13 changed files with 198 additions and 39 deletions

22
i18n.ts Normal file
View File

@@ -0,0 +1,22 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "./translations/en.json";
import sv from "./translations/sv.json";
import { getLocales } from "expo-localization";
i18n.use(initReactI18next).init({
compatibilityJSON: "v3",
resources: {
en: { translation: en },
sv: { translation: sv },
},
lng: getLocales()[0].languageCode || "en",
fallbackLng: "en",
interpolation: {
escapeValue: false,
},
});
export default i18n;