Ship Expo Router screens, seeded stores, and polished UX so auth, shop, checkout, prescriptions, loyalty, family, and account processes work end-to-end offline. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
604 B
TypeScript
25 lines
604 B
TypeScript
import i18n from "i18next";
|
|
import { initReactI18next } from "react-i18next";
|
|
import en from "@/locales/en/common.json";
|
|
import am from "@/locales/am/common.json";
|
|
import { useLangStore } from "@/lib/stores/langStore";
|
|
|
|
const initial = useLangStore.getState().language;
|
|
|
|
void i18n.use(initReactI18next).init({
|
|
compatibilityJSON: "v4",
|
|
resources: {
|
|
en: { translation: en },
|
|
am: { translation: am },
|
|
},
|
|
lng: initial,
|
|
fallbackLng: "en",
|
|
interpolation: { escapeValue: false },
|
|
});
|
|
|
|
useLangStore.subscribe((state) => {
|
|
void i18n.changeLanguage(state.language);
|
|
});
|
|
|
|
export default i18n;
|