From 4390ef31d09963513c3831304230c8394eafdddc Mon Sep 17 00:00:00 2001 From: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> Date: Wed, 11 Oct 2023 10:25:45 +0200 Subject: [PATCH] chore: update language codes variable --- src/react-components/provider.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/react-components/provider.tsx b/src/react-components/provider.tsx index d4244159a..73d2138fa 100644 --- a/src/react-components/provider.tsx +++ b/src/react-components/provider.tsx @@ -42,7 +42,9 @@ export type TranslationFile = { [K in keyof typeof locales.en]: string } -export const CountryCodes = [ +// ISO 639-1 language codes +// https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes +export const LanguageCodes = [ "ab", "aa", "af", @@ -182,13 +184,13 @@ export const CountryCodes = [ ] as const export type CustomLanguageFormats = { - [k in (typeof CountryCodes)[number]]?: Partial + [k in (typeof LanguageCodes)[number]]?: Partial } export interface CustomTranslations { customTranslations: Partial - locale?: (typeof CountryCodes)[number] - defaultLocale?: (typeof CountryCodes)[number] + locale?: (typeof LanguageCodes)[number] + defaultLocale?: (typeof LanguageCodes)[number] } const isCustomTranslations = (o: unknown): o is CustomTranslations => {