1 import { enUSLocale } from './dateFnLocales';
4 * The locales are exported as mutable exports:
5 * 1) To avoid using a react context for components deep in the tree
6 * 2) It's more similar to how ttag works
8 export let dateLocale = enUSLocale;
9 export let defaultDateLocale = enUSLocale;
10 export let browserDateLocale = enUSLocale;
11 export let dateLocaleCode = 'en_US';
12 export let browserLocaleCode = 'en_US';
13 export let localeCode = 'en_US';
14 export let languageCode = 'en';
16 export const setLocales = ({
17 localeCode: newLocaleCode = localeCode,
18 languageCode: newLanguageCode = languageCode,
20 localeCode = newLocaleCode;
21 languageCode = newLanguageCode;
24 export const setDateLocales = ({
25 defaultDateLocale: newDefaultDateLocale = defaultDateLocale,
26 browserDateLocale: newBrowserDateLocale = browserDateLocale,
27 browserLocaleCode: newBrowserLocaleCode = browserLocaleCode,
28 dateLocale: newDateLocale = dateLocale,
29 dateLocaleCode: newDateLocaleCode = dateLocaleCode,
31 defaultDateLocale = newDefaultDateLocale;
32 browserDateLocale = newBrowserDateLocale;
33 browserLocaleCode = newBrowserLocaleCode;
34 dateLocale = newDateLocale;
35 dateLocaleCode = newDateLocaleCode;