From a8c1961af3d0b33319321b587efa1711ffbfefd2 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 17 Sep 2022 15:17:07 +0200 Subject: [PATCH] Migrate entrypoint to support new i18n-js version --- app/javascript/retrospring/i18n.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/javascript/retrospring/i18n.ts 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;