i18n setup-
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import { langResources } from "./locales/langResources";
const resources = langResources;
i18n
.use(initReactI18next)
.init({
resources,
fallbackLng: "en_us",
debug: true,
interpolation: {
escapeValue: false,
},
react: {
wait: true,
useSuspense: false,
},
});
export default i18n;
warnings-
`i18next: init: no languageDetector is used and no lng is defined.
react-i18next:: i18n.languages were undefined or empty undefined.
i18next: hasLoadedNamespace: i18n.languages were undefined or empty undefined.
i18next::translator: key "Action_Center" for languages "en_us" won't get resolved as namespace "translation" was not yet loaded This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`
adding lng:"en_us" removes all the warning