Skip to content

Commit

Permalink
Add Interlingua locale
Browse files Browse the repository at this point in the history
  • Loading branch information
razzeee committed Feb 8, 2024
1 parent 307f305 commit aa2a874
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = {
"sv",
"pa",
"sq",
"ia",
],
},
// debug: true,
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export type Language =
| "sv"
| "pa"
| "sq"
| "ia"

export const languages: Language[] = [
"en",
Expand Down Expand Up @@ -139,6 +140,7 @@ export const languages: Language[] = [
"sv",
"pa",
"sq",
"ia",
]

export function getLocale(language: string): Locale {
Expand Down Expand Up @@ -233,6 +235,8 @@ export function getLocale(language: string): Locale {
return sv
case "pa":
return enUS // date-fns has no Punjabi locale
case "ia":
return enUS // date-fns has no Interlingua locale
case "sq":
return sq

Expand Down Expand Up @@ -335,6 +339,8 @@ export function bcpToPosixLocale(language: string): string {
return "pa_IN"
case "sq":
return "sq_XK"
case "ia":
return "ia"

default:
return "en_US"
Expand Down Expand Up @@ -435,6 +441,8 @@ export function getLanguageFlag(language: Language): string {
return "🇮🇳"
case "sq":
return "🇦🇱"
case "ia":
return ""
}
}

Expand Down Expand Up @@ -532,6 +540,8 @@ export function getLanguageName(language: Language): string {
return "ਪੰਜਾਬੀ"
case "sq":
return "Albanian"
case "ia":
return "Interlingua"

default:
return assertUnreachable(language)
Expand Down Expand Up @@ -652,6 +662,8 @@ export function getIntlLocale(language: string): Intl.Locale {
return new Intl.Locale("pa")
case "sq":
return new Intl.Locale("sq")
case "ia":
return new Intl.Locale("ia")
}
}

Expand Down Expand Up @@ -701,6 +713,7 @@ export function registerIsoCountriesLocales() {
countries.registerLocale(require("i18n-iso-countries/langs/sv.json"))
// No translations for pa
countries.registerLocale(require("i18n-iso-countries/langs/sq.json"))
// No translations for ia

return countries
}
Expand Down

0 comments on commit aa2a874

Please sign in to comment.