Last active
February 3, 2021 09:57
-
-
Save honzabilek4/e7008e0e2f752c4f8b1aa517f6d99d6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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