From 4dea89fa67bf52fff2c4031a19244823aec7493e Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Fri, 4 Aug 2023 18:34:12 +0100 Subject: Defines a default locale --- frontend/src/i18n/locales.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'frontend/src') diff --git a/frontend/src/i18n/locales.ts b/frontend/src/i18n/locales.ts index 7663848..4192e3f 100644 --- a/frontend/src/i18n/locales.ts +++ b/frontend/src/i18n/locales.ts @@ -6,4 +6,11 @@ const localesHash: { [key in Locale]: 1 } = { 'en-GB': 1, }; +// Use the magic of TypeScript to guarantee that the +// default locale is a locale, but also have const +// string type +const defaultLocaleAsLocale: Locale = 'sco'; +const defaultLocale: 'sco' = defaultLocaleAsLocale; + +export { defaultLocale }; export default Object.keys(localesHash) as Locale[]; \ No newline at end of file -- cgit v1.2.3