diff --git a/app/javascript/retrospring/i18n.ts b/app/javascript/retrospring/i18n.ts new file mode 100644 index 00000000..0af48928 --- /dev/null +++ b/app/javascript/retrospring/i18n.ts @@ -0,0 +1,12 @@ + +import Cookies from 'js-cookie' +import { I18n } from "i18n-js" +import translations from "./i18n.json"; + +const i18n = new I18n(); +i18n.store(translations); +i18n.defaultLocale = "en"; +i18n.enableFallback = true; +i18n.locale = Cookies.get('hl') || 'en'; + +export default i18n;