From: Dessalines Date: Sat, 21 Aug 2021 20:11:28 +0000 (-0400) Subject: Adding vi, sk, mnc, and cy languages. (#378) X-Git-Url: http://these/git/readmes/%7B%60%24%7BarchiveTodayUrl%7D/static/%7Bthis.state.user.avatar%7D?a=commitdiff_plain;h=08aa1bb51116992a65d8a35f1bc8f4df2e7fb5e4;p=lemmy-ui.git Adding vi, sk, mnc, and cy languages. (#378) --- diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts index 565bf03..4ba815c 100644 --- a/src/shared/i18next.ts +++ b/src/shared/i18next.ts @@ -2,6 +2,7 @@ import i18next, { i18nTyped } from "i18next"; import { ar } from "./translations/ar"; import { bg } from "./translations/bg"; import { ca } from "./translations/ca"; +import { cy } from "./translations/cy"; import { da } from "./translations/da"; import { de } from "./translations/de"; import { el } from "./translations/el"; @@ -23,18 +24,21 @@ import { ja } from "./translations/ja"; import { ka } from "./translations/ka"; import { km } from "./translations/km"; import { ko } from "./translations/ko"; +import { mnc } from "./translations/mnc"; import { nb_NO } from "./translations/nb_NO"; import { nl } from "./translations/nl"; import { oc } from "./translations/oc"; import { pl } from "./translations/pl"; import { pt_BR } from "./translations/pt_BR"; import { ru } from "./translations/ru"; +import { sk } from "./translations/sk"; import { sq } from "./translations/sq"; import { sr_Latn } from "./translations/sr_Latn"; import { sv } from "./translations/sv"; import { th } from "./translations/th"; import { tr } from "./translations/tr"; import { uk } from "./translations/uk"; +import { vi } from "./translations/vi"; import { zh } from "./translations/zh"; import { zh_Hant } from "./translations/zh_Hant"; import { getLanguage } from "./utils"; @@ -79,6 +83,10 @@ const resources = { id, nb_NO, zh_Hant, + cy, + mnc, + sk, + vi, }; function format(value: any, format: any): any { diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 9e07f75..ac7ad84 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -30,6 +30,7 @@ import markdown_it_sup from "markdown-it-sup"; import moment from "moment"; import "moment/locale/bg"; import "moment/locale/ca"; +import "moment/locale/cy"; import "moment/locale/da"; import "moment/locale/de"; import "moment/locale/el"; @@ -55,11 +56,13 @@ import "moment/locale/nl"; import "moment/locale/pl"; import "moment/locale/pt-br"; import "moment/locale/ru"; +import "moment/locale/sk"; import "moment/locale/sq"; import "moment/locale/sr"; import "moment/locale/sv"; import "moment/locale/tr"; import "moment/locale/uk"; +import "moment/locale/vi"; import "moment/locale/zh-cn"; import { Subscription } from "rxjs"; import { delay, retryWhen, take } from "rxjs/operators"; @@ -138,6 +141,10 @@ export const languages = [ { code: "it" }, { code: "bg" }, { code: "zh_Hant" }, + { code: "cy" }, + { code: "mnc" }, + { code: "sk" }, + { code: "vi" }, ]; export const themes = [ @@ -483,6 +490,12 @@ export function getMomentLanguage(): string { lang = "id"; } else if (lang.startsWith("nb")) { lang = "nb"; + } else if (lang.startsWith("cy")) { + lang = "cy"; + } else if (lang.startsWith("sk")) { + lang = "sk"; + } else if (lang.startsWith("vi")) { + lang = "vi"; } else { lang = "en"; }