Skip to content

Commit

Permalink
Add kab language
Browse files Browse the repository at this point in the history
  • Loading branch information
razzeee committed Nov 17, 2024
1 parent 67e7dd8 commit 2e8a23c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/app/localize.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@
"ia",
"ckb",
"ga",
"kab",
]
1 change: 1 addition & 0 deletions frontend/next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module.exports = {
"ia",
"ckb",
"ga",
"kab",
],
},
// debug: true,
Expand Down
1 change: 1 addition & 0 deletions frontend/next-sitemap.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module.exports = {
"ia",
"ckb",
"ga",
"kab",
].map((language) => ({
href: `https://flathub.org/${language}`,
hreflang: language,
Expand Down
14 changes: 13 additions & 1 deletion frontend/src/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export type Language =
| "ia"
| "ckb"
| "ga"
| "kab"

export const languages: Language[] = [
"en",
Expand All @@ -116,7 +117,6 @@ export const languages: Language[] = [
"ja",
"cs",
"zh-Hans",
"bg",
"uk",
"et",
"ca",
Expand Down Expand Up @@ -146,6 +146,7 @@ export const languages: Language[] = [
"ia",
"ckb",
"ga",
"kab",
]

export function getLocale(language?: string): Locale {
Expand Down Expand Up @@ -248,6 +249,8 @@ export function getLocale(language?: string): Locale {
return ckb
case "ga":
return enUS // date-fns has no Irish locale
case "kab":
return enUS // date-fns has no Kurdish locale

default:
return enGB
Expand Down Expand Up @@ -354,6 +357,8 @@ export function bcpToPosixLocale(language?: string): string {
return "ckb"
case "ga":
return "ga"
case "kab":
return "kab"

default:
return "en_US"
Expand Down Expand Up @@ -460,6 +465,8 @@ export function getLanguageFlag(language: Language): string {
return "🇮🇷"
case "ga":
return "🇮🇳"
case "kab":
return "🇮🇳"
}
}

Expand Down Expand Up @@ -563,6 +570,8 @@ export function getLanguageName(language: Language): string {
return "کوردی"
case "ga":
return "Gaeilge"
case "kab":
return "Kabyle"

default:
return assertUnreachable(language)
Expand Down Expand Up @@ -689,6 +698,8 @@ export function getIntlLocale(language?: string): Intl.Locale {
return new Intl.Locale("ckb")
case "ga":
return new Intl.Locale("ga")
case "kab":
return new Intl.Locale("kab")

default:
return new Intl.Locale("en")
Expand Down Expand Up @@ -744,6 +755,7 @@ export function registerIsoCountriesLocales() {
// No translations for ia
// No translations for ckb
countries.registerLocale(require("i18n-iso-countries/langs/ga.json"))
// No translations for kab

return countries
}
Expand Down

1 comment on commit 2e8a23c

@BoFFire
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @razzeee
Please, no flag for Kabyle kab language.

Thank you.

Please sign in to comment.