summaryrefslogtreecommitdiff
path: root/src/i18n/locales.ts
diff options
context:
space:
mode:
authorJoe Carstairs <jcarstairs@scottlogic.com>2023-08-07 18:18:22 +0100
committerJoe Carstairs <jcarstairs@scottlogic.com>2023-08-07 18:19:06 +0100
commit2fcbccfbd49c6eaf433272749e32589a6f490200 (patch)
treef8fc429709d66ce96d1f0e8c3812f24c13bf9d18 /src/i18n/locales.ts
parentd494739e4823424bb54d81e21b57e4725544eb07 (diff)
parent27a25bfdeb07007e06bd4a608cd9953be04271ec (diff)
Merge branch 'master' of https://github.com/jcarstairs-scottlogic/lallans-wabsteid-astro
Diffstat (limited to 'src/i18n/locales.ts')
-rw-r--r--src/i18n/locales.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/i18n/locales.ts b/src/i18n/locales.ts
new file mode 100644
index 0000000..4192e3f
--- /dev/null
+++ b/src/i18n/locales.ts
@@ -0,0 +1,16 @@
+import type Locale from '../types/Locale';
+
+// Use the magic of TypeScript to guarantee completeness
+const localesHash: { [key in Locale]: 1 } = {
+ 'sco': 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