Skip to content

Instantly share code, notes, and snippets.

@honzabilek4
Last active February 3, 2021 09:57
Show Gist options
  • Save honzabilek4/e7008e0e2f752c4f8b1aa517f6d99d6b to your computer and use it in GitHub Desktop.
Save honzabilek4/e7008e0e2f752c4f8b1aa517f6d99d6b to your computer and use it in GitHub Desktop.
import i18next from "i18next";
import enJson from "./locales/en.json";
export const i18n = i18next;
export const initI18n = (callback) => {
i18next.init(
{
lng: "en",
debug: true,
resources: {
en: {
translation: enJson,
},
},
},
function (err, t) {
// Call this function once i18next is initialized
callback();
}
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment