diff options
Diffstat (limited to 'src/i18n/locales.ts')
| -rw-r--r-- | src/i18n/locales.ts | 16 |
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 |
