Created
February 3, 2021 09:49
-
-
Save honzabilek4/6339cb248657eb47f0f8ecfae2495982 to your computer and use it in GitHub Desktop.
This file contains hidden or 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"; | |
import frJson from "./locales/fr.json"; | |
import csJson from "./locales/cs.json"; | |
export const i18n = i18next; | |
export const initI18n = (callback) => { | |
i18next.init( | |
{ | |
lng: "en", | |
debug: true, | |
resources: { | |
en: { | |
translation: enJson, | |
}, | |
fr: { | |
translation: frJson, | |
}, | |
cs: { | |
translation: csJson, | |
}, | |
}, | |
}, | |
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