summaryrefslogtreecommitdiff
path: root/src/i18n/locales.ts
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-05 21:16:45 +0100
committerJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-05 21:18:16 +0100
commit90254344d599bc977c0661f7c9681b7509a9076e (patch)
treed5c521f154994a33e0d09db48971d1a967a6f543 /src/i18n/locales.ts
parent97147d56d93c7949fdccf22abe569b1b9d7a22ab (diff)
Moves to root folder
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