From: Dessalines Date: Tue, 28 Sep 2021 14:56:38 +0000 (-0400) Subject: Adding bn, ml, and cs langs X-Git-Url: http://these/git/ui/assets/static/%7BcanonicalUrl%7D?a=commitdiff_plain;h=8a6a8981fcbcecb711257da79800ccdbf46c4197;p=lemmy-ui.git Adding bn, ml, and cs langs --- diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts index 797d381..9068abf 100644 --- a/src/shared/i18next.ts +++ b/src/shared/i18next.ts @@ -1,7 +1,9 @@ import i18next, { i18nTyped } from "i18next"; import { ar } from "./translations/ar"; import { bg } from "./translations/bg"; +import { bn } from "./translations/bn"; import { ca } from "./translations/ca"; +import { cs } from "./translations/cs"; import { cy } from "./translations/cy"; import { da } from "./translations/da"; import { de } from "./translations/de"; @@ -24,6 +26,7 @@ import { ja } from "./translations/ja"; import { ka } from "./translations/ka"; import { km } from "./translations/km"; import { ko } from "./translations/ko"; +import { ml } from "./translations/ml"; import { mnc } from "./translations/mnc"; import { nb_NO } from "./translations/nb_NO"; import { nl } from "./translations/nl"; @@ -89,6 +92,9 @@ const resources = { sk, vi, pt, + bn, + ml, + cs, }; function format(value: any, format: any): any { diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 9ea21fd..594c5bc 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -32,7 +32,9 @@ import markdown_it_sub from "markdown-it-sub"; import markdown_it_sup from "markdown-it-sup"; import moment from "moment"; import "moment/locale/bg"; +import "moment/locale/bn"; import "moment/locale/ca"; +import "moment/locale/cs"; import "moment/locale/cy"; import "moment/locale/da"; import "moment/locale/de"; @@ -54,6 +56,7 @@ import "moment/locale/ja"; import "moment/locale/ka"; import "moment/locale/km"; import "moment/locale/ko"; +import "moment/locale/ml"; import "moment/locale/nb"; import "moment/locale/nl"; import "moment/locale/pl"; @@ -150,6 +153,9 @@ export const languages = [ { code: "vi" }, { code: "pt" }, { code: "ar" }, + { code: "bn" }, + { code: "ml" }, + { code: "cs" }, ]; export const themes = [ @@ -515,6 +521,12 @@ export function getMomentLanguage(): string { lang = "pt"; } else if (lang.startsWith("ar")) { lang = "ar"; + } else if (lang.startsWith("bn")) { + lang = "bn"; + } else if (lang.startsWith("ml")) { + lang = "ml"; + } else if (lang.startsWith("cs")) { + lang = "cs"; } else { lang = "en"; }