Skip to content

Commit

Permalink
chore: update language codes variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Benehiko committed Oct 11, 2023
1 parent fee54ee commit 4390ef3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/react-components/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -182,13 +184,13 @@ export const CountryCodes = [
] as const

export type CustomLanguageFormats = {
[k in (typeof CountryCodes)[number]]?: Partial<TranslationFile>
[k in (typeof LanguageCodes)[number]]?: Partial<TranslationFile>
}

export interface CustomTranslations {
customTranslations: Partial<CustomLanguageFormats>
locale?: (typeof CountryCodes)[number]
defaultLocale?: (typeof CountryCodes)[number]
locale?: (typeof LanguageCodes)[number]
defaultLocale?: (typeof LanguageCodes)[number]
}

const isCustomTranslations = (o: unknown): o is CustomTranslations => {
Expand Down

0 comments on commit 4390ef3

Please sign in to comment.