From: Dessalines Date: Fri, 3 Sep 2021 03:12:08 +0000 (-0400) Subject: Add pt lang. X-Git-Url: http://these/git/ui/assets/static/git-logo.png?a=commitdiff_plain;h=ad04657f81c87697759bfe5f681d85ccf1ebb6e6;p=lemmy-ui.git Add pt lang. --- diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts index 4ba815c..797d381 100644 --- a/src/shared/i18next.ts +++ b/src/shared/i18next.ts @@ -29,6 +29,7 @@ import { nb_NO } from "./translations/nb_NO"; import { nl } from "./translations/nl"; import { oc } from "./translations/oc"; import { pl } from "./translations/pl"; +import { pt } from "./translations/pt"; import { pt_BR } from "./translations/pt_BR"; import { ru } from "./translations/ru"; import { sk } from "./translations/sk"; @@ -87,6 +88,7 @@ const resources = { mnc, sk, vi, + pt, }; function format(value: any, format: any): any { diff --git a/src/shared/utils.ts b/src/shared/utils.ts index ac7ad84..86e513b 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -145,6 +145,7 @@ export const languages = [ { code: "mnc" }, { code: "sk" }, { code: "vi" }, + { code: "pt" }, ]; export const themes = [ @@ -446,7 +447,7 @@ export function getMomentLanguage(): string { lang = "fa"; } else if (lang.startsWith("pl")) { lang = "pl"; - } else if (lang.startsWith("pt")) { + } else if (lang.startsWith("pt_BR")) { lang = "pt-br"; } else if (lang.startsWith("ja")) { lang = "ja"; @@ -496,6 +497,8 @@ export function getMomentLanguage(): string { lang = "sk"; } else if (lang.startsWith("vi")) { lang = "vi"; + } else if (lang.startsWith("pt")) { + lang = "pt"; } else { lang = "en"; }