{"version":3,"file":"chunk-TranslationsContext.mjs","names":["dtLocaleEnUs","useTranslation","useI18NextTranslation"],"sources":["../../src/providers/ThemeProvider/TranslationsContext.ts"],"sourcesContent":["//\n// Copyright 2022 DXOS.org\n//\n\n// Per-locale entry, not `date-fns/locale`: that barrel re-exports every locale (~1MB of\n// source) for the one default used here.\nimport { enUS as dtLocaleEnUs } from 'date-fns/locale/en-US';\nimport { createContext, useContext } from 'react';\nimport { useTranslation as useI18NextTranslation } from 'react-i18next';\n\n// Kept out of `TranslationsProvider.tsx`: react-refresh only fast-refreshes a module whose exports are all\n// components, so a context and its hook exported beside them force a full page reload on every edit.\n\nexport const initialNs = 'dxos-common';\nexport const initialDtLocale = dtLocaleEnUs;\n\nexport const TranslationsContext = createContext({\n  appNs: initialNs,\n  dtLocale: initialDtLocale,\n});\n\nexport const useTranslation = (...args: Parameters<typeof useI18NextTranslation>) => {\n  const result = useI18NextTranslation(...args);\n  const { dtLocale } = useContext(TranslationsContext);\n  return { ...result, dtLocale };\n};\n"],"mappings":";;;;AAaA,IAAa,YAAY;AACzB,IAAa,kBAAkBA;AAE/B,IAAa,sBAAsB,cAAc;CAC/C,OAAO;CACP,UAAU;AACZ,CAAC;AAED,IAAaC,oBAAkB,GAAG,SAAmD;CACnF,MAAM,SAASC,eAAsB,GAAG,IAAI;CAC5C,MAAM,EAAE,aAAa,WAAW,mBAAmB;CACnD,OAAO;EAAE,GAAG;EAAQ;CAAS;AAC/B"}